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', m5Col='fiveSigmaDepth')[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.

colsAdded

lsst.sims.maf.stackers.baseStacker module

class lsst.sims.maf.stackers.baseStacker.BaseStacker[source]

Bases: object

Base MAF Stacker: add columns generated at run-time to the simdata array.

__eq__(otherStacker)[source]

Evaluate if two stackers are equivalent.

__ne__(otherStacker)[source]

Evaluate if two stackers are not equal.

colsAdded
registry
run(simData, override=False)[source]

Example: Generate the new stacker columns, given the simdata columns from the database. Returns the new simdata structured array that includes the new stacker columns.

sourceDict
class lsst.sims.maf.stackers.baseStacker.StackerRegistry(name, bases, dict)[source]

Bases: type

Meta class for Stackers, to build a registry of stacker classes.

getClass(stackername)[source]
help(doc=False)[source]

lsst.sims.maf.stackers.coordStackers module

class lsst.sims.maf.stackers.coordStackers.EclipticStacker(mjdCol='observationStartMJD', raCol='fieldRA', decCol='fieldDec', degrees=True, subtractSunLon=False)[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Add the ecliptic coordinates of each RA/Dec pointing: eclipLat, eclipLon Optionally subtract off the sun’s ecliptic longitude and wrap.

Parameters
  • mjdCol (str, opt) – Name of the MJD column. Default expMJD.

  • raCol (str, opt) – Name of the RA column. Default fieldRA.

  • decCol (str, opt) – Name of the Dec column. Default fieldDec.

  • subtractSunLon (bool, opt) – Flag to subtract the sun’s ecliptic longitude. Default False.

colsAdded
class lsst.sims.maf.stackers.coordStackers.GalacticStacker(raCol='fieldRA', decCol='fieldDec', degrees=True)[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Add the galactic coordinates of each RA/Dec pointing: gall, galb

Parameters
  • raCol (str, opt) – Name of the RA column. Default fieldRA.

  • decCol (str, opt) – Name of the Dec column. Default fieldDec.

colsAdded
lsst.sims.maf.stackers.coordStackers.mjd2djd(mjd)[source]

Convert MJD to the Dublin Julian date used by ephem.

Parameters

mjd (float or numpy.ndarray) – The modified julian date.

Returns

The dublin julian date.

Return type

float or numpy.ndarray

lsst.sims.maf.stackers.coordStackers.raDec2AltAz(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, etc.

Parameters
  • ra (array_like) – RA, in radians.

  • dec (array_like) – Dec, in radians. Must be same length as ra.

  • lat (float) – Latitude of the observatory in radians.

  • lon (float) – Longitude of the observatory in radians.

  • mjd (float) – Modified Julian Date.

  • altonly (bool, opt) – Calculate altitude only.

Returns

  • alt (numpy.array) – Altitude, same length as ra and dec. Radians.

  • az (numpy.array) – Azimuth, same length as ra and dec. Radians.

lsst.sims.maf.stackers.ditherStackers module

class lsst.sims.maf.stackers.ditherStackers.BaseDitherStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, maxDither=1.75, inHex=True)[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Base class for dither stackers.

The base class just adds an easy way to define a stacker as one of the ‘dither’ types of stackers. These run first, before any other stackers.

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

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

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

colsAdded
class lsst.sims.maf.stackers.ditherStackers.HexDitherFieldPerNightStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, 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 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’.

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

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

colsAdded
class lsst.sims.maf.stackers.ditherStackers.HexDitherFieldPerVisitStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, fieldIdCol='fieldId', maxDither=1.75, inHex=True)[source]

Bases: lsst.sims.maf.stackers.ditherStackers.BaseDitherStacker

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

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

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

colsAdded
class lsst.sims.maf.stackers.ditherStackers.HexDitherPerNightStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, 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’.

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

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

colsAdded
class lsst.sims.maf.stackers.ditherStackers.RandomDitherFieldPerNightStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, 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’.

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

  • 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 or None, optional) – If set, then used as the random seed for the numpy random number generation for the dither offsets. Default None.

colsAdded
class lsst.sims.maf.stackers.ditherStackers.RandomDitherFieldPerVisitStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, maxDither=1.75, inHex=True, randomSeed=None)[source]

Bases: lsst.sims.maf.stackers.ditherStackers.BaseDitherStacker

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

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

  • 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 or None, optional) – If set, then used as the random seed for the numpy random number generation for the dither offsets. Default None.

colsAdded
class lsst.sims.maf.stackers.ditherStackers.RandomDitherPerNightStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, 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’.

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

  • 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 or None, optional) – If set, then used as the random seed for the numpy random number generation for the dither offsets. Default None.

colsAdded
class lsst.sims.maf.stackers.ditherStackers.RandomRotDitherPerFilterChangeStacker(rotTelCol='rotTelPos', filterCol='filter', degrees=True, maxDither=90.0, maxRotAngle=90, minRotAngle=- 90, randomSeed=None, debug=False)[source]

Bases: lsst.sims.maf.stackers.ditherStackers.BaseDitherStacker

Randomly dither the physical angle of the telescope rotator wrt the mount, after every filter change. Visits (in between filter changes) that cannot all be assigned an offset without surpassing the rotator limit are not dithered.

Parameters
  • rotTelCol (str, optional) – The name of the column in the data specifying the physical angle of the telescope rotator wrt. the mount. Default: ‘rotTelPos’.

  • filterCol (str, optional) – The name of the filter column in the data. Default: ‘filter’.

  • degrees (boolean, optional) – True if angles in the database are in degrees (default). If True, returned dithered values are in degrees also. If False, angles assumed to be in radians and returned in radians.

  • maxDither (float, optional) – Abs(maximum) rotational dither, in degrees. The dithers then will be between -maxDither to maxDither. Default: 90 degrees.

  • maxRotAngle (float, optional) – Maximum rotator angle possible for the camera (degrees). Default 90 degrees.

  • minRotAngle (float, optional) – Minimum rotator angle possible for the camera (degrees). Default -90 degrees.

  • randomSeed (int, optional) – If set, then used as the random seed for the numpy random number generation for the dither offsets. Default: None.

  • debug (bool, optinal) – If True, will print intermediate steps and plots histograms of rotTelPos for cases when no dither is applied. Default: False

colsAdded
class lsst.sims.maf.stackers.ditherStackers.SpiralDitherFieldPerNightStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, 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’.

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

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

colsAdded
class lsst.sims.maf.stackers.ditherStackers.SpiralDitherFieldPerVisitStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, fieldIdCol='fieldId', numPoints=60, maxDither=1.75, nCoils=5, inHex=True)[source]

Bases: lsst.sims.maf.stackers.ditherStackers.BaseDitherStacker

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

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

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

colsAdded
class lsst.sims.maf.stackers.ditherStackers.SpiralDitherPerNightStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, 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’.

  • degrees (bool, optional) – Flag whether RA/Dec should be treated as (and kept as) degrees.

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

colsAdded
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
  • nside (int) – The number of sides of the polygon

  • radius (float) – The radius within which to plot the polygon

  • rotationAngle (float) – The angle to rotate the polygon to.

Returns

List of x/y coordinates of the points describing the polygon.

Return type

[float, float]

lsst.sims.maf.stackers.ditherStackers.setupDitherStackers(raCol, decCol, degrees, **kwargs)[source]
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.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.generalStackers module

class lsst.sims.maf.stackers.generalStackers.DcrStacker(filterCol='filter', altCol='altitude', degrees=True, raCol='fieldRA', decCol='fieldDec', lstCol='observationStartLST', site='LSST', mjdCol='observationStartMJD', dcr_magnitudes=None)[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Calculate the RA,Dec offset expected for an object due to differential chromatic refraction.

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
  • 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 ‘fieldRA’.

  • decCol (str) – Name of the column with Dec. Default ‘fieldDec’.

  • lstCol (str) – Name of the column with local sidereal time. Default ‘observationStartLST’.

  • 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

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

This is useful for making movies if you want to make the pointing have a related color-tuple for a plot.

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

This is generally not needed, unless the m5 parameters have been updated or m5 was not previously calculated.

colsAdded
class lsst.sims.maf.stackers.generalStackers.HourAngleStacker(lstCol='observationStartLST', raCol='fieldRA', degrees=True)[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Add the Hour Angle for each observation. Always in HOURS.

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

colsAdded
class lsst.sims.maf.stackers.generalStackers.OpSimFieldStacker(raCol='fieldRA', decCol='fieldDec', degrees=True)[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Add the fieldId of the closest OpSim field for each RA/Dec pointing.

Parameters
  • raCol (str, opt) – Name of the RA column. Default fieldRA.

  • decCol (str, opt) – Name of the Dec column. Default fieldDec.

colsAdded
class lsst.sims.maf.stackers.generalStackers.ParallacticAngleStacker(raCol='fieldRA', decCol='fieldDec', degrees=True, mjdCol='observationStartMJD', lstCol='observationStartLST', site='LSST')[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Add the parallactic angle to each visit. If ‘degrees’ is True, this will be in degrees (as are all other angles). If False, then in radians.

colsAdded
class lsst.sims.maf.stackers.generalStackers.ParallaxFactorStacker(raCol='fieldRA', decCol='fieldDec', dateCol='observationStartMJD', degrees=True)[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Calculate the parallax factors for each opsim pointing. Output parallax factor in arcseconds.

colsAdded
class lsst.sims.maf.stackers.generalStackers.SaturationStacker(seeingCol='seeingFwhmEff', skybrightnessCol='skyBrightness', exptimeCol='visitExposureTime', nexpCol='numExposures', filterCol='filter', airmassCol='airmass', saturation_e=150000.0, zeropoints=None, km=None, pixscale=0.2, gain=1.0)[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Calculate the saturation limit of a point source. Assumes Guassian PSF.

Parameters
  • pixscale (float, opt (0.2)) – Arcsec per pixel

  • gain (float, opt (2.3)) – electrons per adu

  • saturation_e (float, opt (150e3)) – The saturation level in electrons

  • zeropoints (dict-like, opt (None)) – The zeropoints for the telescope. Keys should be str with filter names, values in mags. If None, will use Rubin-like zeropoints.

  • km (dict-like, opt (None)) – Atmospheric extinction values. Keys should be str with filter names. If None, will use Rubin-like zeropoints.

colsAdded
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. If ‘degrees’ is True, then assumes altCol is in degrees and returns degrees. If ‘degrees’ is False, assumes altCol is in radians and returns radians.

colsAdded

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

getUnits(colName)[source]

Return the appropriate units for colName.

If no units have been defined for a given column, return the default units (‘’).

Parameters

colName (str) – The name of the column

Returns

Return type

str

lsst.sims.maf.stackers.m5OptimalStacker module

class lsst.sims.maf.stackers.m5OptimalStacker.M5OptimalStacker(airmassCol='airmass', decCol='fieldDec', skyBrightCol='skyBrightness', seeingCol='seeingFwhmEff', 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

colsAdded
lsst.sims.maf.stackers.m5OptimalStacker.generate_sky_slopes()[source]

Fit a line to how the sky brightness changes with airmass.

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 (SSobject) stackers. Relevant for MoSlicer ssObs (pd.dataframe).

Provided to add moving-object specific API for ‘run’ method of moving object stackers.

run(ssoObs, Href, Hval=None)[source]

Example: Generate the new stacker columns, given the simdata columns from the database. Returns the new simdata structured array that includes the new stacker columns.

class lsst.sims.maf.stackers.moStackers.CometMagVStacker(k=2, rhCol='helio_dist', deltaCol='geo_dist')[source]

Bases: lsst.sims.maf.stackers.moStackers.BaseMoStacker

Add an base V magnitude using a cometary magnitude model.

The cometV magnitude is intended to replace the ‘magV’ column coming from sims_movingObjects, thus it does NOT take into account Hval, only Href. The full ‘apparent magnitude’ is calculated with the MoMagStacker, configured for the appropriate ‘vMagCol’.

m = M + 5 log10(Δ) + (5 + K) log10(rh)

Parameters
  • k (float, opt) – Activity / intrinsic brightness dependence on heliocentric distance: rh**k. Note the default here is k = 2.

  • rhCol (str, opt) – The column name for the heliocentric distance. Default ‘helio_dist’.

  • deltaCol (str, opt) – The column name for the geocentric distance. Default ‘geo_dist’.

colsAdded
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
  • raCol (str, opt) – Name of the RA column to convert to ecliptic lat/long. Default ‘ra’.

  • decCol (str, opt) – Name of the Dec column to convert to ecliptic lat/long. Default ‘dec’.

  • inDeg (bool, opt) – Flag indicating whether RA/Dec are in degrees. Default True.

colsAdded
class lsst.sims.maf.stackers.moStackers.MoMagStacker(vMagCol='magV', colorCol='dmagColor', lossCol='dmagDetect', m5Col='fiveSigmaDepth', gamma=0.038, sigma=0.12, randomSeed=None)[source]

Bases: lsst.sims.maf.stackers.moStackers.BaseMoStacker

Add columns relevant to SSobject 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
  • 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).

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

colsAdded

lsst.sims.maf.stackers.nFollowStacker module

class lsst.sims.maf.stackers.nFollowStacker.NFollowStacker(minSize=3.0, airmassLimit=2.5, timeSteps=array([0.5, 3.5, 6.5, 9.5]), mjdCol='observationStartMJD', raCol='fieldRA', decCol='fieldDec', degrees=True)[source]

Bases: lsst.sims.maf.stackers.baseStacker.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, opt) – The minimum telescope aperture to use, in meters. Default 3.0.

  • airmassLimit (float, opt) – The maximum airmass allowable at the follow-up observatory. Default 2.5.

  • timeSteps (np.array or list of floats, opt) – The timesteps to check for followup opportunities, in hours. Default is np.arange(0.5, 12., 3.0).

  • mjdCol (str, opt) – The exposure MJD column name. Default ‘observationStartMJD’.

  • raCol (str, opt) – The RA column name. Default ‘fieldRA’.

  • decCol (str, opt) – The Dec column name. Default ‘fieldDec’.

  • raDecDeg (bool, opt) – Flag whether RA/Dec are in degrees (True) or radians (False).

colsAdded
lsst.sims.maf.stackers.nFollowStacker.findTelescopes(minSize=3.0)[source]

Finds telescopes larger than minSize, 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

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

colsAdded

lsst.sims.maf.stackers.snStacker module

class lsst.sims.maf.stackers.snStacker.CoaddStacker(mjdCol='observationStartMJD', RaCol='fieldRA', DecCol='fieldDec', m5Col='fiveSigmaDepth', nightcol='night', filterCol='filter', nightCol='night', numExposuresCol='numExposures', visitTimeCol='visitTime', visitExposureTimeCol='visitExposureTime')[source]

Bases: lsst.sims.maf.stackers.baseStacker.BaseStacker

Stacker to estimate m5 “coadded” per band and par night

Parameters

list (str, opt) – Name of the columns used. Default : ‘observationStartMJD’, ‘fieldRA’, ‘fieldDec’,’filter’,’fiveSigmaDepth’,’visitExposureTime’,’night’,’observationId’, ‘numExposures’,’visitTime’

colsAdded
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))

m5_coadd(m5)[source]

Estimation of “coadded” m5 values based on: flux_5sigma = 10**(-0.4*m5) sigmas = flux_5sigma/5. sigma_tot = 1./sqrt(np.sum(1/sigmas**2)) flux_tot = 5.*sigma_tot

Parameters

m5 (set of m5 (five-sigma depths) values) –

Returns

Return type

“coadded” m5 value

Module contents