Coverage for python/lsst/sims/alertsim/catalogs/diaSourceCommons.py : 97%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" DiaSourceCommons """
""" Common methods and attributes for all classes which represent diasource. Daughter classes will need to override some methods depending of their variability model """
# DIASource columns as of DPDD from May 6th 2016
""" differences between DPDD and L1 schema N = Ndata """
'diaObjectId', 'ssObjectId', 'parentDiaSourceId', 'midPointTai', 'filterName', 'ra', 'decl', 'ra_decl_Cov', 'x','y', 'x_y_Cov', 'apFlux', 'apFluxErr', 'snr', 'psFlux', 'psRa','psDecl', 'ps_Cov', 'psLnL', 'psChi2', 'psNdata', 'trailFlux', 'trailRa','trailDecl', 'trailLength', 'trailAngle', 'trail_Cov', 'trailLnL', 'trailChi2', 'trailNdata', 'dipMeanFlux', 'dipFluxDiff', 'dipRa','dipDecl', 'dipLength', 'dipAngle', 'dip_Cov', 'dipLnL', 'dipChi2', 'dipNdata', 'totFlux', 'totFluxErr', 'diffFlux', 'diffFluxErr', 'fpBkgd', 'fpBkgdErr', 'ixx', 'iyy', 'ixy', 'i_cov', 'ixxPSF', 'iyyPSF', 'ixyPSF', 'extendedness', 'spuriousness', 'flags',]
# UCD's - Veljko's best guesses. Check this one day please
'meta.id.assoc', 'meta.id.assoc', 'meta.id.parent', 'time.epoch', 'instr.filter', 'pos.eq.ra', 'pos.eq.dec', 'stat.covariance;pos.eq','instr.pixel', 'instr.pixel', 'stat.covariance', 'phot.flux;arith.diff;phot.calib', 'stat.error;phot.flux', 'stat.snr', 'phot.flux;arith.diff', 'pos.eq.ra','pos.eq.dec', 'stat.covariance;pos.eq', 'stat.likelihood;', 'stat.fit.chi2', 'stat.value', 'phot.flux;arith.diff;phot.calib', 'pos.?','pos.?', 'stat.likelihood;stat.max', 'stat.likelihood;stat.max', 'stat.covariance', 'stat.likelihood', 'stat.fit.chi2', 'stat.value', 'stat.likelihood;stat.max', 'stat.likelihood;stat.max', 'pos.?','pos.?', 'stat.likelihood;stat.max', 'stat.likelihood;stat.max', 'stat.covariance', 'stat.likelihood', 'stat.fit.chi2', 'stat.value', 'phot.flux;arith.diff;phot.calib', 'stat.error;phot.flux', 'phot.flux;arith.diff;phot.calib', 'stat.error;phot.flux', 'pos.cmb', 'stat.error;pos.cmb', '', '', '', 'stat.covariance', 'instr.det.psf', 'instr.det.psf', 'instr.det.psf', '', '', 'meta.code']
# Datatypes as stated in DPDD
'uint64', 'uint64', 'double', 'bit[8]', 'double', 'double', 'float[3]', 'float', 'float', 'float[3]', 'float', 'float', 'float', 'float', 'double','double', 'float[6]', 'float', 'float', 'int', 'float', 'double','double', 'float', 'float', 'float[15]', 'float', 'float', 'int', 'float', 'float', 'double','double', 'float', 'float', 'float[15]', 'float', 'float', 'int', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float[6]', 'float', 'float', 'float', 'float', 'float', 'bit[64]']
# Units as stated in DPDD
'various', 'pixels','pixels', 'various', 'nmgy', 'nmgy', '', 'nmgy', 'degrees','degrees', 'various', '', '', '', 'nmgy', 'degrees','degrees', 'arcsec', 'degrees', 'various', '', '', '', 'nmgy', 'nmgy', 'degrees','degrees', 'arcsec', 'degrees', 'various', '', '', '', 'nmgy', 'nmgy', 'nmgy', 'nmgy', 'nmgy/asec^2', 'nmgy/asec^2', 'nmgy asec^2', 'nmgy asec^2', 'nmgy asec^2', 'nmgy^2 asec^4', 'nmgy asec^2', 'nmgy asec^2', 'nmgy asec^2', '', '', 'bit']
# DIASource attributes with randomly assigned values (for the time being)
"VariableStarsDia; write_catalog() does not " "know how to deal with the nested structure " "of the DIASource schema")
# the software representation of the LSST camera
# getters for DIASource attributes which are generated from catsim
def rng(self): """ A random number generator for the catalog. It is seeded by the self._seed parameter. If self._seed is None (default), then rng is seeded from the system clock as per numpy's default. """
""" Return a list of random floats between 0 and 1.0 that is n_obj long.
If n_obj<0, get n_obj from the length of another column in the catalog """
""" Return a 2-D array of random floats between 0 and 1.0. The array will be n_rows by n_cols. If one of the dimensin is less than 0, it will be set to the number of rows in the catalog. """ n_rows = len(self.column_by_name('chipNum'))
return np.array([])
""" Return a list of n_obj random integers between zero and i_max (inclusive)
If n_obj<0, get n_obj from the length of another column in the catalog """
""" Return mid point of exposure """
def get_chipNum(self): """ Concatenate the digits in 'R:i,j S:m,n' to make the chip number ijmn """
""" Concatenate ObsHistID and chipNum """ self.column_by_name('chipNum'))
""" A unique identifier for each DIASource (this needs to be unique for each apparition of a given object)
!!! Due to the limit of numpy.int64, uniqueId*10^7 is too large, !!! resulting in a minus value of diaSourceId. For now, this method !!! will return uniqueId only, which will be transformed to scalar !!! later and multiplied by 10^7 for the purpose of adding obsHistId """ #return dia_trans.diaSourceId(self.column_by_name('uniqueId'), # self.obs_metadata.OpsimMetaData['obsHistID'])
""" raICRS takes raJ2000 and add proper motion """
""" decICRS take decJ2000 and add proper motion """
# DIASource attributes in a form of a list # with randomly assigned values (for the time being)
def get_totMag(self): """ The total magnitude of the variable source (mean + delta) """
def get_meanMag(self): """ The mean magnitude of the variable source """
def get_totFlux(self): """ The total flux of the variable source """
def get_meanFlux(self): """ The mean (quiescent) flux of the variable source """
def get_diaFlux(self): """ Getter for true flux of the source. Note: this is the flux of the difference image: so it is observed flux-mean flux """
def get_magUncertainties(self): [self.obs_metadata.bandpass]*2, 'lsstBandpassDict')
def get_fluxError(self): """ The error in our measurement of the difference image flux. """ mean_flux, tot_flux)
def get_snr(self): """ Get the SNR """ self.column_by_name('diaFluxError'))
""" Return the true difference image flux plus a small epsilon, since CatSim does not have methods to calculate different varieties of flux """ 0.0001*self.randomFloats(-1)
""" Return the true difference image flux plus a small epsilon, since CatSim does not have methods to calculate different varieties of flux """ 0.0001*self.randomFloats(-1)
""" apMeanSb01 will be the true flux of the source. """
""" Calculate the true flux error by getting the magntidue error and assuming that magnitude_error = 2.5*log10(1 + 1/SNR) """
""" Just return raICRS with a small epsilon added, since CatSim does not have methods to calculate psf RA """
""" Just return decICRS with a small epsilon added, since CatSim does not have methods to calculate psf DEC """
'psFlux_psRa_Cov', 'psFlux_psDecl_Cov', 'psRa_psDecl_Cov']
""" Just return raICRS with a small epsilon added, since CatSim does not have methods to calculate psf RA """
""" Just return decICRS with a small epsilon added, since CatSim does not have methods to calculate psf DEC """
'trailLengthSigma', 'trailAngleSigma', 'trailFlux_trailRa_Cov', 'trailFlux_trailDecl_Cov', 'trailFlux_trailLength_Cov', 'trailFlux_trailAngle_Cov', 'trailRa_trailDecl_Cov', 'trailRa_trailLength_Cov', 'trailRa_trailAngle_Cov', 'trailDecl_trailLength_Cov', 'trailDecl_trailAngle_Cov', 'trailLength_trailAngle_Cov']
""" Just return raICRS with a small epsilon added, since CatSim does not have methods to calculate psf RA """
""" Just return decICRS with a small epsilon added, since CatSim does not have methods to calculate psf DEC """
'dipDeclSigma', 'dipLengthSigma', 'dipAngleSigma', 'dipMeanFlux_dipFluxDiff_Cov', 'dipMeanFlux_dipRa_Cov', 'dipMeanFlux_dipDecl_Cov', 'dipMeanFlux_dipLength_Cov', 'dipMeanFlux_dipAngle_Cov', 'dipFluxDiff_dipRa_Cov', 'dipFluxDiff_dipDecl_Cov', 'dipFluxDiff_dipLength_Cov', 'dipFluxDiff_dipAngle_Cov', 'dipRa_dipDecl_Cov', 'dipRa_dipLength_Cov', 'dipRa_dipAngle_Cov', 'dipDecl_dipLength_Cov', 'dipDecl_dipAngle_Cov', 'dipLength_dipAngle_Cov']
"ixx_iyy_Cov", "ixx_ixy_Cov", "iyy_ixy_Cov"] |