LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+bd2ed33bd6,g1470d8bcf6+c6d6eb38e2,g14a832a312+9d12ad093c,g2079a07aa2+86d27d4dc4,g2305ad1205+91a32aca49,g295015adf3+88246b6574,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+c34e8be1fa,g487adcacf7+85dcfbcc36,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ea1711114f,g5a732f18d5+53520f316c,g64a986408d+bd2ed33bd6,g858d7b2824+bd2ed33bd6,g8a8a8dda67+585e252eca,g99cad8db69+016a06b37a,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+ef4e3a5875,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+b6d7b42999,gc120e1dc64+f745648b3a,gc28159a63d+0e5473021a,gcf0d15dbbd+c34e8be1fa,gdaeeff99f8+f9a426f77a,ge6526c86ff+508d0e0a30,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+8d59551888,gf1cff7945b+bd2ed33bd6,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pipe.tasks.functors.Photometry Class Reference
Inheritance diagram for lsst.pipe.tasks.functors.Photometry:
lsst.pipe.tasks.functors.Functor lsst.pipe.tasks.functors.NanoJansky lsst.pipe.tasks.functors.NanoJanskyErr

Public Member Functions

 __init__ (self, colFlux, colFluxErr=None, **kwargs)
 
 columns (self)
 
 name (self)
 
 hypot (cls, a, b)
 
 dn2flux (self, dn, fluxMag0)
 
 dn2mag (self, dn, fluxMag0)
 
 dn2fluxErr (self, dn, dnErr, fluxMag0, fluxMag0Err)
 
 dn2MagErr (self, dn, dnErr, fluxMag0, fluxMag0Err)
 

Public Attributes

 vhypot
 
 col
 
 colFluxErr
 
 fluxMag0
 
 fluxMag0Err
 

Static Public Attributes

tuple AB_FLUX_SCALE = (0 * u.ABmag).to_value(u.nJy)
 
float LOG_AB_FLUX_SCALE = 12.56
 
float FIVE_OVER_2LOG10 = 1.085736204758129569
 
int COADD_ZP = 27
 

Detailed Description

Base class for Object table calibrated fluxes and magnitudes.

Definition at line 1447 of file functors.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.pipe.tasks.functors.Photometry.__init__ ( self,
colFlux,
colFluxErr = None,
** kwargs )

Reimplemented from lsst.pipe.tasks.functors.Functor.

Definition at line 1456 of file functors.py.

1456 def __init__(self, colFlux, colFluxErr=None, **kwargs):
1457 self.vhypot = np.vectorize(self.hypot)
1458 self.col = colFlux
1459 self.colFluxErr = colFluxErr
1460
1461 self.fluxMag0 = 1./np.power(10, -0.4*self.COADD_ZP)
1462 self.fluxMag0Err = 0.
1463
1464 super().__init__(**kwargs)
1465

Member Function Documentation

◆ columns()

lsst.pipe.tasks.functors.Photometry.columns ( self)
Columns required to perform calculation.

Reimplemented from lsst.pipe.tasks.functors.Functor.

Reimplemented in lsst.pipe.tasks.functors.NanoJanskyErr.

Definition at line 1467 of file functors.py.

1467 def columns(self):
1468 return [self.col]
1469

◆ dn2flux()

lsst.pipe.tasks.functors.Photometry.dn2flux ( self,
dn,
fluxMag0 )
Convert instrumental flux to nanojanskys.

Definition at line 1484 of file functors.py.

1484 def dn2flux(self, dn, fluxMag0):
1485 """Convert instrumental flux to nanojanskys."""
1486 return self.AB_FLUX_SCALE * dn / fluxMag0
1487

◆ dn2fluxErr()

lsst.pipe.tasks.functors.Photometry.dn2fluxErr ( self,
dn,
dnErr,
fluxMag0,
fluxMag0Err )
Convert instrumental flux error to nanojanskys.

Definition at line 1495 of file functors.py.

1495 def dn2fluxErr(self, dn, dnErr, fluxMag0, fluxMag0Err):
1496 """Convert instrumental flux error to nanojanskys."""
1497 retVal = self.vhypot(dn * fluxMag0Err, dnErr * fluxMag0)
1498 retVal *= self.AB_FLUX_SCALE / fluxMag0 / fluxMag0
1499 return retVal
1500

◆ dn2mag()

lsst.pipe.tasks.functors.Photometry.dn2mag ( self,
dn,
fluxMag0 )
Convert instrumental flux to AB magnitude.

Definition at line 1488 of file functors.py.

1488 def dn2mag(self, dn, fluxMag0):
1489 """Convert instrumental flux to AB magnitude."""
1490 with warnings.catch_warnings():
1491 warnings.filterwarnings('ignore', r'invalid value encountered')
1492 warnings.filterwarnings('ignore', r'divide by zero')
1493 return -2.5 * np.log10(dn/fluxMag0)
1494

◆ dn2MagErr()

lsst.pipe.tasks.functors.Photometry.dn2MagErr ( self,
dn,
dnErr,
fluxMag0,
fluxMag0Err )
Convert instrumental flux error to AB magnitude error.

Definition at line 1501 of file functors.py.

1501 def dn2MagErr(self, dn, dnErr, fluxMag0, fluxMag0Err):
1502 """Convert instrumental flux error to AB magnitude error."""
1503 retVal = self.dn2fluxErr(dn, dnErr, fluxMag0, fluxMag0Err) / self.dn2flux(dn, fluxMag0)
1504 return self.FIVE_OVER_2LOG10 * retVal
1505
1506

◆ hypot()

lsst.pipe.tasks.functors.Photometry.hypot ( cls,
a,
b )
Compute sqrt(a^2 + b^2) without under/overflow.

Definition at line 1475 of file functors.py.

1475 def hypot(cls, a, b):
1476 """Compute sqrt(a^2 + b^2) without under/overflow."""
1477 if np.abs(a) < np.abs(b):
1478 a, b = b, a
1479 if a == 0.:
1480 return 0.
1481 q = b/a
1482 return np.abs(a) * np.sqrt(1. + q*q)
1483

◆ name()

lsst.pipe.tasks.functors.Photometry.name ( self)

Reimplemented from lsst.pipe.tasks.functors.Functor.

Definition at line 1471 of file functors.py.

1471 def name(self):
1472 return f'mag_{self.col}'
1473
table::Key< std::string > name
Definition Amplifier.cc:116

Member Data Documentation

◆ AB_FLUX_SCALE

tuple lsst.pipe.tasks.functors.Photometry.AB_FLUX_SCALE = (0 * u.ABmag).to_value(u.nJy)
static

Definition at line 1450 of file functors.py.

◆ COADD_ZP

int lsst.pipe.tasks.functors.Photometry.COADD_ZP = 27
static

Definition at line 1454 of file functors.py.

◆ col

lsst.pipe.tasks.functors.Photometry.col

Definition at line 1458 of file functors.py.

◆ colFluxErr

lsst.pipe.tasks.functors.Photometry.colFluxErr

Definition at line 1459 of file functors.py.

◆ FIVE_OVER_2LOG10

float lsst.pipe.tasks.functors.Photometry.FIVE_OVER_2LOG10 = 1.085736204758129569
static

Definition at line 1452 of file functors.py.

◆ fluxMag0

lsst.pipe.tasks.functors.Photometry.fluxMag0

Definition at line 1461 of file functors.py.

◆ fluxMag0Err

lsst.pipe.tasks.functors.Photometry.fluxMag0Err

Definition at line 1462 of file functors.py.

◆ LOG_AB_FLUX_SCALE

float lsst.pipe.tasks.functors.Photometry.LOG_AB_FLUX_SCALE = 12.56
static

Definition at line 1451 of file functors.py.

◆ vhypot

lsst.pipe.tasks.functors.Photometry.vhypot

Definition at line 1457 of file functors.py.


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