EUMETSAT has many Level 0, 1, and 2 products in different internal formats. These products are only used in-house and are not send out to the users. Therefore, satpy-readers for such products would quickly pollute satpy/etc/readers/-directory with *.yaml-files that are only useful for a small amount of PyTroll users.
The workaround with current implementation is to use ppp_config_dir-keyword when creating a Scene-object:
This is a proposal for a possibility to add a local config directory where config files would be automatically searched. Proposed solution by modifying config_search_paths-method in satpy/config.py by setting an environmental variable, e.g. SATPY_LOCAL_CONFIG
Proposed modification
def config_search_paths(filename, *search_dirs, **kwargs):
# Get the environment variable value every time (could be set dynamically)
# FIXME: Consider removing the 'magic' environment variable all together
CONFIG_PATH = get_environ_config_dir()
LOCAL_PATH = os.environ.get('SATPY_LOCAL_CONFIG')
paths = [filename, os.path.basename(filename)]
paths += [os.path.join(search_dir, filename) for search_dir in search_dirs]
if LOCAL_PATH:
paths += [os.path.join(LOCAL_PATH, filename)]
# FUTURE: Remove CONFIG_PATH because it should be included as a search_dir
paths += [os.path.join(CONFIG_PATH, filename),
os.path.join(PACKAGE_CONFIG_PATH, filename)]
if kwargs.get("check_exists", True):
paths = [x for x in paths if os.path.isfile(x)]
# flip the order of the list so builtins are loaded first
return paths[::-1]
Any ideas, comments, thoughts? Would such modification be useful for other institutes/organizations? Or is this just silly? ;)
EUMETSAT has many Level 0, 1, and 2 products in different internal formats. These products are only used in-house and are not send out to the users. Therefore,
satpy
-readers for such products would quickly pollutesatpy/etc/readers/
-directory with*.yaml
-files that are only useful for a small amount of PyTroll users.The workaround with current implementation is to use
ppp_config_dir
-keyword when creating aScene
-object:This is a proposal for a possibility to add a local config directory where config files would be automatically searched. Proposed solution by modifying
config_search_paths
-method insatpy/config.py
by setting an environmental variable, e.g.SATPY_LOCAL_CONFIG
Proposed modification
Any ideas, comments, thoughts? Would such modification be useful for other institutes/organizations? Or is this just silly? ;)