lsst.sims.maf.batches package

Submodules

lsst.sims.maf.batches.altazBatch module

lsst.sims.maf.batches.altazBatch.altazHealpix(colmap=None, runName='opsim', extraSql=None, extraMetadata=None, metricName='NVisits Alt/Az')[source]

Generate a set of metrics measuring the number visits as a function of alt/az plotted on a HealpixSkyMap.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

  • metricName (str, opt) – Unique name to assign to metric

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.altazBatch.altazLambert(colmap=None, runName='opsim', extraSql=None, extraMetadata=None, metricName='Nvisits as function of Alt/Az')[source]

Generate a set of metrics measuring the number visits as a function of alt/az plotted on a LambertSkyMap.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

  • metricName (str, opt) – Unique name to assign to metric

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.colMapDict module

lsst.sims.maf.batches.colMapDict.ColMapDict(dictName=None)[source]
lsst.sims.maf.batches.colMapDict.getColMap(opsdb)[source]

Get the colmap dictionary, if you already have a database object.

Parameters

opsdb (lsst.sims.maf.db.Database or lsst.sims.maf.db.OpsimDatabase) –

Returns

Return type

dictionary

lsst.sims.maf.batches.common module

lsst.sims.maf.batches.common.combineMetadata(meta1, meta2)[source]
lsst.sims.maf.batches.common.extendedMetrics(colname, replace_colname=None)[source]

An extended set of simple metrics for some quantity. Typically applied with unislicer.

Parameters
  • colname (str) – The column name to apply the metrics to.

  • replace_colname (str or None, opt) – Value to replace colname with in the metricName. i.e. if replace_colname=’’ then metric name is Mean, instead of Mean Airmass, or if replace_colname=’seeingGeom’, then metric name is Mean seeingGeom instead of Mean seeingFwhmGeom. Default is None, which does not alter the metric name.

Returns

Return type

List of configured metrics.

lsst.sims.maf.batches.common.extendedSummary()[source]

An extended set of summary metrics, to calculate all that is in the standard summary stats, plus 25/75 percentiles.

lsst.sims.maf.batches.common.filterList(all=True, extraSql=None, extraMetadata=None)[source]

Return a list of filters, plot colors and orders.

Parameters
  • all (boolean, opt) – Include ‘all’ in the list of filters and as part of the colors/orders dictionaries. Default True.

  • extraSql (str, opt) – Additional sql constraint to add to sqlconstraints returned per filter. Default None.

  • extraMetadata (str, opt) – Substitute metadata to add to metadata strings composed per band. Default None.

Returns

List of filter names, dictionary of colors (for plots), dictionary of orders (for display)

Return type

list, dict, dict

lsst.sims.maf.batches.common.fractionPopulationAtThreshold(thresholds, optnames=None)[source]

Creates a list of summary metrics to be applied to any moving object metric which reports a float value, calculating the fraction of the population above X.

Parameters
  • thresholds (list of float) – The thresholds at which to calculate what fraction of the population exceeds these values.

  • optnames (list of str, opt) – If provided, these names will be used instead of the threshold values when constructing the metric names. This allows more descriptive summary statistic names.

Returns

Return type

List of moving object MoCompleteness metrics (differential fractions of the population)

lsst.sims.maf.batches.common.radecCols(ditherStacker, colmap, ditherkwargs=None)[source]
lsst.sims.maf.batches.common.standardAngleMetrics(colname, replace_colname=None)[source]

A set of standard simple metrics for some quantity which is a wrap-around angle.

Parameters
  • colname (str) – The column name to apply the metrics to.

  • replace_colname (str or None, opt) – Value to replace colname with in the metricName. i.e. if replace_colname=’’ then metric name is Mean, instead of Mean Airmass, or if replace_colname=’seeingGeom’, then metric name is Mean seeingGeom instead of Mean seeingFwhmGeom. Default is None, which does not alter the metric name.

Returns

Return type

List of configured metrics.

lsst.sims.maf.batches.common.standardMetrics(colname, replace_colname=None)[source]

A set of standard simple metrics for some quantity. Typically would be applied with unislicer.

