lsst.fgcmcal gc49b57b85e+7226047d04
Loading...
Searching...
No Matches
lsst.fgcmcal.utilities Namespace Reference

Functions

 makeConfigDict (config, log, camera, maxIter, resetFitParameters, outputZeropoints, lutFilterNames, tract=None, nCore=1, doPlots=False)
 
 translateFgcmLut (lutCat, physicalFilterMap)
 
 translateVisitCatalog (visitCat)
 
 _computeDefaultVisitInfo ()
 
 computeReferencePixelScale (camera, useScienceDetectors=False)
 
 computePixelAreaFieldDetector (detector, visitInfo=None, areaScaling=1.0, approximate=False)
 
 computeApproxPixelAreaFields (camera)
 
 makeZptSchema (superStarChebyshevSize, zptChebyshevSize)
 
 makeZptCat (zptSchema, zpStruct)
 
 makeAtmSchema ()
 
 makeAtmCat (atmSchema, atmStruct)
 
 makeStdSchema (nBands)
 
 makeStdCat (stdSchema, stdStruct, goodBands)
 
 computeApertureRadiusFromName (fluxField)
 
 extractReferenceMags (refStars, bands, filterMap)
 
 lookupStaticCalibrations (datasetType, registry, quantumDataId, collections)
 
 countDetectors (camera, useScienceDetectors)
 

Variables

str FGCM_EXP_FIELD = 'VISIT'
 
str FGCM_CCD_FIELD = 'DETECTOR'
 
float FGCM_ILLEGAL_VALUE = -9999.0
 

Detailed Description

Utility functions for fgcmcal.

This file contains utility functions that are used by more than one task,
and do not need to be part of a task.

Function Documentation

◆ _computeDefaultVisitInfo()

lsst.fgcmcal.utilities._computeDefaultVisitInfo ( )
protected
Compute a default visitInfo for use with pixel scale / jacobians.

Returns
-------
visitInfo : `lsst.afw.image.VisitInfo`
    The visit info object.

Definition at line 464 of file utilities.py.

◆ computeApertureRadiusFromName()

lsst.fgcmcal.utilities.computeApertureRadiusFromName ( fluxField)
Compute the radius associated with a CircularApertureFlux or ApFlux field.

Parameters
----------
fluxField : `str`
   CircularApertureFlux or ApFlux

Returns
-------
apertureRadius : `float`
    Radius of the aperture field, in pixels.

Raises
------
 RuntimeError: Raised if flux field is not a CircularApertureFlux,
   ApFlux, or apFlux.

Definition at line 863 of file utilities.py.

◆ computeApproxPixelAreaFields()

lsst.fgcmcal.utilities.computeApproxPixelAreaFields ( camera)
Compute the approximate pixel area bounded fields from the camera
geometry.

Parameters
----------
camera: `lsst.afw.cameraGeom.Camera`

Returns
-------
approxPixelAreaFields: `dict`
   Dictionary of approximate area fields, keyed with detector ID

Definition at line 552 of file utilities.py.

◆ computePixelAreaFieldDetector()

lsst.fgcmcal.utilities.computePixelAreaFieldDetector ( detector,
visitInfo = None,
areaScaling = 1.0,
approximate = False )
Compute the reference pixel area field for a detector.

Parameters
----------
visitInfo : `lsst.afw.image.VisitInfo`
    The visit info object.
detector : `lsst.afw.cameraGeom.detector`
    The detector object.
visitInfo : `lsst.afw.image.VisitInfo`, optional
    If not supplied, will compute a default visitInfo.
areaScaling : `float`, optional
    Area scaling factor.
approximate : `bool`, optional
    Compute Chebyshev approximation to pixel area field?

Returns
-------
pixelAreaField : `lsst.afw.math.BoundedField`
    Bounded field describing the pixel area from the detector model.

Definition at line 511 of file utilities.py.

◆ computeReferencePixelScale()

lsst.fgcmcal.utilities.computeReferencePixelScale ( camera,
useScienceDetectors = False )
Compute the median pixel scale in the camera

Returns
-------
pixelScale : `float`
    Average pixel scale (arcsecond) over the camera
useScienceDetectors : `bool`, optional
    Limit to just science detectors?

Definition at line 486 of file utilities.py.

◆ countDetectors()

lsst.fgcmcal.utilities.countDetectors ( camera,
useScienceDetectors )
Count the detectors in the camera.

This may be limited to just the science detectors.

Parameters
----------
camera : `lsst.afw.cameraGeom.Camera`
    Camera object.
useScienceDetectors : `bool`, optional
    Limit to just science detectors?

Definition at line 967 of file utilities.py.

◆ extractReferenceMags()

lsst.fgcmcal.utilities.extractReferenceMags ( refStars,
bands,
filterMap )
Extract reference magnitudes from refStars for given bands and
associated filterMap.

Parameters
----------
refStars : `astropy.table.Table` or `lsst.afw.table.BaseCatalog`
    FGCM reference star catalog.
bands : `list`
    List of bands for calibration.
filterMap: `dict`
    FGCM mapping of filter to band.

Returns
-------
refMag : `np.ndarray`
    nstar x nband array of reference magnitudes.
refMagErr : `np.ndarray`
    nstar x nband array of reference magnitude errors.

Definition at line 893 of file utilities.py.

◆ lookupStaticCalibrations()

lsst.fgcmcal.utilities.lookupStaticCalibrations ( datasetType,
registry,
quantumDataId,
collections )

Definition at line 952 of file utilities.py.

◆ makeAtmCat()

