LSST Applications g0265f82a02+c6dfa2ddaf,g1162b98a3f+ffe7eabc7e,g2079a07aa2+1b2e822518,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g36da64cc00+ea84795170,g3ddfee87b4+955a963fd8,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+955a963fd8,g591dd9f2cf+bac198a2cb,g5ec818987f+420292cfeb,g858d7b2824+d6c9a0a3b8,g876c692160+aabc49a3c3,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+e6cd765486,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+acd47f83f4,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+12c8382528,gba4ed39666+1ac82b564f,gbb8dafda3b+0574160a1f,gbeb006f7da+dea2fbb49f,gc28159a63d+c6dfa2ddaf,gc86a011abf+d6c9a0a3b8,gcf0d15dbbd+955a963fd8,gdaeeff99f8+1cafcb7cd4,gdc0c513512+d6c9a0a3b8,ge79ae78c31+c6dfa2ddaf,geb67518f79+ba1859f325,gee10cc3b42+90ebb246c7,gf1cff7945b+d6c9a0a3b8,w.2024.13
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
lsst.meas.algorithms.convertRefcatManager.ConvertGaiaManager Class Reference
Inheritance diagram for lsst.meas.algorithms.convertRefcatManager.ConvertGaiaManager:
lsst.meas.algorithms.convertRefcatManager.ConvertRefcatManager

Public Member Functions

 __init__ (self, *args, **kwargs)
 

Public Attributes

 properMotionUnit
 
 parallaxUnit
 
 outputUnit
 

Protected Member Functions

 _getFluxes (self, input)
 
 _setCoordinateCovariance (self, record, row)
 

Detailed Description

Special-case convert manager to deal with Gaia fluxes.

Definition at line 464 of file convertRefcatManager.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.meas.algorithms.convertRefcatManager.ConvertGaiaManager.__init__ ( self,
* args,
** kwargs )

Reimplemented from lsst.meas.algorithms.convertRefcatManager.ConvertRefcatManager.

Definition at line 467 of file convertRefcatManager.py.

467 def __init__(self, *args, **kwargs):
468 super().__init__(*args, **kwargs)
469 self.properMotionUnit = self.config.pm_scale * u.milliarcsecond
470 self.parallaxUnit = self.config.parallax_scale * u.milliarcsecond
471 self.outputUnit = u.radian * u.radian
472

Member Function Documentation

◆ _getFluxes()

lsst.meas.algorithms.convertRefcatManager.ConvertGaiaManager._getFluxes ( self,
inputData )
protected
Compute the flux fields that will go into the output catalog.

Parameters
----------
inputData : `numpy.ndarray`
    The input data to compute fluxes for.

Returns
-------
fluxes : `dict` [`str`, `numpy.ndarray`]
    The values that will go into the flux and fluxErr fields in the
    output catalog.

Reimplemented from lsst.meas.algorithms.convertRefcatManager.ConvertRefcatManager.

Definition at line 473 of file convertRefcatManager.py.

473 def _getFluxes(self, input):
474 result = {}
475
476 def gaiaFluxToFlux(flux, zeroPoint):
477 """Equations 5.19 and 5.30 from the Gaia calibration document define the
478 conversion from Gaia electron/second fluxes to AB magnitudes.
479 https://gea.esac.esa.int/archive/documentation/GDR2/Data_processing/chap_cu5pho/sec_cu5pho_calibr/ssec_cu5pho_calibr_extern.html
480 """
481 result = ((zeroPoint + -2.5 * np.log10(flux))*u.ABmag).to_value(u.nJy)
482 # set 0 instrumental fluxes to 0 (instead of NaN/inf from the math)
483 result[flux == 0] = 0
484 return result
485
486 # Some fluxes are 0, so log10(flux) can give warnings. We handle the
487 # zeros explicitly, so they warnings are irrelevant.
488 with np.errstate(invalid='ignore', divide='ignore'):
489 # The constants below come from table 5.3 in this document;
490 # https://gea.esac.esa.int/archive/documentation/GDR2/Data_processing/chap_cu5pho/sec_cu5pho_calibr/ssec_cu5pho_calibr_extern.html
491 result['phot_g_mean_flux'] = gaiaFluxToFlux(input['phot_g_mean_flux'], 25.7934)
492 result['phot_bp_mean_flux'] = gaiaFluxToFlux(input['phot_bp_mean_flux'], 25.3806)
493 result['phot_rp_mean_flux'] = gaiaFluxToFlux(input['phot_rp_mean_flux'], 25.1161)
494
495 result['phot_g_mean_fluxErr'] = result['phot_g_mean_flux'] / input['phot_g_mean_flux_over_error']
496 result['phot_bp_mean_fluxErr'] = result['phot_bp_mean_flux'] / input['phot_bp_mean_flux_over_error']
497 result['phot_rp_mean_fluxErr'] = result['phot_rp_mean_flux'] / input['phot_rp_mean_flux_over_error']
498
499 return result
500