Parameters
  • colname (str) – The column name to apply the metrics to.

  • replace_colname (str or None, opt) – Value to replace colname with in the metricName. i.e. if replace_colname=’’ then metric name is Mean, instead of Mean Airmass, or if replace_colname=’seeingGeom’, then metric name is Mean seeingGeom instead of Mean seeingFwhmGeom. Default is None, which does not alter the metric name.

Returns

Return type

List of configured metrics.

lsst.sims.maf.batches.common.standardSummary(withCount=True)[source]

A set of standard summary metrics, to calculate Mean, RMS, Median, #, Max/Min, and # 3-sigma outliers.

lsst.sims.maf.batches.common.summaryCompletenessAtTime(times, Hval, Hindex=0.33)[source]

A simple list of summary metrics to be applied to the Discovery_Time or PreviouslyKnown metrics. (can be used with any moving object metric which returns the time of discovery).

Parameters
  • times (np.ndarray or list) – The times at which to evaluate the completeness @ Hval.

  • Hval (float) – The H value at which to evaluate the completeness (cumulative and differential).

  • Hindex (float, opt) – The index of the power law to integrate H over (for cumulative completeness). Default is 0.33.

Returns

Return type

List of moving object MoCompletenessAtTime metrics (cumulative and differential)

lsst.sims.maf.batches.common.summaryCompletenessOverH(requiredChances=1, Hindex=0.33)[source]

A simple list of summary metrics to be applied to the Discovery_N_Chances metric.

Parameters
  • requiredChances (int, opt) – Number of discovery opportunities required to consider an object ‘discovered’.

  • Hindex (float, opt) – The index of the power law to integrate H over (for cumulative completeness). Default is 0.33.

Returns

Return type

List of moving object MoCompleteness metrics (cumulative and differential)

lsst.sims.maf.batches.descWFDBatch module

lsst.sims.maf.batches.descWFDBatch.descWFDBatch(colmap=None, runName='opsim', nside=64, bandpass='i', nfilters_needed=6, lim_ebv=0.2, mag_cuts={1: 24.65, 3: 25.25, 6: 25.619999999999997, 10: 25.9})[source]
lsst.sims.maf.batches.descWFDBatch.tdcBatch(colmap=None, runName='opsim', nside=64, extraSql=None, extraMetadata=None)[source]

lsst.sims.maf.batches.filterchangeBatch module

lsst.sims.maf.batches.filterchangeBatch.filtersPerNight(colmap=None, runName='opsim', nights=1, extraSql=None, extraMetadata=None)[source]

Generate a set of metrics measuring the number and rate of filter changes over a given span of nights.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • run_name (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nights (int, opt) – Size of night bin to use when calculating metrics. Default is 1.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.filterchangeBatch.filtersWholeSurvey(colmap=None, runName='opsim', extraSql=None, extraMetadata=None)[source]

Generate a set of metrics measuring the number and rate of filter changes over the entire survey.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • run_name (str, opt) – The name of the simulated survey. Default is “opsim”.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.glanceBatch module

lsst.sims.maf.batches.glanceBatch.glanceBatch(colmap=None, runName='opsim', nside=64, filternames=('u', 'g', 'r', 'i', 'z', 'y'), nyears=10, pairnside=32, sqlConstraint=None, slicer_camera='LSST')[source]

Generate a handy set of metrics that give a quick overview of how well a survey performed. This is a meta-set of other batches, to some extent.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • run_name (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nside (int, opt) – The nside for the healpix slicers. Default 64.

  • filternames (list of str, opt) – The list of individual filters to use when running metrics. Default is (‘u’, ‘g’, ‘r’, ‘i’, ‘z’, ‘y’). There is always an all-visits version of the metrics run as well.

  • nyears (int (10)) – How many years to attempt to make hourglass plots for

  • pairnside (int (32)) – nside to use for the pair fraction metric (it’s slow, so nice to use lower resolution)

  • sqlConstraint (str or None, opt) – Additional SQL constraint to apply to all metrics.

  • slicer_camera (str ('LSST')) – Sets which spatial slicer to use. options are ‘LSST’ and ‘ComCam’

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.hourglassBatch module

Run the hourglass metric.

lsst.sims.maf.batches.hourglassBatch.hourglassPlots(colmap=None, runName='opsim', nyears=10, extraSql=None, extraMetadata=None)[source]

Run the hourglass metric, for each individual year.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • run_name (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nyears (int (10), opt) – How many years to attempt to make hourglass plots for. Default is 10.

  • extraSql (str, opt) – Add an extra sql constraint before running metrics. Default None.

  • extraMetadata (str, opt) – Add an extra piece of metadata before running metrics. Default None.

lsst.sims.maf.batches.metadataBatch module

Some basic physical quantity metrics.

lsst.sims.maf.batches.metadataBatch.allMetadata(colmap=None, runName='opsim', extraSql=None, extraMetadata=None)[source]

Generate a large set of metrics about the metadata of each visit - distributions of airmass, normalized airmass, seeing, sky brightness, single visit depth, hour angle, distance to the moon, and solar elongation. The exact metadata which is analyzed is set by the colmap[‘metadataList’] value.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • extraSql (str, opt) – Sql constraint (such as WFD only). Default is None.

  • extraMetadata (str, opt) – Metadata to identify the sql constraint (such as WFD). Default is None.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.metadataBatch.metadataBasics(value, colmap=None, runName='opsim', valueName=None, groupName=None, extraSql=None, extraMetadata=None, nside=64)[source]

Calculate basic metrics on visit metadata ‘value’ (e.g. airmass, normalized airmass, seeing..). Calculates this around the sky (HealpixSlicer), makes histograms of all visits (OneDSlicer), and calculates statistics on all visits (UniSlicer) for the quantity in all visits and per filter.

TODO: handle stackers which need configuration (degrees, in particular) more automatically. Currently have a hack for HA & normairmass.

Parameters
  • value (str) – The column name for the quantity to evaluate. (column name in the database or created by a stacker).

  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • valueName (str, opt) – The name of the value to be reported in the resultsDb and added to the metric. This is intended to help standardize metric comparison between sim versions. value = name as it is in the database (seeingFwhmGeom, etc). valueName = name to be recorded (‘seeingGeom’, etc.). Default is None, which will match ‘value’.

  • groupName (str, opt) – The group name for this quantity in the displayDict. Default is the same as ‘valueName’, capitalized.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

  • nside (int, opt) – Nside value for healpix slicer. Default 64. If “None” is passed, the healpixslicer-based metrics will be skipped.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.metadataBatch.metadataBasicsAngle(value, colmap=None, runName='opsim', valueName=None, groupName=None, extraSql=None, extraMetadata=None, nside=64, ditherStacker=None, ditherkwargs=None)[source]

Calculate basic metrics on visit metadata ‘value’, where value is a wrap-around angle.

Calculates extended standard metrics (with unislicer) on the quantity (all visits and per filter), makes histogram of the value (all visits and per filter),

Parameters
  • value (str) – The column name for the quantity to evaluate. (column name in the database or created by a stacker).

  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • valueName (str, opt) – The name of the value to be reported in the resultsDb and added to the metric. This is intended to help standardize metric comparison between sim versions. value = name as it is in the database (seeingFwhmGeom, etc). valueName = name to be recorded (‘seeingGeom’, etc.). Default is None, which will match ‘value’.

  • groupName (str, opt) – The group name for this quantity in the displayDict. Default is the same as ‘valueName’, capitalized.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

  • nside (int, opt) – Nside value for healpix slicer. Default 64. If “None” is passed, the healpixslicer-based metrics will be skipped.

  • ditherStacker (str or lsst.sims.maf.stackers.BaseDitherStacker) – Optional dither stacker to use to define ra/dec columns.

  • ditherkwargs (dict, opt) – Optional dictionary of kwargs for the dither stacker.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.metadataBatch.metadataMaps(value, colmap=None, runName='opsim', valueName=None, groupName=None, extraSql=None, extraMetadata=None, nside=64)[source]

Calculate 25/50/75 percentile values on maps across sky for a single metadata value.

TODO: handle stackers which need configuration (degrees, in particular) more automatically. Currently have a hack for HA & normairmass.

Parameters
  • value (str) – The column name for the quantity to evaluate. (column name in the database or created by a stacker).

  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • valueName (str, opt) – The name of the value to be reported in the resultsDb and added to the metric. This is intended to help standardize metric comparison between sim versions. value = name as it is in the database (seeingFwhmGeom, etc). valueName = name to be recorded (‘seeingGeom’, etc.). Default is None, which will match ‘value’.

  • groupName (str, opt) – The group name for this quantity in the displayDict. Default is the same as ‘valueName’, capitalized.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

  • nside (int, opt) – Nside value for healpix slicer. Default 64. If “None” is passed, the healpixslicer-based metrics will be skipped.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.movingObjectsBatch module

lsst.sims.maf.batches.movingObjectsBatch.characterizationInnerBatch(slicer, colmap=None, runName='opsim', metadata='', albedo=None, Hmark=None, constraint=None, npReduce=<function mean>, windows=None, bins=None)[source]

Characterization metrics for inner solar system objects.

lsst.sims.maf.batches.movingObjectsBatch.characterizationOuterBatch(slicer, colmap=None, runName='opsim', metadata='', albedo=None, Hmark=None, constraint=None, npReduce=<function mean>, windows=None, bins=None)[source]

Characterization metrics for outer solar system objects.

lsst.sims.maf.batches.movingObjectsBatch.combineSubsets(mbSubsets)[source]
lsst.sims.maf.batches.movingObjectsBatch.defaultCharacterization(metadata)[source]

Provide useful characterization bundle type, based on metadata of population type.

lsst.sims.maf.batches.movingObjectsBatch.defaultHrange(metadata)[source]

Provide useful default ranges for H, based on metadata of population type.

lsst.sims.maf.batches.movingObjectsBatch.discoveryBatch(slicer, colmap=None, runName='opsim', detectionLosses='detection', metadata='', albedo=None, Hmark=None, npReduce=<function mean>, constraint=None)[source]
lsst.sims.maf.batches.movingObjectsBatch.plotActivity(bdict, figroot=None, resultsDb=None, outDir='.', figformat='pdf')[source]
lsst.sims.maf.batches.movingObjectsBatch.plotCompleteness(bdictCompleteness, figroot=None, resultsDb=None, outDir='.', figformat='pdf')[source]

Plot a minor subset of the completeness results.

lsst.sims.maf.batches.movingObjectsBatch.plotFractions(bdictFractions, figroot=None, resultsDb=None, outDir='.', figformat='pdf')[source]
lsst.sims.maf.batches.movingObjectsBatch.plotSingle(bundle, resultsDb=None, outDir='.', figformat='pdf')[source]

Plot 5%/25%/50%/75%/95% iles for a metric value.

lsst.sims.maf.batches.movingObjectsBatch.quickDiscoveryBatch(slicer, colmap=None, runName='opsim', detectionLosses='detection', metadata='', albedo=None, Hmark=None, npReduce=<function mean>, constraint=None)[source]
lsst.sims.maf.batches.movingObjectsBatch.readAndCombine(orbitRoot, baseDir, splits, metricfile)[source]

Read and combine the metric results from split locations, returning a single bundle.

This will read the files from baseDir/orbitRoot_[split]/metricfile where split = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], etc. (the subsets the original orbit file was split into).

Parameters
  • orbitRoot (str) – The root of the orbit file - l7_5k, mbas_5k, etc.

  • baseDir (str) – The root directory containing the subset directories. (e.g. ‘.’ often)

  • splits (np.ndarray or list of ints) – The integers describing the split directories (e.g. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

  • metricfile (str) – The metric filename.

Returns

  • ~lsst.sims.maf.bundle – A single metric bundle containing the combined data from each of the subsets.

  • Note that this won’t work for particularly complex metric values, such as the parent Discovery metrics.

  • However, you can read and combine their child metrics, as for these we can propagate the data masks.

lsst.sims.maf.batches.movingObjectsBatch.runCompletenessSummary(bdict, Hmark, times, outDir, resultsDb)[source]

Calculate completeness and create completeness bundles from all N_Chances and Time (child) metrics of the (discovery) bundles in bdict, and write completeness at Hmark to resultsDb, save bundle to disk.

This should be done after combining any sub-sets of the metric results.

Parameters
  • bdict (dict of metricBundles) – Dict containing ~lsst.sims.maf.MoMetricBundles, including bundles we’re expecting to contain completeness.

  • Hmark (float) – Hmark value to add to completeness plotting dict. If not defined (None), then the Hmark from the plotdict from the metric will be used if available. If None and Hmark not in plotDict, then median of Hrange value will be used.

  • times (np.ndarray) – The times at which to calculate completeness (over time).

  • outDir (str) – Output directory to save completeness bundles to disk.

  • resultsDb (ResultsDb) – Results database to save information about completeness bundle.

Returns

A dictionary of the new completeness bundles. Keys match original keys, with additions of “[Differential,Cumulative]Completeness@Time” and “[Differential,Cumulative]Completeness” to distinguish new entries.

Return type

dict of metricBundles

lsst.sims.maf.batches.movingObjectsBatch.runFractionSummary(bdict, Hmark, outDir, resultsDb)[source]

Calculate fractional completeness of the population for color and lightcurve metrics.

This should be done after combining any sub-sets of the metric results.

Parameters
  • bdict (dict of metricBundles) – Dict containing ~lsst.sims.maf.MoMetricBundles, including bundles we’re expecting to contain lightcurve/color evaluations.

  • Hmark (float) – Hmark value to add to completeness plotting dict. If defined, this value is used. If None, but Hmark in plotDict for metric, then this value (-2) is used. If Hmark not in plotdict, then the median Hrange value - 2 is used.

  • times (np.ndarray) – The times at which to calculate completeness (over time).

  • outDir (str) – Output directory to save completeness bundles to disk.

  • resultsDb (ResultsDb) – Results database to save information about completeness bundle.

Returns

Dictionary of the metric bundles for the fractional evaluation of the population.

Return type

dict of metricBundles

lsst.sims.maf.batches.movingObjectsBatch.setupMoSlicer(orbitFile, Hrange, obsFile=None)[source]

Set up the slicer and read orbitFile and obsFile from disk.

Parameters
  • orbitFile (str) – The file containing the orbit information.

  • Hrange (numpy.ndarray or None) – The Hrange parameter to pass to slicer.readOrbits

  • obsFile (str, optional) – The file containing the observations of each object, optional. If not provided (default, None), then the slicer will not be able to ‘slice’, but can still plot.

Returns

Return type

MoObjSlicer

lsst.sims.maf.batches.openshutterBatch module

Evaluate the open shutter fraction.

lsst.sims.maf.batches.openshutterBatch.openshutterFractions(colmap=None, runName='opsim', extraSql=None, extraMetadata=None)[source]

Evaluate open shutter fraction over whole survey and per night.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘night<365’) Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

lsst.sims.maf.batches.scienceRadarBatch module

lsst.sims.maf.batches.scienceRadarBatch.scienceRadarBatch(colmap=None, runName='opsim', extraSql=None, extraMetadata=None, nside=64, benchmarkArea=18000, benchmarkNvisits=825, DDF=True)[source]

A batch of metrics for looking at survey performance relative to the SRD and the main science drivers of LSST.

lsst.sims.maf.batches.skycoverage module

Evaluate some bulk properties of the sky coverage

lsst.sims.maf.batches.skycoverage.eastWestBias(colmap=None, runName='opsim', extraSql=None, extraMetadata=None)[source]

Plot the number of observations to the east vs to the west, per night.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘night<365’) Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

lsst.sims.maf.batches.skycoverage.meanRADec(colmap=None, runName='opsim', extraSql=None, extraMetadata=None)[source]

Plot the range of RA/Dec as a function of night.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘night<365’) Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

