mangadap.config.defaults module¶
Provides a set of functions that define and return defaults used by the MaNGA DAP, such as paths and file names.
- License:
- Copyright (c) 2019, SDSS-IV/MaNGA Pipeline Group
- Licensed under BSD 3-clause license - see LICENSE.rst
- Revision history:
- 23 Apr 2015: Original implementation by K. Westfall (KBW)19 May 2015: (KBW) Documentation and Sphinx tests20 May 2015: (KBW) TODO: Change the default names of the par and output fits files15 Jun 2015: (KBW) Added default functions moved from
mangadap.drpfile
16 Jun 2015: (KBW) Added wavelength limits and lower flux limit tomangadap.config.inputdata.available_template_libraries()
17 Jun 2015: (KBW) Moved declarations of template library keys to its own function: default_template_library_keys, and editedavailable_template_libraries()
accordingly27 Aug 2015: (KBW) Changed the name of the plan file; addeddefault_dap_file_root()
based on file_root() frommangadap.survey.rundap
.28 Aug 2015: (KBW) Addeddefault_manga_fits_root()
anddefault_cube_covariance_file()
07 Oct 2015: (KBW) Adjusted for changes to naming of the template library database definitions. Added M11-STELIB-ZSOL library.29 Jan 2016: (KBW) Changedmanga.config.inputdata.available_template_libraries()
to use configparser ini files to define each template library.03 Feb 2016: (KBW) Added checks for required environmental variables.17 Feb 2016: (KBW) Added try/except blocks for importing ConfigParser.16 Mar 2016: (KBW) Createdmangadap.config.inputdata
and moved default_template_libraries there (and changed it tomangadap.config.inputdata.available_template_libraries()
. No longer need ConfigParser here.12 Jul 2016: (KBW) Changeddefault_manga_fits_root()
to accommodate MAPS output name.05 May 2017: (KBW)default_dap_version()
returns internal version if MANGADAP_VER environmental variable is not defined.01 Mar 2018: (KBW) Addeddefault_redshift_fix_file()
.
-
mangadap.config.defaults.
dap_source_dir
()[source]¶ Return the root path to the DAP source directory.
-
mangadap.config.defaults.
default_analysis_path
(drpver=None, dapver=None)[source]¶ Return the main output path for the DAP using the environmental variable MANGA_SPECTRO_ANALYSIS.
Parameters: - drpver (str) – (Optional) DRP version. Default is to use
default_drp_version()
. - dapver (str) – (Optional) DAP version. Default is to use
default_dap_version()
.
Returns: Path to analysis directory
Return type: str
- drpver (str) – (Optional) DRP version. Default is to use
-
mangadap.config.defaults.
default_cube_pixelscale
()[source]¶ Return the default pixel scale of the DRP CUBE files in arcsec.
-
mangadap.config.defaults.
default_cube_recenter
()[source]¶ Return the default recentering flag used when regridding the DRP RSS spectra into the CUBE format.
-
mangadap.config.defaults.
default_cube_width_buffer
()[source]¶ Return the default width buffer in pixels used when regridding the DRP RSS spectra into the CUBE format.
-
mangadap.config.defaults.
default_dap_common_path
(plate=None, ifudesign=None, drpver=None, dapver=None, analysis_path=None)[source]¶ Return the path to the path to the directory with data common to multiple binning schemes.
Parameters: - plate (int) – (Optional) Plate number, for reference directory of a specific plate.
- ifudesign (int) – (Optional) IFU design number.
- drpver (str) – (Optional) DRP version. Default is to use
default_drp_version()
. - dapver (str) – (Optional) DAP version. Default is to use
default_dap_version()
. - analysis_path (str) – (Optional) Path to the root analysis
directory. Default is to use
default_analysis_path()
Returns: Path to the directory with DAP reference files
Return type: str
Raises: ValueError
– Raised if IFU design is provided and plate is not.
-
mangadap.config.defaults.
default_dap_file_name
(plate, ifudesign, output_mode, mode=None, compressed=True)[source]¶ Return the name of the DAP output fits file.
Parameters: - plate (int) – Plate number
- ifudesign (int) – IFU design number
- output_mode (str) – Output mode designation
- mode (str) – (Optional) Mode of the output fits file. Options are: ‘LINCUBE’, ‘LINRSS’, ‘LOGCUBE’, ‘LOGRSS’, or ‘MAPS’. Default is that no mode is included in the name.
- compressed (bool) – (Optional) Append ‘.gz’ to the output file name. Default is True.
Returns: Name of the DAP output file.
Return type: str
-
mangadap.config.defaults.
default_dap_file_root
(plate, ifudesign, mode=None)[source]¶ Generate the root name of the MaNGA DAP parameter and script files for a given plate/ifudesign/mode.
Parameters: - plate (int) – Plate number
- ifudesign (int) – IFU design number
- mode (str) – (Optional) Mode of the DRP reduction; either RSS or CUBE. If None (default), the mode is excluded from the file root.
Returns: Root name for the DAP file: mangadap-[PLATE]-[IFUDESIGN] or mangadap-[PLATE]-[IFUDESIGN]-LOG[MODE]
Return type: str
-
mangadap.config.defaults.
default_dap_method
(binning_method, stellar_continuum_templates, emission_line_model_templates)[source]¶ Construct the “DAPTYPE” based on the analysis plan.
The construction is based on directly provided strings for binning_method, stellar_continuum_templates, and emission_line_model_templates. The DAPTYPE is constructed as these three strings separated by dashes. E.g., DAPTYPE = ‘HYB10-MILESHC-MILESHC’ when the binning method is HYB10 and the MILESHC library is used as templates for both the stellar and emission-line fitting.
With a analysis plan file, run the following to get the list of daptypes:
from mangadap.par.analysisplan import AnalysisPlanSet from mangadap.proc.spatiallybinnedspectra import SpatiallyBinnedSpectra from mangadap.proc.stellarcontinuummodel import StellarContinuumModel from mangadap.proc.emissionlinemodel import EmissionLineModel from mangadap.config.defaults import default_dap_method plans = AnalysisPlanSet.from_par_file(plan_file) daptypes = [] for plan in plans: bin_method = SpatiallyBinnedSpectra.define_method(plan['bin_key']) sc_method = StellarContinuumModel.define_method(plan['continuum_key']) el_method = EmissionLineModel.define_method(plan['elfit_key']) daptypes += [default_dap_method(bin_method['key'], sc_method['template_library'], el_method['continuum_templates'])]
Parameters: - binning_method (
str
) – String used to define the binning method. - stellar_continuum_templates (
str
) – String defining the template library used in the stellar continuum (stellar kinematics) modeling. - emission_line_model_templates (
str
) – String defining the template library used in the emission-line modeling. Can be None, meaning that the continuum templates are the same as used for the stellar-continuum modeling.
Returns: The string representation of the analysis method.
Return type: str
- binning_method (
-
mangadap.config.defaults.
default_dap_method_path
(method, plate=None, ifudesign=None, qa=False, ref=False, drpver=None, dapver=None, analysis_path=None)[source]¶ Return the path to the designated subdirectory built using the plan key identifiers or directly using the provided method.
The “method” identifying each plan is currently build using the keywords for the binning type and the continuum-fitting key. Nominally, the latter should include the template set used.
Parameters: - method (str) – String defining the method identifier for a set of
DAP output files. These should be built using
default_dap_method()
. - plate (int) – (Optional) Plate number.
- ifudesign (int) – (Optional) IFU design number.
- qa (bool) – (Optional) Give the path to the qa/ subdirectory
- ref (bool) – (Optional) Give the path to the ref/ subdirectory
- drpver (str) – (Optional) DRP version. Default is to use
default_drp_version()
. - dapver (str) – (Optional) DAP version. Default is to use
default_dap_version()
. - analysis_path (str) – (Optional) Path to the root analysis
directory. Default is to use
default_analysis_path()
Returns: Path to the plan subdirectory
Return type: str
Raises: ValueError
– Raised if IFU design is provided and plate is not, or if either qa or ref are true and one or both of plate and IFU design are not provided..- method (str) – String defining the method identifier for a set of
DAP output files. These should be built using
-
mangadap.config.defaults.
default_dap_par_file
(plate, ifudesign, mode, partype='input', drpver=None, dapver=None, analysis_path=None, directory_path=None)[source]¶ Return the full path to a par file used by the DAP to analyze the specified DRP output file.
Parameters: - plate (int) – Plate number
- ifudesign (int) – IFU design number
- mode (str) – Mode of the DRP reduction; either RSS or CUBE
- partype (str) – An “unregulated” type for the parameter file.
The default is
'input'
, signifying the input set of observational parameters; seemangadap.par.obsinput.ObsInputPar
. - drpver (str) – (Optional) DRP version. Default is to use
default_drp_version()
. - dapver (str) – (Optional) DAP version. Default is to use
default_dap_version()
. - analysis_path (str) – (Optional) Path to the root analysis
directory. Default is to use
default_analysis_path()
- directory_path (str) – (Optional) Path to the directory with
the DAP output files. Default is to use
default_dap_common_path()
Returns: Full path to the DAP par file
Return type: str
-
mangadap.config.defaults.
default_dap_plan_file
(drpver=None, dapver=None, analysis_path=None)[source]¶ Return the full path to the DAP plan file.
Parameters: - drpver (str) – (Optional) DRP version. Default is to use
default_drp_version()
. - dapver (str) – (Optional) DAP version. Default is to use
default_dap_version()
. - analysis_path (str) – (Optional) Path to the root analysis
directory. Default is to use
default_analysis_path()
Returns: Full path to the DAP plan file
Return type: str
- drpver (str) – (Optional) DRP version. Default is to use
-
mangadap.config.defaults.
default_dap_version
()[source]¶ Return the DAP version defined by the environmental variable MANGADAP_VER. If that environmental variable does not exist, mangadap.__version__ is returned.
-
mangadap.config.defaults.
default_dapall_file
(drpver=None, dapver=None, analysis_path=None)[source]¶ Return the path to the DAPall file.
Parameters: - drpver (
str
, optional) – DRP version. Default is to usedefault_drp_version()
. - dapver (
str
, optional) – DAP version. Default is to usedefault_dap_version()
. - analysis_path (
str
, optional) – Path to the root analysis directory. Default is to usedefault_analysis_path()
Returns: Full path to the DAPall fits file.
Return type: str
- drpver (
-
mangadap.config.defaults.
default_drp_directory_path
(plate, drpver=None, redux_path=None)[source]¶ Return the exact directory path with the DRP file.
Parameters: - plate (int) – Plate number
- drpver (str) – (Optional) DRP version. Default is to use
default_drp_version()
. - redux_path (str) – (Optional) Path to the root reduction
directory. Default is to use
default_redux_path()
.
Returns: Path to the directory with the 3D products of the DRP
Return type: str
-
mangadap.config.defaults.
default_drp_version
()[source]¶ Return the DRP version defined by the environmental variable MANGADRP_VER.
-
mangadap.config.defaults.
default_drpall_file
(drpver=None, redux_path=None)[source]¶ Return the path to the DRPall file.
Parameters: - drpver (
str
, optional) – DRP version. Default is to usedefault_drp_version()
. - redux_path (
str
, optional) – Path to the root reduction directory. Default is to usedefault_redux_path()
.
Returns: Full path to the DRPall fits file.
Return type: str
- drpver (
-
mangadap.config.defaults.
default_manga_fits_root
(plate, ifudesign, mode=None)[source]¶ Generate the main root name for the output MaNGA fits files for a given plate/ifudesign/mode.
Parameters: - plate (int) – Plate number
- ifudesign (int) – IFU design number
- mode (str) – (Optional) Mode of the output fits file. Options are: ‘LINCUBE’, ‘LINRSS’, ‘LOGCUBE’, ‘LOGRSS’, or ‘MAPS’. Default is that no mode is included in the name.
Returns: Root name for a MaNGA fits file: manga-[PLATE]-[IFUDESIGN]-[MODE]
Return type: str
Raises: ValueError
– Raised if mode is not a valid option.
-
mangadap.config.defaults.
default_plate_target_files
()[source]¶ Return the default plateTarget files in mangacore and their associated catalog indices. The catalog indices are determined assuming the file names are of the form:
'plateTargets-{0}.par'.format(catalog_id)
Returns: Two arrays: the first contains the identified plateTargets files found using the default search string, the second provides the integer catalog index determined for each file. Return type: numpy.array
-
mangadap.config.defaults.
default_redshift_fix_file
()[source]¶ Return the path to the default redshift fix file.
Returns: Expected path to the redshift-fix parameter file. Return type: str
-
mangadap.config.defaults.
default_redux_path
(drpver=None)[source]¶ Return the main output path for the DRP products using the environmental variable MANGA_SPECTRO_REDUX.
Parameters: drpver (str) – (Optional) DRP version. Default is to use default_drp_version()
.Returns: Path to reduction directory Return type: str
-
mangadap.config.defaults.
default_regrid_rlim
()[source]¶ Return the default limiting radius for the Gaussian kernel used when regridding the DRP RSS spectra into the CUBE format.