CpEfdClient#
- class lsst.cp.pipe.CpEfdClient(efdInstance='usdf_efd', dieOnSearch=False, log=None)#
Bases:
objectAn EFD client to retrieve calibration results.
Parameters#
- efdInstance
str, optional EFD instance name to connect to.
- log
logging.Logger, optional Log to write messages to.
Methods Summary
Check the connection to the EFD.
getEfdElectrometerData([dataSeries, ...])Retrieve Electrometer data from the EFD.
getEfdMonochromatorData([dataSeries, ...])Retrieve Monochromator data from the EFD.
getSchemaDtype(topicName)Get datatypes for a topic.
parseElectrometerStatus(data, dateStr[, ...])Determine electrometer status for a specific date.
parseMonochromatorStatus(data, dateStr)Determine monochromator status for a specific date.
query(query)Execute an EFD query.
rewriteElectrometerStatus(inResults)Rewrite intermediate electrometer data extracted from the EFD logEvents.
searchResults(data, dateStr)Find the row entry in
dataimmediately preceding the specified date.selectTimeSeries(topicName[, fields, ...])Query a topic for a time series.
Methods Documentation
- checkConnection()#
Check the connection to the EFD.
Raises#
- RuntimeError :
Raised if the connection check fails.
- getEfdElectrometerData(dataSeries=None, dateMin=None, dateMax=None)#
Retrieve Electrometer data from the EFD.
Parameters#
- dataSeries
str, optional Data series to request from the EFD.
- dateMin
str, optional Minimum date (in TAI) to retrieve from EFD.
- dateMax
str, optional Maximum date (in TAI) to retrieve from EFD.
Returns#
- results
astropy.table.Table The table of results returned from the EFD.
- dataSeries
- getEfdMonochromatorData(dataSeries=None, dateMin=None, dateMax=None)#
Retrieve Monochromator data from the EFD.
Parameters#
- dataSeries
str, optional Data series to request from the EFD.
- dateMin
str, optional Minimum date (in TAI) to retrieve from EFD.
- dateMax
str, optional Maximum date (in TAI) to retrieve from EFD.
Returns#
- results
astropy.table.Table The table of results returned from the EFD.
- dataSeries
- getSchemaDtype(topicName)#
Get datatypes for a topic.
Parameters#
- topicName
str Topic to get datatypes for
Returns#
- datatypes
list[tuple[str,str]] List of tuples of field names and data types.
- topicName
- parseElectrometerStatus(data, dateStr, dateEnd=None, doIntegrateSamples=False, index=201)#
Determine electrometer status for a specific date.
Parameters#
- data
astropy.table.Table The dataframe of electrometer results from the EFD.
- dateStr
str The date (in TAI) to look up in the status for.
- dateEnd
str The end date (in TAI) to look in the status for.
- doIntegrateSamples:
bool If true, take the average of all samples between
dateStranddateEnd.- index
int The salIndex of the device we want to read. For LATISS, this should be 201. For the main telescope, 101.
Returns#
- indexDate
str Date string (in TAI) indicating the electrometer state change.
- intensity:
float Average electrometer intensity.
- data
- parseMonochromatorStatus(data, dateStr)#
Determine monochromator status for a specific date.
Parameters#
- data
astropy.table.Table The dataframe of monochromator results from the EFD.
- dateStr
str The date (in TAI) to look up in the status for.
Returns#
- indexDate
str Date string (in TAI) indicating the monochromator state change.
- wavelength
float Monochromator commanded peak.
- data
- query(query)#
Execute an EFD query.
Parameters#
- query
str Query to run.
Returns#
- results
dict Dictionary of results returned.
Raises#
- RuntimeError :
Raised if the the database could not be read from.
- query
- rewriteElectrometerStatus(inResults)#
Rewrite intermediate electrometer data extracted from the EFD logEvents.
Parameters#
- inResults
astropy.table.Table The table of results returned from the EFD.
Returns#
- outResults
astropy.table.Table The rewritten table containing only electrometer summary status events.
- inResults
- searchResults(data, dateStr)#
Find the row entry in
dataimmediately preceding the specified date.Parameters#
- data
astropy.table.Table The table of results from the EFD.
- dateStr
str The date (in TAI) to look up in the status for.
Returns#
- result =
astropy.table.Row The row of the data table corresponding to
dateStr.
- data
- selectTimeSeries(topicName, fields=[], startDate=None, endDate=None)#
Query a topic for a time series.
Parameters#
- topicName
str Database “topic” to query.
- fields
list, optional List of fields to return. If empty, all fields are returned.
- startDate
astropy.time.Time, optional Start date to limit the results returned.
- endDate
astropy.time.Time, optional End date to limit the results returned.
Returns#
- table
astropy.table.Table A table containing the fields requested, with each row corresponding to one date (available in the
"time"column).
- topicName
- efdInstance