lsst.sims.maf.batches.slewBatch module

Sets of slew metrics.

lsst.sims.maf.batches.slewBatch.slewActivities(colmap=None, runName='opsim', totalSlewN=1, sqlConstraint=None)[source]

Generate a set of slew statistics focused on finding the contributions to the overall slew time. These slew statistics must be run on the SlewActivities table in opsimv4 and opsimv3.

Note that the type of activities listed are different between v3 and v4.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • totalSlewN (int, opt) – The total number of slews in the simulated survey. Used to calculate % of slew activities for each component. Default is 1.

  • sqlConstraint (str or None, opt) – SQL constraint to apply to metrics. Note this runs on Slew*State table, so constraints should generally be based on slew_slewCount.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.slewBatch.slewAngles(colmap=None, runName='opsim', sqlConstraint=None)[source]

Generate a set of slew statistics focused on the angles of each component (dome and telescope). These slew statistics must be run on the SlewFinalState or SlewInitialState table in opsimv4, and on the SlewState table in opsimv3.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • sqlConstraint (str or None, opt) – SQL constraint to apply to metrics. Note this runs on Slew*State table, so constraints should generally be based on slew_slewCount.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.slewBatch.slewBasics(colmap=None, runName='opsim', sqlConstraint=None)[source]

Generate a simple set of statistics about the slew times and distances. These slew statistics can be run on the summary or default tables.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • sqlConstraint (str or None, opt) – SQL constraint to add to metrics. (note this runs on summary table).

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.slewBatch.slewSpeeds(colmap=None, runName='opsim', sqlConstraint=None)[source]

