Package wsatools :: Module WfcamsrcInterface
[hide private]

Module WfcamsrcInterface

source code

Wrapper functions to call the wfcamsrc C++ external programs. For ingest of catalogue & image metadata, as well as source merging.


Author: I.A. Bond

Organization: WFAU, IfA, University of Edinburgh

Contributors: R.S. Collins, N.C. Hambly, E. Sutorius

Functions [hide private]
list(str), int
extractMetadata(tableListPath, fileListPath, cuEventID, ingestDirPath, filePrefix, logPath, sysc=SystemConstants("WSA"))
Wrapper function to run the external program that extracts image metadata from FITS headers and prepares a CSV file for ingestion.
source code
list(str), int
extractDetections(tableListPath, fileListPath, cuEventID, ingestDirPath, filePrefix, illumName, outTables, nextObjID, sysc=SystemConstants("WSA"))
Wrapper function to run the external program that extracts detection catalog data from FITS tables into a binary ingest file.
source code
 
mergeDetections(mergeTablePathName, resultsPathName, sourceTableName, schemaFile, cameoSchemas, epochs, pixScales, cuEventID, firstID, frameSetID, extractor='CASU', frameSetIDName='frameSetID', sourceIDName='sourceID', centralPos=None, minEpochSep=None)
Wrapper function to mkmerge.
source code
list(str), int
parseOutput(stdOut)
Parses the CU3 and 4 stdout to determine the result of the data extraction.
source code
Variables [hide private]
  __package__ = 'wsatools'
Function Details [hide private]

extractMetadata(tableListPath, fileListPath, cuEventID, ingestDirPath, filePrefix, logPath, sysc=SystemConstants("WSA"))

source code 

Wrapper function to run the external program that extracts image metadata from FITS headers and prepares a CSV file for ingestion.

Parameters:
  • tableListPath (str) - Full path to the file with a list of tables for data to be ingested into, and their schema file name.
  • fileListPath (str) - Full path to the file with list of FITS files to extract the metadata from.
  • cuEventID (int) - Curation event ID.
  • ingestDirPath (str) - Path where the CSV ingest file is to be written.
  • filePrefix (str) - Common prefix for ingest files.
  • logPath (str) - Full path to the log file for this curation event.
  • sysc (SystemConstants) - Initialised SystemConstants object.
Returns: list(str), int
List of files where metadata could not be extracted and an int if no NaNs detected, otherwise None.

extractDetections(tableListPath, fileListPath, cuEventID, ingestDirPath, filePrefix, illumName, outTables, nextObjID, sysc=SystemConstants("WSA"))

source code 

Wrapper function to run the external program that extracts detection catalog data from FITS tables into a binary ingest file.

Parameters:
  • tableListPath (str) - Full path to the file with a list of tables for data to be ingested into, and their schema file name.
  • fileListPath (str) - Full path to the file with list of FITS catalogue files to extract the detections from.
  • cuEventID (int) - Curation event ID.
  • ingestDirPath (str) - Path where the binary ingest file is to be written.
  • filePrefix (str) - Common prefix for ingest files.
  • illumName (str) - The illumination table file used for this data.
  • outTables (str) - Comma separated list of tables to process.
  • nextObjID (int) - Next objectID for this programme, counting negative from -1 onwards.
  • sysc (SystemConstants) - Initialised SystemConstants object.
Returns: list(str), int
List of files where catalogues could not be extracted and the last object ID.

mergeDetections(mergeTablePathName, resultsPathName, sourceTableName, schemaFile, cameoSchemas, epochs, pixScales, cuEventID, firstID, frameSetID, extractor='CASU', frameSetIDName='frameSetID', sourceIDName='sourceID', centralPos=None, minEpochSep=None)

source code 

Wrapper function to mkmerge. The C++ program that merges detections into a source table stored in a binary file for ingest into the database.

Parameters:
  • mergeTablePathName (str) - Name of the "merge table" pointers file created by the "pairing" C code.
  • resultsPathName (str) - Full path to output binary file containing the accumulated merged sources.
  • sourceTableName (str) - Name of source table where results are ingest.
  • schemaFile (str) - Name of .sql script file describing the schema for this programme.
  • cameoSchemas (list(str)) - A list of cameo schema files for each passband. Ordered by filterID.
  • epochs (list(float)) - A list of epochs for each passband's frame. The passband order should be identical to that of the cameoSchemas.
  • pixScales (list(float)) - A list of pixel scales for each passband's frame. The passband order should be identical to that of the cameoSchemas.
  • cuEventID (int) - Curation use case event ID.
  • firstID (int) - The UID to assign to the first new source.
  • frameSetID (int) - The unique identifier of the frame set.
  • extractor (str) - Name of source catalogue extraction tool used to create these detections (same format as extractTool parameter in RequiredStack table).
  • frameSetIDName (str) - Name of the column in the source table that identifies the unique ID of the frame set for the source.
  • sourceIDName (str) - Name of the column in the source table for the unique source ID.
  • centralPos (tuple(float, float)) - If proper motion is to be calculated need frame set centre co-ordinates.
  • minEpochSep (float) - If proper motion is to be calculated need to know what the minimum epoch separation criterion is in days.

parseOutput(stdOut)

source code 

Parses the CU3 and 4 stdout to determine the result of the data extraction.

Parameters:
  • stdOut (list(str)) - Standard output.
Returns: list(str), int
List of files where data could not be extracted and the last detection object ID or, for metadata extraction, None if NaNs.