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 © 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.

Construction of the DAPTYPE is based on the keyword strings for the binning_method, the stellar_continuum_templates, and the emission_line_model_templates, with the strings separated by dashes. For example, the DAPTYPE would be 'HYB10-MILESHC-MILESHC' when the binning method is HYB10 and the MILESHC library is used for the continuum templates in both the stellar and emission-line fitting modules.

You can construct a list of all the DAPTYPE strings for the methods in a DAP AnalysisPlan as follows:

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

daptypes = []
for plan in AnalysisPlanSet.from_par_file(plan_file):
    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_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 (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 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.