LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
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: