The cartopy module¶
The top level cartopy module contains the
config dictionary which controls various aspects of cartopy’s behaviour.
The config dictionary stores global configuration values for cartopy.
In the first instance, the config is defined in
cartopy/__init__.py. It is possible to provide site wide customisations by including a
siteconfig.pyfile along with the cartopy source code.
siteconfig.pyshould contain a function called
update_configwhich takes the config dictionary instance as its first and only argument (from where it is possible to update the dictionary howsoever desired).
For users without write permission to the cartopy source directory, a package called
cartopy_userconfigshould be made importable (consider putting it in
site.getusersitepackages()) and should expose a function called
update_configwhich takes the config dictionary as its first and only argument.
Keys in the config dictionary:
pre_existing_data_dir- the absolute path to a directory where standard
data (such as that from NaturalEarth) can be found. If it is not found in this location the
data_dirconfig item will be used.
data_dir- the absolute path to a directory where standard data (such
as that from NaturalEarth) can be found. If it is not found and the item is downloadable cartopy will download the appropriate file(s) to a subdirectory of this directory, therefore
data_dirshould be writable by the user.
repo_data_dir- the absolute path to the directory where the data
delivered with the cartopy repository is stored. Typically this will only be set by OS packagers and system administrators for site wide deployments.