rail.creation.degraders.observing_condition_degrader module
Degrader applied to the magnitude error based on a set of input observing condition maps
- class rail.creation.degraders.observing_condition_degrader.ObsCondition
Bases:
NoisifierPhotometric errors based on observation conditions
This degrader calculates spatially-varying photometric errors using input survey condition maps. The error is based on the LSSTErrorModel from the PhotErr python package.
mask: str, optional Path to the mask covering the survey footprint in HEALPIX format. Notice that all negative values will be set to zero. weight: str, optional Path to the weights HEALPIX format, used to assign sample galaxies to pixels. Default is weight="", which uses uniform weighting. tot_nVis_flag: bool, optional If any map for nVisYr are provided, this flag indicates whether the map shows the total number of visits in nYrObs (tot_nVis_flag=True), or the average number of visits per year (tot_nVis_flag=False). The default is set to True. map_dict: dict, optional A dictionary that contains the paths to the survey condition maps in HEALPIX format. This dictionary uses the same arguments as LSSTErrorModel (from PhotErr). The following arguments, if supplied, may contain either a single number (as in the case of LSSTErrorModel), or a path: [m5, nVisYr, airmass, gamma, msky, theta, km, tvis, EBV] For the following keys: [m5, nVisYr, gamma, msky, theta, km] numbers/paths for specific bands must be passed. Example: {"m5": {"u": path, ...}, "theta": {"u": path, ...},} Other LSSTErrorModel parameters can also be passed in this dictionary (e.g. a necessary one may be [nYrObs] or the survey condition maps). If any argument is not passed, the default value in PhotErr's LsstErrorModel is adopted.- Parameters:
output_mode ([str] default=default) – What to do with the outputs. The options are ‘default’, where outputs will be written to files and some returned, and ‘return’, where outputs will only be returned and not written.
seed ([type not specified] default=None) – Set to an int to force reproducible results.
nside ([int] default=128) – nside for the input maps in HEALPIX format.
mask ([str] default=/home/docs/checkouts/readthedocs.org/user_builds/rail-hub/conda/stable/lib/python3.14/site-packages/rail/creation/degraders/../../examples_data/creation_data/data/survey_conditions/DC2-mask-neg-nside-128.fits) – mask for the input maps in HEALPIX format.
weight ([str] default=/home/docs/checkouts/readthedocs.org/user_builds/rail-hub/conda/stable/lib/python3.14/site-packages/rail/creation/degraders/../../examples_data/creation_data/data/survey_conditions/DC2-dr6-galcounts-i20-i25.3-nside-128.fits) – weight for assigning pixels to galaxies in HEALPIX format.
tot_nVis_flag ([bool] default=True) – flag indicating whether nVisYr is the total or average per year if supplied.
random_seed ([int] default=42) – random seed for reproducibility
map_dict ([dict] default={'m5': {'i': '/home/docs/checkouts/readthedocs.org/user_builds/rail-hub/conda/stable/lib/python3.14/site-packages/rail/creation/degraders/../../examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_fiveSigmaDepth_i_and_nightlt1825_HEAL.fits'}, 'nYrObs': 5.0}) – dictionary containing the paths to the survey condition maps and/or additional LSSTErrorModel parameters.
input (PqHandle (INPUT))
output (PqHandle (OUTPUT))
- BAND_A_EBV = {'g': 3.64, 'i': 2.06, 'r': 2.7, 'u': 4.81, 'y': 1.31, 'z': 1.58}
- STANDARD_BANDS = ['u', 'g', 'r', 'i', 'z', 'y']
- __init__(args, **kwargs)
Constructor: Do RailStage specific initialization
- apply_galactic_extinction(pixel, pixel_cat)
MW extinction reddening of the magnitudes
- Parameters:
pixel (int)
pixel_cat (DataFrame)
- Return type:
DataFrame
- assign_pixels(catalog)
assign the pixels to the input catalog check if catalogue contains position information; if so, assign according to ra, dec; else, assign randomly.
- Parameters:
catalog (DataFrame)
- Return type:
DataFrame
- entrypoint_function: str | None = '__call__'
- get_pixel_conditions(pixel)
get the map values at given pixel output is a dictionary that only contains the LSSTErrorModel keys
- Parameters:
pixel (int)
- Return type:
dict
- interactive_function: str | None = 'obs_condition'
- name = 'ObsCondition'