Package helpers :: Module EsoRelease :: Class EsoRelease
[hide private]

Class EsoRelease

source code


Creates the ESO-SAF release FITS files for the given programme.

Nested Classes [hide private]
  ImageField
Named tuple
    Nested Errors and Exceptions

Inherited from wsatools.DbConnect.CuSession.CuSession: CuError

Instance Methods [hide private]
 
_onRun(self)
Prepares each product in turn required by the ESO-SAF for the current programme.
source code
 
setUpApdList(self) source code
 
setTileObjDictNonRegions(self) source code
 
setPrimaryHeaderPosition(self, tiles)
Produces dictionary of primary header positions.
source code
 
getTilePosDict(self, tiles)
Dictionary of tile ra/dec positions
source code
 
getTilePawPrintDict(self)
Dictionary of tiles for each pawprint in releaseDB
source code
 
getArcFileOBDict(self)
Dictionary of arcFiles for each OB frame
source code
 
getMagLimSatDict(self) source code
 
areExternalCats(self)
Are there external catalogues?
source code
 
copyDeepTiles(self, tiles)
Copy WFAU-produced deep tile image and confidence map FITS files to the ESO-SAF transfer staging area.
source code
 
copyJpegFiles(self, jpegFiles, field)
Copies the given list of JPEG files to the ESO release staging area.
source code
list(tuple(str, PyValue, str))
jpegCards(self, jpegFile, asNum)
Returns: A list of FITS header card details for the given JPEG file.
source code
 
getProgIDListDict(self, tiles)
For each product, get a list of PROG_IDs from inputs
source code
 
modHeaders(self, field, filePath, jpegFiles, jpegFilesConf)
Modifies headers of the given WFAU-produced FITS file to meet the ESO-SAF specifications.
source code
 
outgestCatalogues(self, deepTiles)
Outgest FITS files from detection table for each deep tile.
source code
 
modifyToAB(self, selectStr, vegaToAB, filters=None) source code
 
outgestCatalogueFile(self, filePath, columns, query, deepTile)
Outgests a single ESO catalogue file product.
source code
 
queryFitsTable(self, columns, sql, tableType='NONE')
Outgest catalogue data corresponding to given field.
source code
 
problemColumnCheck(self, da, column, problemDataColumns)
Checks whether column is a problem column and replaces dodgy defaults with correct values
source code
 
getNearestFilter(self, filterName, possibleFilters) source code
 
outgestSources(self, isSourceList=False)
Outgest FITS files from source table for each frame set.
source code
 
addBand(self, cType, band)
Adds filter name to name and alias
source code
 
updateAliasedColName(self, columns, aliasesDict)
If a column is aliased in the select str, change the column name
source code
 
appendMagLims2(self, frameSetID, mergeLog, mfIDList)
Append magnitude limits to self.magLim
source code
 
appendMagLims(self, filePath)
Append magnitude limits to self.magLim
source code
 
updateDirDict(self, filePath)
Updates directory dict if need be
source code
 
getRegion(self, frameSetID=None, raDec=None, useFrameSetID=True)
Select info from Multiframe
source code
 
getIAUNameColSel(self, alias, radp=None, decdp=None, ucdTag='meta.id')
Returns the IAU Name column and selectStr
source code
 
getFieldInfo(self, field, frameInfo, filters)
returns a new namedtuple
source code
 
getInfoForPIs(self, filePath, columns) source code
 
outgestSourceFile(self, filePath, columns, query, field, bandList, tableType='NONE')
Outgests a single ESO source catalogue file product.
source code
 
updateHeaders(self, tableType, field, primary, fitsTable, bandList) source code
 
updateMergedBandHeaders(self, tableType, field, primary, fitsTable, bandList) source code
 
updateMPhotHeaders(self, tableType, field, primary, fitsTable, bandList) source code
 
updateVarCatHeaders(self, tableType, field, primary, fitsTable, bandList) source code
 
addCatalogueLinks(self, hdu, columns, field)
Adds links between current catalogue and main src catalogue.
source code
 
checkEsoRelease(self, curEsoInfo) source code
 
outgestMultiEpoch(self) source code
 
outgestVariables(self) source code
 
isExternalMainTable(self, externCat) source code
 
outgestExternalCats(self) source code
 
findFiltersUsed(self, extTable)
Uses UCD information to find filters used
source code
 
getExternalColumns(self, fields) source code
 
findField(self, fields, pointing) source code
 
getExternalCatLocation(self) source code
 