lsst.fgcmcal.utilities.makeAtmCat ( atmSchema,
atmStruct )
Make the atmosphere catalog for persistence

Parameters
----------
atmSchema: `lsst.afw.table.Schema`
   Atmosphere catalog schema
atmStruct: `numpy.ndarray`
   Atmosphere structure from fgcm

Returns
-------
atmCat: `lsst.afw.table.BaseCatalog`
   Atmosphere catalog for persistence

Definition at line 753 of file utilities.py.

◆ makeAtmSchema()

lsst.fgcmcal.utilities.makeAtmSchema ( )
Make the atmosphere schema

Returns
-------
atmSchema: `lsst.afw.table.Schema`

Definition at line 729 of file utilities.py.

◆ makeConfigDict()

lsst.fgcmcal.utilities.makeConfigDict ( config,
log,
camera,
maxIter,
resetFitParameters,
outputZeropoints,
lutFilterNames,
tract = None,
nCore = 1,
doPlots = False )
Make the FGCM fit cycle configuration dict

Parameters
----------
config : `lsst.fgcmcal.FgcmFitCycleConfig`
    Configuration object
log : `logging.Logger`
    Log object.
camera : `lsst.afw.cameraGeom.Camera`
    Camera from the butler
maxIter : `int`
    Maximum number of iterations
resetFitParameters: `bool`
    Reset fit parameters before fitting?
outputZeropoints : `bool`
    Compute zeropoints for output?
lutFilterNames : array-like, `str`
    Array of physical filter names in the LUT.
tract : `int`, optional
    Tract number for extending the output file name for debugging.
    Default is None.
nCore : `int`, optional
    Number of cores to use.
doPlots : `bool`, optional
    Make FGCM QA plots?

Returns
-------
configDict : `dict`
    Configuration dictionary for fgcm

Definition at line 48 of file utilities.py.

◆ makeStdCat()

lsst.fgcmcal.utilities.makeStdCat ( stdSchema,
stdStruct,
goodBands )
Make the standard star catalog for persistence

Parameters
----------
stdSchema: `lsst.afw.table.Schema`
   Standard star catalog schema
stdStruct: `numpy.ndarray`
   Standard star structure in FGCM format
goodBands: `list`
   List of good band names used in stdStruct

Returns
-------
stdCat: `lsst.afw.table.BaseCatalog`
   Standard star catalog for persistence

Definition at line 822 of file utilities.py.

◆ makeStdSchema()

lsst.fgcmcal.utilities.makeStdSchema ( nBands)
Make the standard star schema

Parameters
----------
nBands: `int`
   Number of bands in standard star catalog

Returns
-------
stdSchema: `lsst.afw.table.Schema`

Definition at line 786 of file utilities.py.

◆ makeZptCat()

lsst.fgcmcal.utilities.makeZptCat ( zptSchema,
zpStruct )
Make the zeropoint catalog for persistence

Parameters
----------
zptSchema: `lsst.afw.table.Schema`
   Zeropoint catalog schema
zpStruct: `numpy.ndarray`
   Zeropoint structure from fgcm

Returns
-------
zptCat: `afwTable.BaseCatalog`
   Zeropoint catalog for persistence

Definition at line 674 of file utilities.py.

◆ makeZptSchema()

lsst.fgcmcal.utilities.makeZptSchema ( superStarChebyshevSize,
zptChebyshevSize )
Make the zeropoint schema

Parameters
----------
superStarChebyshevSize: `int`
   Length of the superstar chebyshev array
zptChebyshevSize: `int`
   Length of the zeropoint chebyshev array

Returns
-------
zptSchema: `lsst.afw.table.schema`

Definition at line 588 of file utilities.py.

◆ translateFgcmLut()

lsst.fgcmcal.utilities.translateFgcmLut ( lutCat,
physicalFilterMap )
Translate the FGCM look-up-table into an fgcm-compatible object

Parameters
----------
lutCat: `lsst.afw.table.BaseCatalog`
   Catalog describing the FGCM look-up table
physicalFilterMap: `dict`
   Physical filter to band mapping

Returns
-------
fgcmLut: `lsst.fgcm.FgcmLut`
   Lookup table for FGCM
lutIndexVals: `numpy.ndarray`
   Numpy array with LUT index information for FGCM
lutStd: `numpy.ndarray`
   Numpy array with LUT standard throughput values for FGCM

Notes
-----
After running this code, it is wise to `del lutCat` to clear the memory.

Definition at line 277 of file utilities.py.

◆ translateVisitCatalog()

lsst.fgcmcal.utilities.translateVisitCatalog ( visitCat)
Translate the FGCM visit catalog to an fgcm-compatible object

Parameters
----------
visitCat: `lsst.afw.table.BaseCatalog`
   FGCM visitCat from `lsst.fgcmcal.FgcmBuildStarsTask`

Returns
-------
fgcmExpInfo: `numpy.ndarray`
   Numpy array for visit information for FGCM

Notes
-----
After running this code, it is wise to `del visitCat` to clear the memory.

Definition at line 407 of file utilities.py.

Variable Documentation

◆ FGCM_CCD_FIELD

str lsst.fgcmcal.utilities.FGCM_CCD_FIELD = 'DETECTOR'

Definition at line 44 of file utilities.py.

◆ FGCM_EXP_FIELD

str lsst.fgcmcal.utilities.FGCM_EXP_FIELD = 'VISIT'

Definition at line 43 of file utilities.py.

◆ FGCM_ILLEGAL_VALUE

float lsst.fgcmcal.utilities.FGCM_ILLEGAL_VALUE = -9999.0

Definition at line 45 of file utilities.py.