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.

Revision history

23 Apr 2015: Original implementation by K. Westfall (KBW)
19 May 2015: (KBW) Documentation and Sphinx tests
20 May 2015: (KBW) TODO: Change the default names of the par and output fits files
15 Jun 2015: (KBW) Added default functions moved from mangadap.drpfile
16 Jun 2015: (KBW) Added wavelength limits and lower flux limit to mangadap.config.inputdata.available_template_libraries()
17 Jun 2015: (KBW) Moved declarations of template library keys to its own function: default_template_library_keys, and edited available_template_libraries() accordingly
27 Aug 2015: (KBW) Changed the name of the plan file; added default_dap_file_root() based on file_root() from mangadap.scripts.rundap.
28 Aug 2015: (KBW) Added default_manga_fits_root() and default_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) Changed manga.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) Created mangadap.config.inputdata and moved default_template_libraries there (and changed it to mangadap.config.inputdata.available_template_libraries(). No longer need ConfigParser here.
12 Jul 2016: (KBW) Changed default_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) Added default_redshift_fix_file().

License

Copyright © 2019, SDSS-IV/MaNGA Pipeline Group


mangadap.config.defaults.cube_pixelscale()[source]

Return the default pixel scale of the DRP CUBE files in arcsec.

mangadap.config.defaults.cube_recenter()[source]

Return the default recentering flag used when regridding the DRP RSS spectra into the CUBE format.

mangadap.config.defaults.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.dap_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 drp_version().

  • dapver (str, optional) – DAP version. Default is to use dap_version().

Returns

Path to analysis directory

Return type

str

mangadap.config.defaults.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 drp_version().

  • dapver (str, optional) – DAP version. Default is to use dap_version().

  • analysis_path (str, optional) – Path to the root analysis directory. Default is to use dap_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.dap_config(plate, ifudesign, drpver=None, dapver=None, analysis_path=None, directory_path=None)[source]

Return the full path to the DAP configuration file.

The configuration file provides the input data necessary to instantiate a mangadap.datacube.manga.MaNGADataCube.

Parameters
  • plate (int) – Plate number

  • ifudesign (int) – IFU design number

  • drpver (str, optional) – DRP version. Default is to use drp_version().

  • dapver (str, optional) – DAP version. Default is to use dap_version().

  • analysis_path (str, optional) – Path to the root analysis directory. Default is to use dap_analysis_path().

  • directory_path (str, optional) – Path to the directory with the DAP output files. Default is to use dap_common_path()

Returns

Full path to the DAP par file

Return type

str

mangadap.config.defaults.dap_config_root()[source]

Return the root directory with the DAP config data.

mangadap.config.defaults.dap_data_root()[source]

Return the root directory with the DAP data.

mangadap.config.defaults.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.

Returns

Name of the DAP output file.

Return type

str

mangadap.config.defaults.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, 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.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 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 += [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

mangadap.config.defaults.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 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 drp_version().

  • dapver (str, optional) – DAP version. Default is to use dap_version().

  • analysis_path (str, optional) – Path to the root analysis directory. Default is to use dap_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..

mangadap.config.defaults.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; see mangadap.par.obsinput.ObsInputPar.

  • drpver (str, optional) – DRP version. Default is to use drp_version().

  • dapver (str, optional) – DAP version. Default is to use dap_version().

  • analysis_path (str, optional) – Path to the root analysis directory. Default is to use dap_analysis_path().

  • directory_path (str, optional) – Path to the directory with the DAP output files. Default is to use dap_common_path()

Returns

Full path to the DAP par file

Return type

str

mangadap.config.defaults.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 drp_version().

  • ( (dapver) – obj:str, optional): DAP version. Default is to use :func:`dap_version.

  • analysis_path (str, optional) – Path to the root analysis directory. Default is to use dap_analysis_path()

Returns

Full path to the DAP plan file

Return type

str

mangadap.config.defaults.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.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 use drp_version().

  • dapver (str, optional) – DAP version. Default is to use dap_version().

  • analysis_path (str, optional) – Path to the root analysis directory. Default is to use dap_analysis_path()

Returns

Full path to the DAPall fits file.

Return type

str

mangadap.config.defaults.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 drp_version().

  • redux_path (str, optional) – Path to the root reduction directory. Default is to use drp_redux_path().

Returns

Path to the directory with the 3D products of the DRP

Return type

str

mangadap.config.defaults.drp_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 drp_version().

Returns

Path to reduction directory

Return type

str

mangadap.config.defaults.drp_version()[source]

Return the DRP version defined by the environmental variable MANGADRP_VER.

mangadap.config.defaults.drpall_file(drpver=None, redux_path=None)[source]

Return the path to the DRPall file.

Parameters
  • drpver (str, optional) – DRP version. Default is to use drp_version().

  • redux_path (str, optional) – Path to the root reduction directory. Default is to use drp_redux_path().

Returns

Full path to the DRPall fits file.

Return type

str

mangadap.config.defaults.idlutils_dir()[source]

Return the default IDLUTILS directory.

mangadap.config.defaults.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.photometry_fix_file()[source]

Return the path to the default photometry fix file.

Returns

Expected path to the photometry-fix parameter file.

Return type

str

mangadap.config.defaults.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.ndarray

mangadap.config.defaults.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.regrid_rlim()[source]

Return the default limiting radius for the Gaussian kernel used when regridding the DRP RSS spectra into the CUBE format.

mangadap.config.defaults.regrid_sigma()[source]

Return the default standard deviation of the Gaussian kernel used when regridding the DRP RSS spectra into the CUBE format.

mangadap.config.defaults.sdss_maskbits_file()[source]

Return the path to the sdss maskbits yanny file.