sorcha.modules.PPAddUncertainties
Functions
|
Calculate cosine of an angle in degrees. |
|
Calculate sine of an angle in degrees. |
|
Generates astrometric and photometric uncertainties, and SNR. Uses uncertainties |
|
Add astrometric and photometric uncertainties to observations. |
|
Calculate the astrometric uncertainty, for object catalog purposes. |
|
Calculate the random astrometric uncertainty, as a function of |
Convert flux signal to noise ratio to an uncertainty in magnitude. |
Module Contents
- degCos(x)[source]
Calculate cosine of an angle in degrees.
- Parameters:
x (float) -- angle in degrees.
- Returns:
The cosine of x.
- Return type:
float
- degSin(x)[source]
Calculate sine of an angle in degrees.
- Parameters:
x (float) -- angle in degrees.
- Returns:
The sine of x.
- Return type:
float
- addUncertainties(detDF, sconfigs, module_rngs, verbose=True)[source]
Generates astrometric and photometric uncertainties, and SNR. Uses uncertainties to randomize the photometry. Accounts for trailing losses.
Adds the following columns to the observations dataframe:
astrometricSigma_deg
trailedSourceMagSigma
PSFMagSigma
SNR
trailedSourceMag
PSFMag
- Parameters:
detDF (Pandas dataframe)) -- Dataframe of observations.
sconfigs (dataclass) -- Dataclass of configuration file arguments.
module_rngs (PerModuleRNG) -- A collection of random number generators (per module).
verbose (Boolean, default=True)
Flag. (Verbose Logging)
- Returns:
detDF -- dataframe of observations, with new columns for observed magnitudes, SNR, and astrometric/photometric uncertainties.
- Return type:
Pandas dataframe
- uncertainties(detDF, sconfigs, limMagName='fiveSigmaDepth_mag', seeingName='seeingFwhmGeom_arcsec', filterMagName='trailedSourceMagTrue', dra_name='RARateCosDec_deg_day', ddec_name='DecRate_deg_day', dec_name='Dec_deg', visit_time_name='visitExposureTime')[source]
Add astrometric and photometric uncertainties to observations.
- Parameters:
detDF (Pandas dataframe) -- dataframe containing observations.
sconfigs (dataclass) -- Dataclass of configuration file arguments.
limMagName (string, default="fiveSigmaDepth_mag") -- pandas dataframe column name of the limiting magnitude.
seeingName (string, default="seeingFwhmGeom_arcsec") -- pandas dataframe column name of the seeing
filterMagName (string, default="trailedSourceMagTrue") -- pandas dataframe column name of the object magnitude
dra_name (string, default="RARateCosDec_deg_day") -- pandas dataframe column name of the object RA rate
ddec_name (string, default="DecRate_deg_day") -- pandas dataframe column name of the object declination rate
dec_name (string, default="Dec_deg") -- pandas dataframe column name of the object declination
visit_time_name (string, default="visitExposureTime") -- pandas dataframe column name for exposure length
- Returns:
astrSigDeg (numpy array) -- astrometric uncertainties in degrees.
photometric_sigma (numpy array) -- photometric uncertainties in magnitude.
SNR (numpy array) -- signal-to-noise ratio.
- calcAstrometricUncertainty(mag, m5, nvisit=1, FWHMeff=700.0, error_sys=10.0, astErrCoeff=0.6, output_units='mas')[source]
Calculate the astrometric uncertainty, for object catalog purposes.
- Parameters:
mag (float or array of floats)) -- magnitude of the observation.
m5 (float or array of floats) -- 5-sigma limiting magnitude.
nvisit (int, default=1) -- number of visits to consider.
FWHMeff (float, default=700.0) -- effective Full Width at Half Maximum of Point Spread Function [mas].
error_sys (float, default=10.0) -- systematic error [mas].
astErrCoeff (float, default=0.60) -- Astrometric error coefficient (see calcRandomAstrometricErrorPerCoord description).
output_units (string, default="mas") --
- Default: "mas" (milliarcseconds)
other options: "arcsec" (arcseconds)
- Returns:
astrom_error (float or array of floats)) -- astrometric error.
SNR (float or array of floats)) -- signal to noise ratio.
error_rand (float or array of floats) -- random error.
Notes
The effective FWHMeff MUST BE given in miliarcsec (NOT arcsec!). Systematic error, error_sys, must be given in miliarcsec. The result corresponds to a single-coordinate uncertainty. Note that the total astrometric uncertainty (e.g. relevant when matching two catalogs) will be sqrt(2) times larger. Default values for parameters are based on estimates for LSST.
The astrometric error can be applied to parallax or proper motion (for nvisit>1). If applying to proper motion, should also divide by the # of years of the survey. This is also referenced in the LSST overview paper (arXiv:0805.2366, ls.st/lop)
assumes sqrt(Nvisit) scaling, which is the best-case scenario
calcRandomAstrometricError assumes maxiumm likelihood solution, which is also the best-case scenario
the systematic error, error_sys = 10 mas, corresponds to the design spec from the LSST Science Requirements Document (ls.st/srd)
- calcRandomAstrometricErrorPerCoord(FWHMeff, SNR, AstromErrCoeff=0.6)[source]
Calculate the random astrometric uncertainty, as a function of effective FWHMeff and signal-to-noise ratio SNR and return the astrometric uncertainty in the same units as FWHM.
This error corresponds to a single-coordinate error the total astrometric uncertainty (e.g. relevant when matching two catalogs) will be sqrt(2) times larger.
- Parameters:
FWHMeff (float or array of floats) -- Effective Full Width at Half Maximum of Point Spread Function [mas].
SNR (float or array of floats) -- Signal-to-noise ratio.
AstromErrCoeff (float, default=0.60) -- Astrometric error coefficient (see description below).
- Returns:
RandomAstrometricErrorPerCoord (float or array of floats) -- random astrometric uncertainty per coordinate.
Returns astrometric uncertainty in the same units as FWHMeff.
Notes
The coefficient AstromErrCoeff for Maximum Likelihood solution is given by
AstromErrCoeff = <P^2> / <|dP/dx|^2> * 1/FWHMeff
where P is the point spread function, P(x,y).
For a single-Gaussian PSF, AstromErrCoeff = 0.60 For a double-Gaussian approximation to Kolmogorov seeing, AstromErrCoeff = 0.55; however, given the same core seeing (FWHMgeom) as for a single-Gaussian PSF, the resulting error will be 36% larger because FWHMeff is 1.22 times larger and SNR is 1.22 times smaller, compared to error for single-Gaussian PSF. Although Kolmogorov seeing is a much better approximation of the free atmospheric seeing than single Gaussian seeing, the default value of AstromErrCoeff is set to the more conservative value.
Note also that AstromErrCoeff = 1.0 is often used in practice to empirically account for other error sources.