Stackers¶
- class rubin_sim.maf.stackers.AppMagStacker(v_mag_col='magV', color_col='dmag_color', loss_col='dmag_detect')[source]¶
Bases:
BaseMoStacker
Add apparent magnitude of an object for the current h_val (compared to Href in the orbit file), incorporating the magnitude losses due to trailing/detection, as well as the color of the object.
This is calculated from the reported mag_v in the input observation file (calculated assuming Href) as: .. codeblock::python
ssoObs[‘appMag’] = ssoObs[self.vMagCol] + ssoObs[self.colorCol] + ssoObs[self.lossCol] + h_val - Href
Using the vMag reported in the input observations implicitly uses the phase curve coded in at that point; for Oorb this is an H/G phase curve, with G=0.15 unless otherwise specified in the orbit file. See sims_movingObjects for more details on the color and loss quantities.
- Parameters:
v_mag_col (
str
, optional) – Name of the column containing the base V magnitude for the object at H=Href.loss_col (
str
, optional) – Name of the column describing the magnitude losses, due to trailing (dmagTrail) or detection (dmag_detect). Default dmag_detect.color_col (
str
, optional) – Name of the column describing the color correction (into the observation filter, from V). Default dmag_color.
- class rubin_sim.maf.stackers.BaseMoStacker[source]¶
Bases:
BaseStacker
Base class for moving object (SSobject) stackers. Relevant for MoSlicer ssObs (pd.dataframe).
Provided to add moving-object specific API for ‘run’ method of moving object stackers.
- run(sso_obs, href, hval=None)[source]¶
Run the stacker, adding new columns.
- Parameters:
sim_data (
np.ndarray
, (N, M)) – The data to be used to evaluate metrics.override (
bool
, optional) – If True, recalculate new (stacker) columns even if present. If False, calculates stacker columns only if they are not present.
- Returns:
sim_data – The input data, plus additional stacker columns.
- Return type:
np.ndarray
, (N, MM)
- class rubin_sim.maf.stackers.BaseStacker[source]¶
Bases:
object
Base MAF Stacker.
Stackers add columns generated at run-time to the simdata array.
- __eq__(other_stacker)[source]¶
Evaluate if two stackers are equivalent.
This method is required to determine if metric_bundles may be evaluated at the same time, on the same data.
- run(sim_data, override=False)[source]¶
Run the stacker, adding new columns.
- Parameters:
sim_data (
np.ndarray
, (N, M)) – The data to be used to evaluate metrics.override (
bool
, optional) – If True, recalculate new (stacker) columns even if present. If False, calculates stacker columns only if they are not present.
- Returns:
sim_data – The input data, plus additional stacker columns.
- Return type:
np.ndarray
, (N, MM)
- class rubin_sim.maf.stackers.CoaddStacker(mjd_col='observationStartMJD', ra_col='fieldRA', dec_col='fieldDec', m5_col='fiveSigmaDepth', filter_col='filter', night_col='night', num_exposures_col='numExposures', visit_time_col='visitTime', visit_exposure_time_col='visitExposureTime')[source]¶
Bases:
BaseStacker
Stacker to estimate m5 “coadded” per band and par night
- Parameters:
mjd_col (
str
, optional) – Name of the MJD columnra_col (
str
, optional) – Name of the RA columndec_col (
str
, optional) – Name of the Dec columnm5_col (
str
, optional) – Name of the m5 columnfilter_col (
str
, optional) – Name of the filter columnnight_col (
str
, optional) – Name of the night columnnum_exposures_col (
str
, optional) – Name of the number of exposures per visit columnvisit_time_col (
str
, optional) – Name of the total visit time columnvisit_exposure_time_col (
str
, optional) – Name of the on-sky exposure time column
- fill(tab)[source]¶
Estimation of new fields (m5 “coadded” values, …)
- Parameters:
tab (array of (initial) data)
- Returns:
tuple with modified field values –
m5Col: “coadded” m5
- numExposuresCol (sum of numExposuresCol)
- visitTimeCol (sum of visitTimeCol)
- visitExposureTimeCol (sum of visitExposureTimeCol)
- all other input fields except band (Ra, Dec, night) (median(field))
- class rubin_sim.maf.stackers.ColInfo[source]¶
Bases:
object
Holds the units and source (stacker or database) locations for data columns.
The stacker classes which will generate stacker columns are tracked here, as well as some default units for common opsim columns.
See ColInfo.unit_dict for the unit information of database columns.
- get_data_source(col_name)[source]¶
Identify the appropriate source for a given column.
For values which are calculated via a stacker, the returned value is the stacker class. For values which do not have a recorded source or are known to be coming from the database, the result is self.default_data_source (None), which will be assumed to be queryable from the database.
- Parameters:
col_name (
str
) – The name of the column.- Returns:
data_source
- Return type:
rubin_sim.maf.stacker
or None
- class rubin_sim.maf.stackers.CometAppMagStacker(comet_type='oort', ap=0.04, rh_col='helio_dist', delta_col='geo_dist', phase_col='phase', seeing_col='FWHMgeom', ap_scale=1, filter_col='filter', v_mag_col='magV', color_col='dmag_color', loss_col='dmag_detect')[source]¶
Bases:
BaseMoStacker
Add a cometary apparent magnitude, including nucleus and coma, based on a calculation of Afrho (using the current h_val) and a Halley-Marcus phase curve for the coma brightness.
- Parameters:
cometType (
str
, optional) – Type of comet - short, oort, or mbc. This setting also sets the value of Afrho1 and k: short = Afrho1 / R^2 = 100 cm/km2, k = -4 oort = Afrho1 / R^2 = 1000 cm/km2, k = -2 mbc = Afrho1 / R^2 = 4000 cm/km2, k = -6. Default = ‘oort’. It is also possible to pass this a dictionary instead: the dictionary should contain ‘k’ and ‘afrho1_const’ keys, which will be used to set these values directly. (e.g. cometType = {‘k’: -3.5, ‘afrho1_const’: 1500}).ap (
float
, optional) – The albedo for calculating the object’s size. Default 0.04rh_col (
str
, optional) – The column name for the heliocentric distance (in AU). Default ‘helio_dist’.delta_col (
str
, optional) – The column name for the geocentric distance (in AU). Default ‘geo_dist’.phase_col (
str
, optional) – The column name for the phase value (in degrees). Default ‘phase’.
- class rubin_sim.maf.stackers.DayObsISOStacker(mjd_col='observationStartMJD')[source]¶
Bases:
BaseStacker
Add dayObs as defined by SITCOMTN-32, in ISO 8601 format.
- Parameters:
mjd_col (
str
) – The column with the observatin start MJD.
- class rubin_sim.maf.stackers.DayObsMJDStacker(mjd_col='observationStartMJD')[source]¶
Bases:
BaseStacker
Add dayObs defined by SITCOMTN-32, as an MJD.
- Parameters:
mjd_col (
str
) – The column with the observatin start MJD.
- class rubin_sim.maf.stackers.DayObsStacker(mjd_col='observationStartMJD')[source]¶
Bases:
BaseStacker
Add dayObs as, as defined by SITCOMTN-32.
- Parameters:
mjd_col (
str
) – The column with the observatin start MJD.
- class rubin_sim.maf.stackers.DcrStacker(filter_col='filter', alt_col='altitude', degrees=True, ra_col='fieldRA', dec_col='fieldDec', lst_col='observationStartLST', site='LSST', mjd_col='observationStartMJD', dcr_magnitudes=None)[source]¶
Bases:
BaseStacker
Add columns representing the expected RA/Dec offsets expected for an object due to differential chromatic refraction, per visit.
For DCR calculation, we also need zenithDistance, HA, and PA – but these will be explicitly handled within this stacker so that setup is consistent and they run in order. If those values have already been calculated elsewhere, they will not be overwritten.
- Parameters:
filter_col (
str
, optional) – The name of the column with filter names. Default ‘filter’.altCol (
str
, optional) – Name of the column with altitude info. Default ‘altitude’.ra_col (
str
, optional) – Name of the column with RA. Default ‘fieldRA’.dec_col (
str
, optional) – Name of the column with Dec. Default ‘fieldDec’.lstCol (
str
, optional) – Name of the column with local sidereal time. Default ‘observationStartLST’.site (
str
orrubin_scheduler.utils.Site
, optional) – Name of the observory or a rubin_scheduler.utils.Site object. Default ‘LSST’.mjdCol (
str
, optional) – Name of column with modified julian date. Default ‘observationStartMJD’dcr_magnitudes (dict) – Magnitude of the DCR offset for each filter at an altitude/zenith distance of 45 degrees. Defaults u=0.07, g=0.07, r=0.50, i=0.045, z=0.042, y=0.04 (all values should be in arcseconds).
- Returns:
data – Returns array with additional columns ‘ra_dcr_amp’ and ‘dec_dcr_amp’ with the DCR offsets for each observation. Also runs ZenithDistStacker and ParallacticAngleStacker.
- Return type:
numpy.array
- class rubin_sim.maf.stackers.EclStacker(ra_col='ra', dec_col='dec', in_deg=True)[source]¶
Bases:
BaseMoStacker
Add ecliptic latitude/longitude (ecLat/ecLon) to the slicer ssoObs (in degrees).
- Parameters:
ra_col (
str
, optional) – Name of the RA column to convert to ecliptic lat/long. Default ‘ra’.dec_col (
str
, optional) – Name of the Dec column to convert to ecliptic lat/long. Default ‘dec’.in_deg (
bool
, optional) – Flag indicating whether RA/Dec are in degrees. Default True.
- class rubin_sim.maf.stackers.EclipticStacker(mjd_col='observationStartMJD', ra_col='fieldRA', dec_col='fieldDec', degrees=True, subtract_sun_lon=False)[source]¶
Bases:
BaseStacker
Add the ecliptic coordinates of each RA/Dec pointing: eclipLat, eclipLon
Optionally subtract off the sun’s ecliptic longitude and wrap.
- Parameters:
mjd_col (str, optional) – Name of the MJD column. Default expMJD.
ra_col (str, optional) – Name of the RA column. Default fieldRA.
dec_col (str, optional) – Name of the Dec column. Default fieldDec.
subtract_sun_lon (bool, optional) – Flag to subtract the sun’s ecliptic longitude. Default False.
- class rubin_sim.maf.stackers.FiveSigmaStacker(airmass_col='airmass', seeing_col='seeingFwhmEff', skybrightness_col='skyBrightness', filter_col='filter', exptime_col='visitExposureTime')[source]¶
Bases:
BaseStacker
Calculate the 5-sigma limiting depth for a point source in the given conditions.
This is generally not needed, unless the m5 parameters have been updated or m5 was not previously calculated.
- Parameters:
airmass_col (
str
, optional) – Name of the airmass column in the data.seeing_col (
str
, optional) – Name of the seeing column in the data. (FWHM of the single-Gaussian PSF)skybrightness_col (
str
, optional) – Name of the skybrightness column in the data.filter_col (
str
, optional) – Name of the filter bandpass column in the data.exptime_col (
str
, optional) – Name of the on-sky exposure time column in the data.
- class rubin_sim.maf.stackers.GalacticStacker(ra_col='fieldRA', dec_col='fieldDec', degrees=True)[source]¶
Bases:
BaseStacker
Add the galactic coordinates of each RA/Dec pointing: gall, galb
- Parameters:
ra_col (str, optional) – Name of the RA column. Default fieldRA.
dec_col (str, optional) – Name of the Dec column. Default fieldDec.
- class rubin_sim.maf.stackers.HourAngleStacker(lst_col='observationStartLST', ra_col='fieldRA', degrees=True)[source]¶
Bases:
BaseStacker
Add the Hour Angle (in decimal hours) for each observation.
- Parameters:
lst_col (
str
, optional) – Name of the LST column in the data.ra_col (
str
, optional) – Name of the RA column in the data.degrees (
bool
, optional) – If True, assumes angles (RA and LST) are in degrees. If False, assumes radians.
- class rubin_sim.maf.stackers.M5OptimalStacker(airmass_col='airmass', dec_col='fieldDec', sky_bright_col='skyBrightness', seeing_col='seeingFwhmEff', m5_col='fiveSigmaDepth', filter_col='filter', moon_alt_col='moonAlt', sun_alt_col='sunAlt', site='LSST')[source]¶
Bases:
BaseStacker
Make a new m5 column as if observations were taken on the meridian. If the moon is up, assume sky brightness stays the same.
Assumes seeing scales as airmass^0.6. Uses linear fits for sky and airmass relation.
- Parameters:
airmass_col (
str
) – Column name for the airmass per pointing.dec_col (
str
) – Column name for the pointing declination.sky_bright_col (
str
) – Column name for the sky brighntess per pointing.filter_col (
str
) – Column name for the filter name.m5_col (
str
) – Colum name for the five sigma limiting depth per pointing.moon_alt_col (
str
) – Column name for the moon altitude per pointing.sun_alt_col (
str
) – Column name for the sun altitude column.site (
str
) – Name of the site.
- class rubin_sim.maf.stackers.MoMagStacker(magtype='asteroid', v_mag_col='magV', color_col='dmag_color', loss_col='dmag_detect', m5_col='fiveSigmaDepth', seeing_col='seeingFwhmGeom', filter_col='filter', gamma=0.038, sigma=0.12, random_seed=None)[source]¶
Bases:
BaseMoStacker
Add columns relevant to SSobject apparent magnitudes and visibility to the slicer ssoObs dataframe, given a particular Href and current h_val.
Specifically, this stacker adds magLimit, appMag, SNR, and vis. magLimit indicates the appropriate limiting magnitude to consider for a particular object in a particular observation, when combined with the losses due to detection (dmag_detect) or trailing (dmagTrail). appMag adds the apparent magnitude in the filter of the current object, at the current h_val. SNR adds the SNR of this object, given the magLimit. vis adds a flag (0/1) indicating whether an object was visible (assuming a 5sigma threshhold including some probabilistic determination of visibility).
- Parameters:
m5Col (
str
, optional) – Name of the column describing the 5 sigma depth of each visit. Default fiveSigmaDepth.lossCol (
str
, optional) – Name of the column describing the magnitude losses, due to trailing (dmagTrail) or detection (dmag_detect). Default dmag_detect.gamma (
float
, optional) – The ‘gamma’ value for calculating SNR. Default 0.038. LSST range under normal conditions is about 0.037 to 0.039.sigma (
float
, optional) – The ‘sigma’ value for probabilistic prediction of whether or not an object is visible at 5sigma. Default 0.12. The probabilistic prediction of visibility is based on Fermi-Dirac completeness formula (see SDSS, eqn 24, Stripe82 analysis: http://iopscience.iop.org/0004-637X/794/2/120/pdf/apj_794_2_120.pdf).randomSeed (
int
or None, optional) – If set, then used as the random seed for the numpy random number generation for the dither offsets. Default: None.
- class rubin_sim.maf.stackers.NEODistStacker(stepsize=0.001, max_dist=3.0, min_dist=0.3, H=22, elong_col='solarElong', filter_col='filter', sun_az_col='sunAz', az_col='azimuth', m5_col='fiveSigmaDepth')[source]¶
Bases:
BaseStacker
For each observation, find the max distance to a ~144 km NEO, also stack on the x,y position of the object.
- class rubin_sim.maf.stackers.NFollowStacker(min_size=3.0, airmass_limit=2.5, time_steps=array([0.5, 3.5, 6.5, 9.5]), mjd_col='observationStartMJD', ra_col='fieldRA', dec_col='fieldDec', degrees=True)[source]¶
Bases:
BaseStacker
Add the number of telescopes (‘nObservatories’) that could follow up any visit at (any of the) times in timeStep, specifying the minimum telescope size (in meters) and airmass limit.
- Parameters:
minSize (float, optional) – The minimum telescope aperture to use, in meters. Default 3.0.
airmass_limit (float, optional) – The maximum airmass allowable at the follow-up observatory. Default 2.5.
time_steps (np.array or list of floats, optional) – The timesteps to check for followup opportunities, in hours. Default is np.arange(0.5, 12., 3.0).
mjd_col (str, optional) – The exposure MJD column name. Default ‘observationStartMJD’.
ra_col (str, optional) – The RA column name. Default ‘fieldRA’.
dec_col (str, optional) – The Dec column name. Default ‘fieldDec’.
raDecDeg (bool, optional) – Flag whether RA/Dec are in degrees (True) or radians (False).
- class rubin_sim.maf.stackers.NormAirmassStacker(airmass_col='airmass', dec_col='fieldDec', degrees=True, telescope_lat=-30.2446388)[source]¶
Bases:
BaseStacker
Adds a calculated normairmass for each pointing.
The normalized airmass is the airmass divided by the minimum airmass achievable at each pointing (which is defined by the declination of the field).
- Parameters:
airmass_col (
str
, optional) – The name of the airmass column in the data.dec_col (
str
, optional) – The name of the declination column in the data.degrees (
bool
, optional) – If True, angle columns are assumed to be in degrees and returned in degrees. If False, uses and calculates radians.telescope_lat (
float
, optional) – The latitude of the telescope, in degrees.
- class rubin_sim.maf.stackers.ObservationStartDatetime64Stacker(mjd_col='observationStartMJD')[source]¶
Bases:
BaseStacker
Add the observation start time as a numpy.datetime64.
- class rubin_sim.maf.stackers.OverheadStacker(max_gap=inf, mjd_col='observationStartMJD', visit_time_col='visitTime', exposure_time_col='visitExposureTime')[source]¶
Bases:
BaseStacker
Add time between visits in seconds.
- Parameters:
max_gap (
float
, optional) – The maximum gap between observations, in minutes. Assume anything longer the dome has closed. Defaults to infinity.mjd_col (
str
, optional) – The name of the column with the observation start MJD. Defaults to “observationStartMJD”.visit_time_col (
str
, optional) – The name of the column with the total visit time (on-sky plus shutter and other overheads). Defaults to “visitTime”.exposure_time_col (
str
, optional) – The name of the column with the visit on-sky exposure time. Defaults to “visitExposureTime.”
- class rubin_sim.maf.stackers.ParallacticAngleStacker(ra_col='fieldRA', dec_col='fieldDec', degrees=True, mjd_col='observationStartMJD', lst_col='observationStartLST', site='LSST')[source]¶
Bases:
BaseStacker
Add the calculated parallactic angle to each visit.
- Parameters:
ra_col (
str
, optional) – Name of the RA column in the data.dec_col (
str
, optional) – Name of the declination column in the data.degrees (
bool
, optional) – If True, assumes ra and dec in degrees and returns Parallactic Angle in degrees. If False, assumes and returns radians.mjd_col (
str
, optional) – Name of the observation MJD column in the data.lst_col (
str
, optional) – Name of the LST column in the data.site (
str
orrubin_scheduler.utils.Site
, optional) – Name of the observory or a rubin_scheduler.utils.Site object. Default ‘LSST’.
- class rubin_sim.maf.stackers.ParallaxFactorStacker(ra_col='fieldRA', dec_col='fieldDec', date_col='observationStartMJD', degrees=True)[source]¶
Bases:
BaseStacker
Add a parallax factor (in arcseconds) column for each visit.
- Parameters:
ra_col (
str
, optional) – Name of the RA column in the data.dec_col (
str
, optional) – Name of the declination column in the data.date_col (
str
, optional) – Name of the exposure start time column in the data. Date should be in units of MJD.degrees (
bool
, optional) – If true, assumes angles are in degrees. If False, radians.
- class rubin_sim.maf.stackers.SNRStacker(app_mag_col='appMag', m5_col='fiveSigmaDepth', gamma=0.038, sigma=0.12, random_seed=None)[source]¶
Bases:
BaseMoStacker
Add SNR and visibility for a particular object, given the five sigma depth of the image and the apparent magnitude (whether from AppMagStacker or CometAppMagStacker etc).
The SNR simply calculates the SNR based on the five sigma depth and the apparent magnitude. The ‘vis’ column is a probabilistic flag (0/1) indicating whether the object was detected, assuming a 5-sigma SNR threshold and then applying a probabilistic cut on whether it was detected or not (i.e. there is a gentle roll-over in ‘vis’ from 1 to 0 depending on the SNR of the object). This is based on the Fermi-Dirac completeness formula as described in equation 24 of the Stripe 82 SDSS analysis here: http://iopscience.iop.org/0004-637X/794/2/120/pdf/apj_794_2_120.pdf.
- Parameters:
app_mag_col (
str
, optional) – Name of the column describing the apparent magnitude of the object. Default ‘appMag’.m5_col (
str
, optional) – Name of the column describing the 5 sigma depth of each visit. Default fiveSigmaDepth.gamma (
float
, optional) – The ‘gamma’ value for calculating SNR. Default 0.038. LSST range under normal conditions is about 0.037 to 0.039.sigma (
float
, optional) – The ‘sigma’ value for probabilistic prediction of whether or not an object is visible at 5sigma. Default 0.12. The probabilistic prediction of visibility is based on Fermi-Dirac completeness formula (see SDSS, eqn 24, Stripe82 analysis: http://iopscience.iop.org/0004-637X/794/2/120/pdf/apj_794_2_120.pdf).random_seed (
int
or None, optional) – If set, then used as the random seed for the numpy random number generation for the probability of detection. Default: None.
- class rubin_sim.maf.stackers.SaturationStacker(seeing_col='seeingFwhmEff', skybrightness_col='skyBrightness', exptime_col='visitExposureTime', nexp_col='numExposures', filter_col='filter', airmass_col='airmass', saturation_e=150000.0, zeropoints=None, km=None, pixscale=0.2)[source]¶
Bases:
BaseStacker
Adds a calculated point-source saturation limit for each visit.
Assumes Gaussian PSF.
- Parameters:
pixscale (
float
, optional) – Arcsec per pixel.saturation_e (
float
, optional) – The saturation level in electrons.zeropoints (dict-like, optional) – The zeropoints for the telescope. Keys should be str with filter names, values in mags. Default of None, will use Rubin calculated zeropoints.
km (dict-like, optional) – Atmospheric extinction values. Keys should be str with filter names. If None, will use Rubin calculated atmospheric extinction values.
- class rubin_sim.maf.stackers.SdssRADecStacker(pcols=['p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8'])[source]¶
Bases:
BaseStacker
convert the p1,p2,p3… columns to radians and wrap them
- class rubin_sim.maf.stackers.StackerRegistry(name, bases, dict)[source]¶
Bases:
type
Meta class for Stackers, to build a registry of stacker classes.
- class rubin_sim.maf.stackers.TeffStacker(m5_col='fiveSigmaDepth', filter_col='filter', exptime_col='visitExposureTime', fiducial_depth=None, fiducial_exptime=None, normed=False, **kwargs)[source]¶
Bases:
BaseStacker
Add t_eff column corresponding to fiveSigmaDepth.
- Parameters:
m5_col (
str
(‘fiveSigmaDepth’)) – Colum name for the five sigma limiting depth per pointing. Defaults to “fiveSigmaDepth”.filter_col (
str
) – Defaults to “filter”exptime_col (
str
) – The column with the exposure time, defaults to “visitExposureTime”fiducial_depth (
dict
[str
,float
]) – A mapping of filter to fiducial depth. Defaults to TEFF_FIDUCIAL_DEPTH.fiducial_exptime (
float
) – The exposure time (in seconds) corresponding to the exposure depth.normed (
bool
) – Normalize to exporuse time.
- class rubin_sim.maf.stackers.WFDlabelStacker(footprint=None, fp_threshold=0.4, area_id_name='WFD', ra_col='fieldRA', dec_col='fieldDec', note_col='scheduler_note', exclude_dd=True)[source]¶
Bases:
BaseStacker
Add an ‘areaId’ column to flag whether a visit was inside the ‘footprint’.
- Parameters:
footprint (
np.NDarray
, optional) – The healpix map indicating the desired footprint region. If this is not defined (default None), then the entire sky is used as the footprint.fp_threshold (
float
, optional) – The threshold for the fraction of the visit area which falls within the footprint in order to be counted as ‘in’ the footprint. Default 0.4.areaIdName (
str
, optional) – Value to place in the areaId column for visits which match this area.ra_col (
str
, optional) – The name of the RA column. Default fieldRA.dec_col (
str
, optional) – The name of the Dec column. Default fieldDec.note_col (
str
, optional) – The name of the ‘note’ (scheduler_note) column in the database. This is used to identify visits which were part of a DD sequence.exclude_dd (
bool
, optional) – Exclude (True) or include (False) visits which are part of a DD sequence within this ‘area’.
Notes
This stacker adds an areaId column in the opsim database, to be labelled with ‘areaIdName’ if the visit falls within the healpix footprint map and (optionally) is not tagged as a DD visit. If it falls outside the footprint, the visit is tagged as “NULL”. If it was part of a DD sequence, the visit is tagged with an ID which is unique to that DD field, if ‘exclude_dd’ is True. Generally this would be likely to be used to tag visits as belonging to WFD - but not necessarily! Any healpix footprint is valid.
- class rubin_sim.maf.stackers.ZenithDistStacker(alt_col='altitude', degrees=True)[source]¶
Bases:
BaseStacker
Adds a calculated zenithDistance value for each pointing.
- Parameters:
alt_col (
str
, optional) – The name of the altitude column in the data.degrees (
bool
, optional) – If True, data in alt_col is in degrees, and values for zenithDistance will be in degrees. (Default). If False, data in alt_col is in radians and zenithDistance values will be in radians.
- rubin_sim.maf.stackers.compute_teff(m5_depth, filter_name, exptime=None, fiducial_depth=None, teff_base=None, normed=False)[source]¶
Compute the effective exposure time for a limiting magnitude.
- Parameters:
m5_depth (
float
ornumpy.ndarray
, (N,)) – The five sigma point source limiting magintude.filter_name (
str
ornumpy.ndarray
, (N,)) – The name of the filter.exptime (
float
ornumpy.ndarray
, (N,)) – The expsore time (seconds), defaults to TEFF_FIDUCIAL_EXPTIME.fiducial_depth (
dict
[str
,float
]) – A mapping of filter to fiducial depth. Defaults to TEFF_FIDUCIAL_DEPTH.teff_base (
float
) – The exposure time (in seconds) corresponding to the exposure depth.normed (
bool
) – Normalize against the exposure time, such that a value of 1 corresponds to the exposure having been taken at fiducial conditions. Defaults to False.
- Returns:
t_eff – Effective expsore time, in seconds (if normed is False) or unitless (if normed is true).
- Return type:
float
- rubin_sim.maf.stackers.find_telescopes(min_size=3.0)[source]¶
Finds telescopes larger than min_size, from list of large telescopes based on http://astro.nineplanets.org/bigeyes.html.
- Returns:
Array of large telescopes with columns [aperture, name, lat, lon].
- Return type:
np.recarray
- rubin_sim.maf.stackers.generate_sky_slopes()[source]¶
Fit a line to how the sky brightness changes with airmass.
- rubin_sim.maf.stackers.ra_dec2_alt_az(ra, dec, lat, lon, mjd, altonly=False)[source]¶
Convert RA/Dec (and telescope site lat/lon) to alt/az.
This uses simple equations and ignores aberation, precession, nutation.
- Parameters:
ra (
np.ndarray
, (N,)) – RA, in radians.dec (
np.ndarray
, (N,)) – Dec, in radians. Must be same length asra
.lat (
float
) – Latitude of the observatory in radians.lon (
float
) – Longitude of the observatory in radians.mjd (
float
) – Modified Julian Date.altonly (
bool
, optional) – Calculate altitude only.
- Returns:
alt (
np.ndarray
, (N,)) – Altitude, same length asra
anddec
. Radians.az (
np.ndarray
, (N,)) – Azimuth, same length asra
anddec
. Radians.