About the Global Config¶
sdss_brain includes a global configuration class, Config, which handles parameters used globally
by sdss_brain and potentially other SDSS packages.
General custom configuration can be accomplished using the sdss_brain.yml YAML configuration file. This file
can also be used to set custom user choices. See the sdsstools config
or the Python template config
for more details on the custom configuration file.The Config class reads in this file and updates any
overlapping parameters with user values. This way you can set a custom SDSS configuration only once.
The Config class contains the following attributes:
mode: the MMA mode to operate in
release: the data release to use
download: If True, downloads any files accessed with
sdss_accessignore_db: If True, ignores any database connections used with
Brain-based tools
Only valid releases are allowed when setting a new release. Allowed releases are those returned by the
SDSS tree package, using the get_available_releases method. Valid releases are typically any public
data releases (DRs) or official survey-specific internal releases, e.g interal MaNGA Product Launches (MPLs).
Additionally, setting the release to work allows sdss_brain and sdss_access to access files not yet
within a release, specified in the current sdsswork.cfg Tree environment configuration.
To set a new global release:
from sdss_brain.config import config
config.set_release('DR14')
To set global “working” versions:
# set the new work versions
from sdss_brain.config import config
config.set_work_versions({'drpver': 'v2_4_3', 'run2d': 'v5_10_0', 'apred': 'r12'})
# access the set work versions
config.work_versions
The Custom Config File¶
To customize the configuration for the Brain, you can create a new YAML config file at
yml. This config file allows you to set custom configuration options that
are loaded when the Brain config is instantiated. The following entries are available:
ignore_db: If True, ignores any database connections used with
Brain-based toolsdownload: If True, downloads any data files accessed with
sdss_accessdefault_release: Sets the default data release to use
work_versions: Sets the specified versions to use when accessing “sdsswork” files
The following example config file instructs the Brain to always ignore database connections, to not
download data files by default, to use DR15 as the default release, and to set the work versions for
MaNGA, APOGEE, and EBOSS data to (v2_4_3, 2.2.1), r12, and v5_10_0, respectively.
ignore_db: True
download: False
default_release: DR15
work_versions:
drpver: v2_4_3
dapver: 2.2.1
apred: r12
run2d: v5_10_0