getQueryLists(self, query) source code
 
convertSelStr(self, vdfsSelStr, extFromStr, columns) source code
 
convertExternalCats(self, columns, field, tableType, query) source code
 
createTableHdu(self, columns, tableType, dataNum) source code
 
getNulls(self, columns) source code
 
getDescriptions(self, columns) source code
 
findVSAMatch(self, queryString, field) source code
 
addKey(self, hdu, column, value, passband=None)
Adds a key card to the FITS header properly formatted.
source code
 
addCard(self, header, keyword, value, desc) source code
 
addPbMetadata(self, hdu, passband, table, mfID, extNum=None)
Adds FITS file metadata from contents of given table for the current passband and row.
source code
 
addPrimaryFrameKeys(self, hdu, frame)
Adds keys to given FITS header from just this frame.
source code
 
addStandardKeys(self, header, tableHdr, imageDetails, bandList, tableType='NONE', field=None)
Add standard, fixed, ESO keys to the given FITS headers.
source code
 
getAdpName(self, fName) source code
 
calcPointArea(self, imageDetails)
Calculates the area of the pointing mosaic.
source code
str
getStdShortDesc(self, value, description)
Returns: Abbreviated version of given description depending upon the length of the value, for the case of standard FITS header keywords.
source code
list(Query)
queryFileProducts(self, mfIDs=None, fileName=None, isPawPrint=False, fieldID=None)
Returns: By default a list of image details, including file paths, to WFAU-produced deep tiles for the current programme.
source code
list(tuple(int, str))
queryJpegFiles(self, field, isConf=False)
Returns: List of jpeg files associated with this field.
source code
Generator(tuple(str, PyValue))
queryMetadata(self, table, where, esoOnly=False, allRows=False)
Returns: A generator of pairs, column name, value, for the given row of the given table.
source code
 
setRegions(self) source code
TilePosition
calcTilePos(self, mfID, isPawPrint=False)
Returns: Tile position information for given multiframeID when ESO information is missing.
source code
float
getSatLimit(self, mfID, extNum)
Returns: Saturation limit for given detector.
source code
float
getAbMagLim(self, mfID, extNum)
Returns: AB magnitude limit for given detector.
source code
 
checkifExternal(self) source code
 
checkifExternalVarTables(self) source code
 
updateDatabase(self)
Update VSA to keep a record of what we are doing.
source code

Inherited from wsatools.DbConnect.CuSession.CuSession: __del__, __init__, logBrokenFile, run

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from wsatools.DbConnect.CuSession.CuSession: logException

Class Variables [hide private]
  radp = 2
Number of decimal places in ra
  decdp = 2
Number of decimal places in dec
  cuNum = 30
Curation Unit number
  imageFields = 'fileName, Multiframe.multiframeID AS fileID, ra...