Generate a set of slew statistics focused on the speeds of each component (dome and telescope). These slew statistics must be run on the SlewMaxSpeeds table in opsimv4 and opsimv3.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names. Note that for these metrics, the column names are distinctly different in v3/v4.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • sqlConstraint (str or None, opt) – SQL constraint to apply to metrics. Note this runs on Slew*State table, so constraints should generally be based on slew_slewCount.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.srdBatch module

Sets of metrics to look at the SRD metrics.

lsst.sims.maf.batches.srdBatch.astrometryBatch(colmap=None, runName='opsim', extraSql=None, extraMetadata=None, nside=64, ditherStacker=None, ditherkwargs=None)[source]

Metrics for evaluating proper motion and parallax.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nside (int, opt) – Nside for the healpix slicer. Default 64.

  • extraSql (str or None, opt) – Additional sql constraint to apply to all metrics.

  • extraMetadata (str or None, opt) – Additional metadata to apply to all results.

  • ditherStacker (str or lsst.sims.maf.stackers.BaseDitherStacker) – Optional dither stacker to use to define ra/dec columns.

  • ditherkwargs (dict, opt) – Optional dictionary of kwargs for the dither stacker.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.srdBatch.fOBatch(colmap=None, runName='opsim', extraSql=None, extraMetadata=None, nside=64, benchmarkArea=18000, benchmarkNvisits=825, minNvisits=750)[source]

Metrics for calculating fO.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nside (int, opt) – Nside for the healpix slicer. Default 64.

  • extraSql (str or None, opt) – Additional sql constraint to apply to all metrics.

  • extraMetadata (str or None, opt) – Additional metadata to apply to all results.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.srdBatch.rapidRevisitBatch(colmap=None, runName='opsim', extraSql=None, extraMetadata=None, nside=64, ditherStacker=None, ditherkwargs=None)[source]

Metrics for evaluating proper motion and parallax.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nside (int, opt) – Nside for the healpix slicer. Default 64.

  • extraSql (str or None, opt) – Additional sql constraint to apply to all metrics.

  • extraMetadata (str or None, opt) – Additional metadata to apply to all results.

  • ditherStacker (str or lsst.sims.maf.stackers.BaseDitherStacker) – Optional dither stacker to use to define ra/dec columns.

  • ditherkwargs (dict, opt) – Optional dictionary of kwargs for the dither stacker.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.timeBatch module

Sets of metrics to look at time between visits/pairs, etc.

lsst.sims.maf.batches.timeBatch.interNight(colmap=None, runName='opsim', nside=64, extraSql=None, extraMetadata=None, slicer=None, display_group='InterNight', subgroup='Night gaps')[source]

Generate a set of statistics about the spacing between nights with observations.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nside (int, opt) – Nside for the healpix slicer. Default 64.

  • extraSql (str or None, opt) – Additional sql constraint to apply to all metrics.

  • extraMetadata (str or None, opt) – Additional metadata to use for all outputs.

  • slicer (slicer object (None)) – Optinally use something other than a HealpixSlicer

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.timeBatch.intraNight(colmap=None, runName='opsim', nside=64, extraSql=None, extraMetadata=None, slicer=None, display_group='IntraNight', subgroup='Pairs')[source]

Generate a set of statistics about the pair/triplet/etc. rate within a night.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nside (int, opt) – Nside for the healpix slicer. Default 64.

  • extraSql (str or None, opt) – Additional sql constraint to apply to all metrics.

  • extraMetadata (str or None, opt) – Additional metadata to apply to all results.

  • slicer (slicer object (None)) – Optinally use something other than a HealpixSlicer

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.timeBatch.seasons(colmap=None, runName='opsim', nside=64, extraSql=None, extraMetadata=None)[source]