◆ _setCoordinateCovariance()

lsst.meas.algorithms.convertRefcatManager.ConvertGaiaManager._setCoordinateCovariance ( self,
record,
row )
protected
Set the off-diagonal position covariance in a record of an indexed
catalog.

Convert the Gaia coordinate correlations into covariances.

Parameters
----------
record : `lsst.afw.table.SimpleRecord`
    Row from indexed catalog to modify.
row : structured `numpy.array`
    Row from catalog being converted.

Reimplemented from lsst.meas.algorithms.convertRefcatManager.ConvertRefcatManager.

Definition at line 501 of file convertRefcatManager.py.

501 def _setCoordinateCovariance(self, record, row):
502 """Set the off-diagonal position covariance in a record of an indexed
503 catalog.
504
505 Convert the Gaia coordinate correlations into covariances.
506
507 Parameters
508 ----------
509 record : `lsst.afw.table.SimpleRecord`
510 Row from indexed catalog to modify.
511 row : structured `numpy.array`
512 Row from catalog being converted.
513 """
514 inputParams = ['ra', 'dec', 'parallax', 'pmra', 'pmdec']
515 outputParams = ['coord_ra', 'coord_dec', 'parallax', 'pm_ra', 'pm_dec']
516 # The Gaia standard for naming is to order the parameters as
517 # (coordinates, parallax, proper motion), so they need to be reordered
518 # as (coordinates, proper motion, parallax) to match the order used
519 # in LSST code (i.g. 'coord_parallax_pm_ra_Cov' becomes
520 # 'coord_pm_ra_parallax_Cov').
521 reorder = [0, 1, 4, 2, 3]
522
523 inputUnits = [self.coord_err_unit, self.coord_err_unit, self.parallaxUnit, self.properMotionUnit,
524 self.properMotionUnit]
525
526 for i in range(5):
527 for j in range(i):
528 j_error = row[f'{inputParams[j]}_error'] * inputUnits[j]
529 i_error = row[f'{inputParams[i]}_error'] * inputUnits[i]
530 ij_corr = row[f'{inputParams[j]}_{inputParams[i]}_corr']
531 cov = (i_error * j_error * ij_corr).to_value(self.outputUnit)
532
533 # Switch from order of Gaia parallax and proper motion
534 # parameters to the desired schema:
535 a = (i if (reorder[i] < reorder[j]) else j)
536 b = (j if (reorder[i] < reorder[j]) else i)
537
538 record.set(self.key_map[f'{outputParams[a]}_{outputParams[b]}_Cov'], cov)
539
540

Member Data Documentation

◆ outputUnit

lsst.meas.algorithms.convertRefcatManager.ConvertGaiaManager.outputUnit

Definition at line 471 of file convertRefcatManager.py.

◆ parallaxUnit

lsst.meas.algorithms.convertRefcatManager.ConvertGaiaManager.parallaxUnit

Definition at line 470 of file convertRefcatManager.py.

◆ properMotionUnit

lsst.meas.algorithms.convertRefcatManager.ConvertGaiaManager.properMotionUnit

Definition at line 469 of file convertRefcatManager.py.


The documentation for this class was generated from the following file: