LSST Applications g07dc498a13+7851b72aa9,g1409bbee79+7851b72aa9,g1a7e361dbc+7851b72aa9,g1fd858c14a+a4e18a0dda,g33399d78f5+a0324bbf49,g35bb328faa+e55fef2c71,g3bd4b5ce2c+8524b1c0c8,g53246c7159+e55fef2c71,g579b87e3d2+a58ba40925,g60b5630c4e+7b4465799a,g78460c75b0+8427c4cc8f,g78619a8342+5517f7db9e,g786e29fd12+307f82e6af,g8534526c7b+8e1c6b434f,g89139ef638+7851b72aa9,g8b49a6ea8e+7b4465799a,g8ffcb69f3d+0065d7bbc8,g9125e01d80+e55fef2c71,g97b8272a79+a8c4cb337e,g989de1cb63+7851b72aa9,g9f33ca652e+747bd1f1f9,gaaedd4e678+7851b72aa9,gabe3b4be73+9c0c3c7524,gb1101e3267+c03a154bbb,gb58c049af0+28045f66fd,gc1fe0db326+7b4465799a,gca43fec769+e55fef2c71,gce7788e931+99adca4f64,gcf25f946ba+a0324bbf49,gd397e13551+18f805d5e0,gd6cbbdb0b4+f6e5445f66,gde0f65d7ad+78b6ec8427,ge278dab8ac+b4c2c8faf7,geab183fbe5+7b4465799a,gecb8035dfe+1f480bec5e,gf58bf46354+e55fef2c71,gf92a8ffd38+e7bc33f3ea,gfe7187db8c+38a2c5c626,w.2025.03
LSST Data Management Base Package
Loading...
Searching...
No Matches
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 1562 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 1571 of file functors.py.

1571 def __init__(self, colFlux, colFluxErr=None, **kwargs):
1572 self.vhypot = np.vectorize(self.hypot)
1573 self.col = colFlux
1574 self.colFluxErr = colFluxErr
1575
1576 self.fluxMag0 = 1./np.power(10, -0.4*self.COADD_ZP)
1577 self.fluxMag0Err = 0.
1578
1579 super().__init__(**kwargs)
1580

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 1582 of file functors.py.

1582 def columns(self):
1583 return [self.col]
1584

◆ dn2flux()

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

Definition at line 1599 of file functors.py.

1599 def dn2flux(self, dn, fluxMag0):
1600 """Convert instrumental flux to nanojanskys."""
1601 return self.AB_FLUX_SCALE * dn / fluxMag0
1602

◆ dn2fluxErr()

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

Definition at line 1610 of file functors.py.

1610 def dn2fluxErr(self, dn, dnErr, fluxMag0, fluxMag0Err):
1611 """Convert instrumental flux error to nanojanskys."""
1612 retVal = self.vhypot(dn * fluxMag0Err, dnErr * fluxMag0)
1613 retVal *= self.AB_FLUX_SCALE / fluxMag0 / fluxMag0
1614 return retVal
1615

◆ dn2mag()

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

Definition at line 1603 of file functors.py.

1603 def dn2mag(self, dn, fluxMag0):
1604 """Convert instrumental flux to AB magnitude."""
1605 with warnings.catch_warnings():
1606 warnings.filterwarnings('ignore', r'invalid value encountered')
1607 warnings.filterwarnings('ignore', r'divide by zero')
1608 return -2.5 * np.log10(dn/fluxMag0)
1609

◆ dn2MagErr()

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

Definition at line 1616 of file functors.py.

1616 def dn2MagErr(self, dn, dnErr, fluxMag0, fluxMag0Err):
1617 """Convert instrumental flux error to AB magnitude error."""
1618 retVal = self.dn2fluxErr(dn, dnErr, fluxMag0, fluxMag0Err) / self.dn2flux(dn, fluxMag0)
1619 return self.FIVE_OVER_2LOG10 * retVal
1620
1621

◆ hypot()

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

Definition at line 1590 of file functors.py.

1590 def hypot(cls, a, b):
1591 """Compute sqrt(a^2 + b^2) without under/overflow."""
1592 if np.abs(a) < np.abs(b):
1593 a, b = b, a
1594 if a == 0.:
1595 return 0.
1596 q = b/a
1597 return np.abs(a) * np.sqrt(1. + q*q)
1598

◆ name()

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

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

Definition at line 1586 of file functors.py.

1586 def name(self):
1587 return f'mag_{self.col}'
1588
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 1565 of file functors.py.

◆ COADD_ZP

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

Definition at line 1569 of file functors.py.

◆ col

lsst.pipe.tasks.functors.Photometry.col

Definition at line 1573 of file functors.py.

◆ colFluxErr

lsst.pipe.tasks.functors.Photometry.colFluxErr

Definition at line 1574 of file functors.py.

◆ FIVE_OVER_2LOG10

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

Definition at line 1567 of file functors.py.

◆ fluxMag0

lsst.pipe.tasks.functors.Photometry.fluxMag0

Definition at line 1576 of file functors.py.

◆ fluxMag0Err

lsst.pipe.tasks.functors.Photometry.fluxMag0Err

Definition at line 1577 of file functors.py.

◆ LOG_AB_FLUX_SCALE

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

Definition at line 1566 of file functors.py.

◆ vhypot

lsst.pipe.tasks.functors.Photometry.vhypot

Definition at line 1572 of file functors.py.


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