Generate a set of statistics about the length and number of seasons.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nside (int, opt) – Nside for the healpix slicer. Default 64.

  • extraSql (str or None, opt) – Additional sql constraint to apply to all metrics.

  • extraMetadata (str or None, opt) – Additional metadata to use for all outputs.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.timeSciBatch module

Sets of metrics to look at impact of cadence on science

lsst.sims.maf.batches.timeSciBatch.phaseGap(colmap=None, runName='opsim', nside=64, extraSql=None, extraMetadata=None, ditherStacker=None, ditherkwargs=None)[source]

Generate a set of statistics about the pair/triplet/etc. rate within a night.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • nside (int, opt) – Nside for the healpix slicer. Default 64.

  • extraSql (str or None, opt) – Additional sql constraint to apply to all metrics.

  • extraMetadata (str or None, opt) – Additional metadata to apply to all results.

  • ditherStacker (str or lsst.sims.maf.stackers.BaseDitherStacker) – Optional dither stacker to use to define ra/dec columns.

  • ditherkwargs (dict or None, opt) – Optional dictionary of kwargs for the dither stacker.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.visitdepthBatch module

Sets of metrics to look at general sky coverage - nvisits/coadded depth/Teff.

lsst.sims.maf.batches.visitdepthBatch.nvisitsM5Maps(colmap=None, runName='opsim', extraSql=None, extraMetadata=None, nside=64, runLength=10.0, ditherStacker=None, ditherkwargs=None)[source]

Generate number of visits and Coadded depth per RA/Dec point in all and per filters.

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

  • nside (int, opt) – Nside value for healpix slicer. Default 64. If “None” is passed, the healpixslicer-based metrics will be skipped.

  • runLength (float, opt) – Length of the simulated survey, for scaling values for the plot limits. Default 10.

  • ditherStacker (str or lsst.sims.maf.stackers.BaseDitherStacker) – Optional dither stacker to use to define ra/dec columns.

  • ditherkwargs (dict, opt) – Optional dictionary of kwargs for the dither stacker.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.visitdepthBatch.nvisitsPerNight(colmap=None, runName='opsim', binNights=1, extraSql=None, extraMetadata=None, subgroup=None)[source]

Count the number of visits per night through the survey.

Parameters
  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • binNights (int, opt) – Number of nights to count in each bin. Default = 1, count number of visits in each night.

  • extraSql (str or None, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str or None, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

  • subgroup (str or None, opt) – Use this for the ‘subgroup’ in the displayDict, instead of metadata. Default is None.

Returns

Return type

metricBundleDict

lsst.sims.maf.batches.visitdepthBatch.nvisitsPerProp(opsdb, colmap=None, runName='opsim', binNights=1, extraSql=None)[source]

Set up a group of all and per-proposal nvisits metrics.

Parameters
  • opsdb (lsst.sims.maf.db.Database or lsst.sims.maf.db.OpsimDatabase* object) –

  • colmap (dict or None, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • binNights (int, opt) – Number of nights to count in each bin. Default = 1, count number of visits in each night.

  • sqlConstraint (str or None, opt) – SQL constraint to add to all metrics.

Returns

Return type

metricBundle

lsst.sims.maf.batches.visitdepthBatch.tEffMetrics(colmap=None, runName='opsim', extraSql=None, extraMetadata=None, nside=64, ditherStacker=None, ditherkwargs=None)[source]

Generate a series of Teff metrics. Teff total, per night, and sky maps (all and per filter).

Parameters
  • colmap (dict, opt) – A dictionary with a mapping of column names. Default will use OpsimV4 column names.

  • runName (str, opt) – The name of the simulated survey. Default is “opsim”.

  • extraSql (str, opt) – Additional constraint to add to any sql constraints (e.g. ‘propId=1’ or ‘fieldID=522’). Default None, for no additional constraints.

  • extraMetadata (str, opt) – Additional metadata to add before any below (i.e. “WFD”). Default is None.

  • nside (int, opt) – Nside value for healpix slicer. Default 64. If “None” is passed, the healpixslicer-based metrics will be skipped.

  • ditherStacker (str or lsst.sims.maf.stackers.BaseDitherStacker) – Optional dither stacker to use to define ra/dec columns.

  • ditherkwargs (dict, opt) – Optional dictionary of kwargs for the dither stacker.

Returns

Return type

metricBundleDict

Module contents