lsst.sims.maf.stackers package¶
Submodules¶
lsst.sims.maf.stackers.NEODistStacker module¶
-
class
lsst.sims.maf.stackers.NEODistStacker.
NEODistStacker
(stepsize=0.001, maxDist=3.0, minDist=0.3, H=22, elongCol=’solarElong’, filterCol=’filter’, sunAzCol=’sunAz’, azCol=’azimuth’)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
For each observation, find the max distance to a ~144 km NEO, also stack on the x,y position of the object.
lsst.sims.maf.stackers.baseStacker module¶
-
class
lsst.sims.maf.stackers.baseStacker.
StackerRegistry
(name, bases, dict)[source]¶ Bases:
type
Meta class for Stackers, to build a registry of stacker classes.
lsst.sims.maf.stackers.coordStackers module¶
-
class
lsst.sims.maf.stackers.coordStackers.
GalacticStacker
(raCol=’fieldRA’, decCol=’fieldDec’)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Add the galactic coordinates of each RA/Dec pointing.
Parameters:
-
class
lsst.sims.maf.stackers.coordStackers.
EclipticStacker
(mjdCol=’observationStartMJD’, raCol=’fieldRA’, decCol=’fieldDec’, subtractSunLon=False)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Add the ecliptic coordinates of each RA/Dec pointing. Optionally subtract off the sun’s ecliptic longitude and wrap.
Parameters:
lsst.sims.maf.stackers.ditherStackers module¶
-
lsst.sims.maf.stackers.ditherStackers.
wrapRADec
(ra, dec)[source]¶ Wrap RA into 0-2pi and Dec into +/0 pi/2.
Parameters: - ra (numpy.ndarray) – RA in radians
- dec (numpy.ndarray) – Dec in radians
Returns: Wrapped RA/Dec values, in radians.
Return type: numpy.ndarray, numpy.ndarray
-
lsst.sims.maf.stackers.ditherStackers.
wrapRA
(ra)[source]¶ Wrap only RA values into 0-2pi (using mod).
Parameters: ra (numpy.ndarray) – RA in radians Returns: Wrapped RA values, in radians. Return type: numpy.ndarray
-
lsst.sims.maf.stackers.ditherStackers.
inHexagon
(xOff, yOff, maxDither)[source]¶ Identify dither offsets which fall within the inscribed hexagon.
Parameters: - xOff (numpy.ndarray) – The x values of the dither offsets.
- yoff (numpy.ndarray) – The y values of the dither offsets.
- maxDither (float) – The maximum dither offset.
Returns: Indexes of the offsets which are within the hexagon inscribed inside the ‘maxDither’ radius circle.
Return type: numpy.ndarray
-
lsst.sims.maf.stackers.ditherStackers.
polygonCoords
(nside, radius, rotationAngle)[source]¶ Find the x,y coords of a polygon.
This is useful for plotting dither points and showing they lie within a given shape.
Parameters: Returns: List of x/y coordinates of the points describing the polygon.
Return type:
-
class
lsst.sims.maf.stackers.ditherStackers.
RandomDitherFieldPerVisitStacker
(raCol=’fieldRA’, decCol=’fieldDec’, maxDither=1.75, inHex=True, randomSeed=None)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Randomly dither the RA and Dec pointings up to maxDither degrees from center, with a different offset for each field, for each visit.
Parameters: - raCol (str, optional) – The name of the RA column in the data. Default ‘fieldRA’.
- decCol (str, optional) – The name of the Dec column in the data. Default ‘fieldDec’.
- maxDither (float, optional) – The radius of the maximum dither offset, in degrees. Default 1.75 degrees.
- inHex (bool, optional) – If True, offsets are constrained to lie within a hexagon inscribed within the maxDither circle. If False, offsets can lie anywhere out to the edges of the maxDither circle. Default True.
- randomSeed (int, optional) – If set, then used as the random seed for the numpy random number generation for the dither offsets. Default None.
-
class
lsst.sims.maf.stackers.ditherStackers.
RandomDitherFieldPerNightStacker
(raCol=’fieldRA’, decCol=’fieldDec’, fieldIdCol=’fieldId’, nightCol=’night’, maxDither=1.75, inHex=True, randomSeed=None)[source]¶ Bases:
lsst.sims.maf.stackers.ditherStackers.RandomDitherFieldPerVisitStacker
Randomly dither the RA and Dec pointings up to maxDither degrees from center, one dither offset per new night of observation of a field. e.g. visits within the same night, to the same field, have the same offset.
Parameters: - raCol (str, optional) – The name of the RA column in the data. Default ‘fieldRA’.
- decCol (str, optional) – The name of the Dec column in the data. Default ‘fieldDec’.
- fieldIdCol (str, optional) – The name of the fieldId column in the data. Used to identify fields which should be identified as the ‘same’. Default ‘fieldId’.
- nightCol (str, optional) – The name of the night column in the data. Default ‘night’.
- maxDither (float, optional) – The radius of the maximum dither offset, in degrees. Default 1.75 degrees.
- inHex (bool, optional) – If True, offsets are constrained to lie within a hexagon inscribed within the maxDither circle. If False, offsets can lie anywhere out to the edges of the maxDither circle. Default True.
- randomSeed (int, optional) – If set, then used as the random seed for the numpy random number generation for the dither offsets. Default None.
-
class
lsst.sims.maf.stackers.ditherStackers.
RandomDitherPerNightStacker
(raCol=’fieldRA’, decCol=’fieldDec’, nightCol=’night’, maxDither=1.75, inHex=True, randomSeed=None)[source]¶ Bases:
lsst.sims.maf.stackers.ditherStackers.RandomDitherFieldPerVisitStacker
Randomly dither the RA and Dec pointings up to maxDither degrees from center, one dither offset per night. All fields observed within the same night get the same offset.
Parameters: - raCol (str, optional) – The name of the RA column in the data. Default ‘fieldRA’.
- decCol (str, optional) – The name of the Dec column in the data. Default ‘fieldDec’.
- nightCol (str, optional) – The name of the night column in the data. Default ‘night’.
- maxDither (float, optional) – The radius of the maximum dither offset, in degrees. Default 1.75 degrees.
- inHex (bool, optional) – If True, offsets are constrained to lie within a hexagon inscribed within the maxDither circle. If False, offsets can lie anywhere out to the edges of the maxDither circle. Default True.
- randomSeed (int, optional) – If set, then used as the random seed for the numpy random number generation for the dither offsets. Default None.
-
class
lsst.sims.maf.stackers.ditherStackers.
SpiralDitherFieldPerVisitStacker
(raCol=’fieldRA’, decCol=’fieldDec’, fieldIdCol=’fieldId’, numPoints=60, maxDither=1.75, nCoils=5, inHex=True)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Offset along an equidistant spiral with numPoints, out to a maximum radius of maxDither. Each visit to a field receives a new, sequential offset.
Parameters: - raCol (str, optional) – The name of the RA column in the data. Default ‘fieldRA’.
- decCol (str, optional) – The name of the Dec column in the data. Default ‘fieldDec’.
- fieldIdCol (str, optional) – The name of the fieldId column in the data. Used to identify fields which should be identified as the ‘same’. Default ‘fieldId’.
- numPoints (int, optional) – The number of points in the spiral. Default 60.
- maxDither (float, optional) – The radius of the maximum dither offset, in degrees. Default 1.75 degrees.
- nCoils (int, optional) – The number of coils the spiral should have. Default 5.
- inHex (bool, optional) – If True, offsets are constrained to lie within a hexagon inscribed within the maxDither circle. If False, offsets can lie anywhere out to the edges of the maxDither circle. Default True.
-
class
lsst.sims.maf.stackers.ditherStackers.
SpiralDitherFieldPerNightStacker
(raCol=’fieldRA’, decCol=’fieldDec’, fieldIdCol=’fieldId’, nightCol=’night’, numPoints=60, maxDither=1.75, nCoils=5, inHex=True)[source]¶ Bases:
lsst.sims.maf.stackers.ditherStackers.SpiralDitherFieldPerVisitStacker
Offset along an equidistant spiral with numPoints, out to a maximum radius of maxDither. Each field steps along a sequential series of offsets, each night it is observed.
Parameters: - raCol (str, optional) – The name of the RA column in the data. Default ‘fieldRA’.
- decCol (str, optional) – The name of the Dec column in the data. Default ‘fieldDec’.
- fieldIdCol (str, optional) – The name of the fieldId column in the data. Used to identify fields which should be identified as the ‘same’. Default ‘fieldId’.
- nightCol (str, optional) – The name of the night column in the data. Default ‘night’.
- numPoints (int, optional) – The number of points in the spiral. Default 60.
- maxDither (float, optional) – The radius of the maximum dither offset, in degrees. Default 1.75 degrees.
- nCoils (int, optional) – The number of coils the spiral should have. Default 5.
- inHex (bool, optional) – If True, offsets are constrained to lie within a hexagon inscribed within the maxDither circle. If False, offsets can lie anywhere out to the edges of the maxDither circle. Default True.
-
class
lsst.sims.maf.stackers.ditherStackers.
SpiralDitherPerNightStacker
(raCol=’fieldRA’, decCol=’fieldDec’, fieldIdCol=’fieldId’, nightCol=’night’, numPoints=60, maxDither=1.75, nCoils=5, inHex=True)[source]¶ Bases:
lsst.sims.maf.stackers.ditherStackers.SpiralDitherFieldPerVisitStacker
Offset along an equidistant spiral with numPoints, out to a maximum radius of maxDither. All fields observed in the same night receive the same sequential offset, changing per night.
Parameters: - raCol (str, optional) – The name of the RA column in the data. Default ‘fieldRA’.
- decCol (str, optional) – The name of the Dec column in the data. Default ‘fieldDec’.
- fieldIdCol (str, optional) – The name of the fieldId column in the data. Used to identify fields which should be identified as the ‘same’. Default ‘fieldId’.
- nightCol (str, optional) – The name of the night column in the data. Default ‘night’.
- numPoints (int, optional) – The number of points in the spiral. Default 60.
- maxDither (float, optional) – The radius of the maximum dither offset, in degrees. Default 1.75 degrees.
- nCoils (int, optional) – The number of coils the spiral should have. Default 5.
- inHex (bool, optional) – If True, offsets are constrained to lie within a hexagon inscribed within the maxDither circle. If False, offsets can lie anywhere out to the edges of the maxDither circle. Default True.
-
class
lsst.sims.maf.stackers.ditherStackers.
HexDitherFieldPerVisitStacker
(raCol=’fieldRA’, decCol=’fieldDec’, fieldIdCol=’fieldId’, maxDither=1.75, inHex=True)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Use offsets from the hexagonal grid of ‘hexdither’, but visit each vertex sequentially. Sequential offset for each visit.
Parameters: - raCol (str, optional) – The name of the RA column in the data. Default ‘fieldRA’.
- decCol (str, optional) – The name of the Dec column in the data. Default ‘fieldDec’.
- fieldIdCol (str, optional) – The name of the fieldId column in the data. Used to identify fields which should be identified as the ‘same’. Default ‘fieldId’.
- maxDither (float, optional) – The radius of the maximum dither offset, in degrees. Default 1.75 degrees.
- inHex (bool, optional) – If True, offsets are constrained to lie within a hexagon inscribed within the maxDither circle. If False, offsets can lie anywhere out to the edges of the maxDither circle. Default True.
-
class
lsst.sims.maf.stackers.ditherStackers.
HexDitherFieldPerNightStacker
(raCol=’fieldRA’, decCol=’fieldDec’, fieldIdCol=’fieldIdCol’, nightCol=’night’, maxDither=1.75, inHex=True)[source]¶ Bases:
lsst.sims.maf.stackers.ditherStackers.HexDitherFieldPerVisitStacker
Use offsets from the hexagonal grid of ‘hexdither’, but visit each vertex sequentially. Sequential offset for each night of visits.
Parameters: - raCol (str, optional) – The name of the RA column in the data. Default ‘fieldRA’.
- decCol (str, optional) – The name of the Dec column in the data. Default ‘fieldDec’.
- fieldIdCol (str, optional) – The name of the fieldId column in the data. Used to identify fields which should be identified as the ‘same’. Default ‘fieldId’.
- nightCol (str, optional) – The name of the night column in the data. Default ‘night’.
- maxDither (float, optional) – The radius of the maximum dither offset, in degrees. Default 1.75 degrees.
- inHex (bool, optional) – If True, offsets are constrained to lie within a hexagon inscribed within the maxDither circle. If False, offsets can lie anywhere out to the edges of the maxDither circle. Default True.
-
class
lsst.sims.maf.stackers.ditherStackers.
HexDitherPerNightStacker
(raCol=’fieldRA’, decCol=’fieldDec’, fieldIdCol=’fieldId’, nightCol=’night’, maxDither=1.75, inHex=True)[source]¶ Bases:
lsst.sims.maf.stackers.ditherStackers.HexDitherFieldPerVisitStacker
Use offsets from the hexagonal grid of ‘hexdither’, but visit each vertex sequentially. Sequential offset per night for all fields.
Parameters: - raCol (str, optional) – The name of the RA column in the data. Default ‘fieldRA’.
- decCol (str, optional) – The name of the Dec column in the data. Default ‘fieldDec’.
- fieldIdCol (str, optional) – The name of the fieldId column in the data. Used to identify fields which should be identified as the ‘same’. Default ‘fieldId’.
- nightCol (str, optional) – The name of the night column in the data. Default ‘night’.
- maxDither (float, optional) – The radius of the maximum dither offset, in degrees. Default 1.75 degrees.
- inHex (bool, optional) – If True, offsets are constrained to lie within a hexagon inscribed within the maxDither circle. If False, offsets can lie anywhere out to the edges of the maxDither circle. Default True.
-
class
lsst.sims.maf.stackers.ditherStackers.
DefaultDitherStacker
(raCol=’fieldRA’, decCol=’fieldDec’, fieldIdCol=’fieldId’, nightCol=’night’, maxDither=1.75, inHex=True)[source]¶ Bases:
lsst.sims.maf.stackers.ditherStackers.HexDitherPerNightStacker
Make a default dither pattern to stack on ditheredRA and ditheredDec
lsst.sims.maf.stackers.generalStackers module¶
-
class
lsst.sims.maf.stackers.generalStackers.
NormAirmassStacker
(airmassCol=’airmass’, decCol=’fieldDec’, degrees=True, telescope_lat=-30.2446388)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Calculate the normalized airmass for each opsim pointing.
-
class
lsst.sims.maf.stackers.generalStackers.
ParallaxFactorStacker
(raCol=’fieldRA’, decCol=’fieldDec’, dateCol=’observationStartMJD’, raDecDeg=True)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Calculate the parallax factors for each opsim pointing. Output parallax factor in arcseconds.
-
class
lsst.sims.maf.stackers.generalStackers.
HourAngleStacker
(lstCol=’observationStartLST’, raCol=’fieldRA’)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Add the Hour Angle for each observation.
-
class
lsst.sims.maf.stackers.generalStackers.
FilterColorStacker
(filterCol=’filter’)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Translate filters (‘u’, ‘g’, ‘r’ ..) into RGB tuples.
-
class
lsst.sims.maf.stackers.generalStackers.
ZenithDistStacker
(altCol=’altitude’, degrees=True)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Calculate the zenith distance for each pointing.
-
class
lsst.sims.maf.stackers.generalStackers.
ParallacticAngleStacker
(raCol=’fieldRA’, decCol=’fieldDec’, mjdCol=’observationStartMJD’, lstCol=’observationStartLST’, site=’LSST’)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Add the parallactic angle (in radians) to each visit.
-
class
lsst.sims.maf.stackers.generalStackers.
SeasonStacker
(observationStartMJDCol=’observationStartMJD’, RACol=’fieldRA’)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Add an integer label to show which season a given visit is in.
The season only depends on the RA of the object: we compute the MJD when each object is on the meridian at midnight, and subtract 6 months to get the start date of each season. The season index range is 0-10. Must wrap 0th and 10th to get a total of 10 seasons.
-
class
lsst.sims.maf.stackers.generalStackers.
DcrStacker
(filterCol=’filter’, altCol=’altitude’, raDecDeg=True, raCol=’fieldRA’, decCol=’fieldDec’, lstCol=’observationStartLST’, site=’LSST’, mjdCol=’observationStartMJD’, dcr_magnitudes={‘u’: 0.07, ’g’: 0.07, ’r’: 0.05, ’i’: 0.045, ’z’: 0.042, ’y’: 0.04})[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Calculate the RA,Dec offset expected for an object due to differential chromatic refraction.
Parameters: - filterCol (str) – The name of the column with filter names. Default ‘fitler’.
- altCol (str) – Name of the column with altitude info. Default ‘altitude’.
- raCol (str) – Name of the column with RA. Default ‘ra_rad’.
- decCol (str) – Name of the column with Dec. Default ‘dec_rad’.
- lstCol (str) – Name of the column with local sidereal time. Default ‘lst’.
- site (str or lsst.sims.utils.Site) – Name of the observory or a lsst.sims.utils.Site object. Default ‘LSST’.
- mjdCol (str) – Name of column with modified julian date. Default ‘observationStartMJD’
- dcr_magnitudes (dict) – Magitude of the DCR offset for each filter at 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 arcseconds).
Returns: 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
lsst.sims.maf.stackers.generalStackers.
FiveSigmaStacker
(airmassCol=’airmass’, seeingCol=’seeingFwhmEff’, skybrightnessCol=’skyBrightness’, filterCol=’filter’, exptimeCol=’visitExposureTime’)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Calculate the 5-sigma limiting depth for a point source in the given conditions
lsst.sims.maf.stackers.getColInfo module¶
-
class
lsst.sims.maf.stackers.getColInfo.
ColInfo
[source]¶ Bases:
object
Class to hold the unit and source locations for columns.
The stacker classes which will generate stacker columns are tracked here, as well as some default units for common opsim columns.
Inspect ColInfo.unitDict for more information.
-
getDataSource
(colName)[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.defaultDataSource (None), which will be assumed to be queryable from the database.
Parameters: colName (str) – The name of the column. Returns: Return type: lsst.sims.maf.stacker or None
-
lsst.sims.maf.stackers.m5OptimalStacker module¶
-
class
lsst.sims.maf.stackers.m5OptimalStacker.
M5OptimalStacker
(airmassCol=’airmass’, decCol=’dec_rad’, skyBrightCol=’filtSkyBrightness’, seeingCol=’FWHMeff’, filterCol=’filter’, moonAltCol=’moonAlt’, sunAltCol=’sunAlt’, site=’LSST’)[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.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: - airmassCol (str ('airmass')) – Column name for the airmass per pointing.
- decCol (str ('dec_rad')) – Column name for the pointing declination.
- skyBrightCol (str ('filtSkyBrightness')) – Column name for the sky brighntess per pointing.
- filterCol (str ('filter')) – Column name for the filter name.
- m5Col (str ('fiveSigmaDepth')) – Colum name for the five sigma limiting depth per pointing.
- moonAltCol (str ('moonAlt')) – Column name for the moon altitude per pointing.
- sunAltCol (str ('sunAltCol')) – Column name for the sun altitude column.
- site (str ('LSST')) – Name of the site.
Returns: Adds a column to that is approximately what the five-sigma depth would have been if the observation had been taken on the meridian.
Return type: numpy.array
lsst.sims.maf.stackers.moStackers module¶
-
class
lsst.sims.maf.stackers.moStackers.
BaseMoStacker
[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
Base class for moving object stackers.
Provided to add moving-object specific API for ‘run’ method of moving object stackers.
-
class
lsst.sims.maf.stackers.moStackers.
MoMagStacker
(vMagCol=’magV’, colorCol=’dmagColor’, magFilterCol=’magFilter’, lossCol=’dmagDetect’, m5Col=’fiveSigmaDepth’, gamma=0.038, sigma=0.12)[source]¶ Bases:
lsst.sims.maf.stackers.moStackers.BaseMoStacker
Add columns relevant to moving object apparent magnitudes and visibility to the slicer ssoObs dataframe, given a particular Href and current Hval.
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 (dmagDetect) or trailing (dmagTrail). appMag adds the apparent magnitude in the filter of the current object, at the current Hval. 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: - magFilterCol (str, opt) – Name of the column describing the magnitude of the object, in the visit filter. Default magFilter.
- m5Col (str, opt) – Name of the column describing the 5 sigma depth of each visit. Default fiveSigmaDepth.
- lossCol (str, opt) – Name of the column describing the magnitude losses, due to trailing (dmagTrail) or detection (dmagDetect). Default dmagDetect.
- gamma (float, opt) – The ‘gamma’ value for calculating SNR. Default 0.038. LSST range under normal conditions is about 0.037 to 0.039.
- sigma (float, opt) – 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).
-
class
lsst.sims.maf.stackers.moStackers.
EclStacker
(raCol=’ra’, decCol=’dec’, inDeg=True)[source]¶ Bases:
lsst.sims.maf.stackers.moStackers.BaseMoStacker
Add ecliptic latitude/longitude (ecLat/ecLon) to the slicer ssoObs (in degrees).
Parameters:
lsst.sims.maf.stackers.sdssStackers module¶
-
class
lsst.sims.maf.stackers.sdssStackers.
SdssRADecStacker
(pcols=[‘p1’, ‘p2’, ‘p3’, ‘p4’, ‘p5’, ‘p6’, ‘p7’, ‘p8’])[source]¶ Bases:
lsst.sims.maf.stackers.baseStacker.BaseStacker
convert the p1,p2,p3… columns to radians and wrap them