Fields to query for deep tile image details.
  refForProg = defaultdict(<function <lambda> at 0x4e83b18>, {'V...
Bibliographic references for each programme.
  reservedKeys = ['BITPIX', 'NAXIS', 'XTENSION', 'DATE', 'PCOUNT...
These FITS header keywords should not be messed with.
  regionDict = {}
Dictionary of regions
  sqlToFitsDataType = {'bigint': 'K', 'float': 'D', 'int': 'J', ...
Translation for SQL type to PyFITS type.
  prodBits = {0: 'Processing deep images', 1: 'Processing first ...
  currentRowNumber = None
hash(x)
  numberRows = 0
  piOnly = False
Create PI info only
  isQuickRun = False
Just a test run for the FITS headers?
  releaseNum = 1
ESO release number.
  fieldIDs = None
List of fields to release (if None, release all)
  fileName = None
FileName to derive fieldID list from
  addExtProv = False
Add in external provenance
  copyJpegsPaws = False
Copy JEGS for pawprints
  skipDeepData = False
Skip deep data
  esoProductTypes = 1
Eso product types: deeps 1, deeps + srclists 2,
  releaseDBName = 'NONE'
Static release DB that release is done from
  completeFilters = False
Only framesets with complete set of filters
  istTrialRun = False
hash(x)
  newBits = set([])
  directoryDict = {}
  regionInfo = None
hash(x)
  delKeysDict = defaultdict(<type 'list'>, {})
  skipFieldList = []
  skipSources = False
hash(x)
  tileObjectDict = {}
  isCutOut = False
hash(x)
  mPhotFilesDict = defaultdict(<type 'list'>, {})
  hasNeighTable = False
hash(x)
  missingAdpFiles = False
hash(x)
  reference = None
hash(x)
  noExternNeigh = False
hash(x)
  bandUcdDict = {}
  ucdBandDict = {}
  _autoCommit = True
Should this curation task auto-commit database transactions?
  _fileDir = ''
Common directory path for the ESO product files.
  _metaSchema = ''
Dictionary of metadata table schema by name.
  _newNameOfFile = None
Dictionary of ESO-style file names of images referenced by their original archive names.
  _progSchema = ''
Dictionary of programme table schema by name.
  ii = 255

Inherited from wsatools.DbConnect.CuSession.CuSession: archive, comment, cuEventID, curator, eTypes, isDayStampedLog, onlyNonSurveys, onlySurveys, programme, programmeID, resultsFilePathName, shareFileID, sysc

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_onRun(self)

source code 

Prepares each product in turn required by the ESO-SAF for the current programme.

Overrides: wsatools.DbConnect.CuSession.CuSession._onRun

getTilePosDict(self, tiles)

source code 

Dictionary of tile ra/dec positions

To Do: Position angle?

copyDeepTiles(self, tiles)

source code 

Copy WFAU-produced deep tile image and confidence map FITS files to the ESO-SAF transfer staging area. Modifying headers to meet the ESO-SAF specifications.

jpegCards(self, jpegFile, asNum)

source code 
Returns: list(tuple(str, PyValue, str))
A list of FITS header card details for the given JPEG file.

getProgIDListDict(self, tiles)

source code 

For each product, get a list of PROG_IDs from inputs

MultiframeEsokeys.obsProgID

outgestSources(self, isSourceList=False)

source code 

Outgest FITS files from source table for each frame set.

To Do: (priOrSec = 0 || priOrSec=frameSetID) as primary_source VVV - simpler for DR2? Be careful. Just primary sources selected?

addStandardKeys(self, header, tableHdr, imageDetails, bandList, tableType='NONE', field=None)

source code 

Add standard, fixed, ESO keys to the given FITS headers. This should be done last to override any existing values.

getStdShortDesc(self, value, description)

source code 
Returns: str
Abbreviated version of given description depending upon the length of the value, for the case of standard FITS header keywords.

queryFileProducts(self, mfIDs=None, fileName=None, isPawPrint=False, fieldID=None)

source code 
Returns: list(Query)
By default a list of image details, including file paths, to WFAU-produced deep tiles for the current programme. If mfIDs are supplied then it returns image details for the given mfIDs which could be of any frameType.

queryJpegFiles(self, field, isConf=False)

source code 
Returns: list(tuple(int, str))
List of jpeg files associated with this field.

queryMetadata(self, table, where, esoOnly=False, allRows=False)

source code 
Returns: Generator(tuple(str, PyValue))
A generator of pairs, column name, value, for the given row of the given table.

calcTilePos(self, mfID, isPawPrint=False)

source code 
Returns: TilePosition
Tile position information for given multiframeID when ESO information is missing.

getSatLimit(self, mfID, extNum)

source code 
Returns: float
Saturation limit for given detector.

getAbMagLim(self, mfID, extNum)

source code 
Returns: float
AB magnitude limit for given detector.

Class Variable Details [hide private]

imageFields

Fields to query for deep tile image details.

Value:
'fileName, Multiframe.multiframeID AS fileID, raBase as ra, decBase as\
 dec, filterName, frameType, confID'

refForProg

Bibliographic references for each programme.

Value:
defaultdict(<function <lambda> at 0x4e83b18>, {'VIDEO': '2013MNRAS.428\
.1281J', 'VMC': '2011A&A...527A.116C'})

reservedKeys

These FITS header keywords should not be messed with.

Value:
['BITPIX',
 'NAXIS',
 'XTENSION',
 'DATE',
 'PCOUNT',
 'GCOUNT',
 'TFIELDS',
 'TCTYP',
...

sqlToFitsDataType

Translation for SQL type to PyFITS type.

Value:
{'bigint': 'K',
 'float': 'D',
 'int': 'J',
 'real': 'E',
 'smallint': 'I',
 'tinyint': 'B',
 'varchar(1)': '1A',
 'varchar(10)': '10A',
...

prodBits

Value:
{0: 'Processing deep images',
 1: 'Processing first calibration merged-band catalogues',
 2: 'Processing final calibration phase 3 catalogues'}

_newNameOfFile

Dictionary of ESO-style file names of images referenced by their original archive names. These are the components of other images.

Value:
None