Package wsatools :: Module DataFactory :: Class ProgrammeTable
[hide private]

Class ProgrammeTable

source code


A specific database table container for the Programme table.

Instance Methods [hide private]
new empty dictionary

__init__(self, db=None)
Accesses the default database, extracts the requested table data, and prepares special access objects: acronym, progNameToID and progIDsForTable.
source code
 
_initialiseProgramme(self)
Accesses the default database, extracts the requested table data, and prepares special access objects: acronym, progNameToID and progIDsForTable.
source code
str
_parseAcronym(self, **kwds)
Returns: A case-sensitive acronym for the programme.
source code
str
getAcronym(self, progID=None)
Converts the given programme ID into the corresponding programme acronym.
source code
str
getAstroInfoTable(self, **kwds)
Returns: AstrometricInfo table name for current programme.
source code
str
getAstrometryTable(self, **kwds)
Returns: DetectionAstrometry table name for current programme.
source code
str
getBestAperTable(self, **kwds)
Returns: AstrometricInfo table name for current programme.
source code
str
getDetectionTable(self, **kwds)
Returns: DetectionRaw table name for current programme.
source code
str
getListRemeasTable(self, **kwds)
Returns: ListRemeasurement table name for current programme.
source code
str
getMergeLogTable(self, **kwds)
Returns: MergeLog table name for current programme.
source code
list(str)
_getMfIdRange(self, month)
Returns: Multiframe ID range, in SQL syntax, of a given month that has a monthly-split detection table.
source code
list(str)
_getMonthlyDetectionTables(self, detTable)
Returns: Current monthly DetectionRaw table names.
source code
list(str) or list(tuple(str, str)) or str
getMonthlyDetectionTables(self, dateRange=None, deepOnly=False, excludeDeeps=False, mfIDs=None, **kwds)
Returns: All DetectionRaw table names for current programme, up to and including the last date given in the date range.
source code
str
getName(self, **kwds)
Simple wrapper for getAttr('title').
source code
str
getOrphanTable(self, **kwds)
Returns: Orphan table name for current programme.
source code
str
getPhotometryTable(self, **kwds)
Returns: DetectionPhotometry table name for current programme.
source code
str
getSourceTable(self, **kwds)
Returns: Source table name for current programme.
source code
str
getSourceRemeasTable(self, **kwds)
Returns: SourceRemeasurement table name for current programme.
source code
str
getSynopticBestMatchTable(self, **kwds)
Returns: BestMatch table name for current programme.
source code
str
getSynopticMergeLogTable(self, **kwds)
Returns: SynopticMergeLog table name for current programme.
source code
str
getSynopticNeighbourTable(self, **kwds)
Returns: Name of neighbour table that was created for synoptic curation for current programme.
source code
str
getSynopticSourceTable(self, **kwds)
Returns: SynopticSource table name for current programme.
source code
str
getTileSetTable(self, **kwds)
Returns: TileSet table name for current programme.
source code
str
getTilePpwTable(self, **kwds)
Returns: TilePawPrints table name for current programme.
source code
str
getVariabilityTable(self, **kwds)
Returns: Variability table name for current programme.
source code
str
getVarFrameSetInfoTable(self, **kwds)
Returns: VarFrameSetInfo table name for current programme.
source code
str or None
getSchemaScript(self, **kwds)
Get the name of the .sql script file that describes the schema for tables belonging to the current programme.
source code
list(str)
getProductTypes(self, **kwds)
Returns: Product types to be created for the current programme.
source code
int
getProgIDfromName(self, acronym)
Converts a programme acronym into the corresponding programme ID.
source code
set(int)
getProgIDsfromTable(self, tableName)
Finds the corresponding programme ID for a given database table.
source code
list(int)
getProgIDList(self, onlyNonSurvey=False, onlySurvey=False, excludeNew=True, excludeSV=False)
Returns a list of programme IDs that are defined in the Programme table of the database and are correctly set-up with detection tables.
source code
str
getProjection(self, **kwds)
Returns: Projection type, e.g.
source code
bool
isAutomated(self, **kwds)
Returns: True, if this programme is automatically set up and curated via AutoCurate.
source code
bool
isDeep(self, **kwds)
Returns: True, if this programme requires deep stack frames.
source code
bool
isLowGalLat(self, **kwds)
Returns: True, if this programme is mainly based in the Galactic Plane or Magellanic Clouds: high stellar density and cannot use Schlegal Dust Maps
source code
bool
isMosaicked(self, **kwds)
Returns: True, if this programme requires mosaic frames.
source code
bool
isNonSurvey(self, **kwds)
Returns: True, if this programme is a non-survey programme.
source code
bool
isSatelliteProg(self, **kwds)
Returns: True, if this programme is a satellite programme.
source code
bool
isShallowTiled(self, **kwds)
Returns: True, if this programme's merged source product should just consists of shallow tiles.
source code
bool
isSynoptic(self, **kwds)
Returns: True, if this programme requires synoptic merging.
source code
bool
isUkidss(self, **kwds)
Returns: True, if this programme is a UKIDSS programme.
source code
int
setProgID(self, progStr)
Sets the current row to the given programme and returns the unique programme ID.
source code
 
updateDetails(self)
Updates the ProgrammeTable object with the latest database values.
source code
bool
useSExtractor(self, **kwds)
Returns: True, if the catalogues for this programme are produced with SExtractor rather than CASU's cirdr package.
source code

Inherited from Table: getAll, getAttr, setCurRow

Inherited from Table (private): _setCurRow

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]
  _acronym = None
Dictionary of acronyms for each programme ID.
  _detTablesOfProg = None
Dictionary of monthly-split detection tables for every programme.
  _progNameToID = None
Dictionary of programmme IDs given the programme acronym.
  _progIDsForTable = None
Dictionary containing a list of programme IDs for every table.

Inherited from Table: name

Inherited from Table (private): _curRow, _db

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, db=None)
(Constructor)

source code 

Accesses the default database, extracts the requested table data, and prepares special access objects: acronym, progNameToID and progIDsForTable.

Parameters:
  • db (DbSession) - Optional alternative database connection.
Returns:
new empty dictionary

Overrides: object.__init__

_parseAcronym(self, **kwds)

source code 
Returns: str
A case-sensitive acronym for the programme.

getAcronym(self, progID=None)

source code 

Converts the given programme ID into the corresponding programme acronym. If none supplied then the current programme's acronym is returned.

Parameters:
  • progID (int) - Optional unique identifier for the programme.
Returns: str
Programme acronym (case-sensitive; meaning lower-case unless given otherwise in detection table name).

getAstroInfoTable(self, **kwds)

source code 
Returns: str
AstrometricInfo table name for current programme.

getAstrometryTable(self, **kwds)

source code 
Returns: str
DetectionAstrometry table name for current programme.

getBestAperTable(self, **kwds)

source code 
Returns: str
AstrometricInfo table name for current programme.

getDetectionTable(self, **kwds)

source code 
Returns: str
DetectionRaw table name for current programme.

getListRemeasTable(self, **kwds)

source code 
Returns: str
ListRemeasurement table name for current programme.

getMergeLogTable(self, **kwds)

source code 
Returns: str
MergeLog table name for current programme.

_getMfIdRange(self, month)

source code 
Returns: list(str)
Multiframe ID range, in SQL syntax, of a given month that has a monthly-split detection table.

_getMonthlyDetectionTables(self, detTable)

source code 
Returns: list(str)
Current monthly DetectionRaw table names.

getMonthlyDetectionTables(self, dateRange=None, deepOnly=False, excludeDeeps=False, mfIDs=None, **kwds)

source code 
Returns: list(str) or list(tuple(str, str)) or str
All DetectionRaw table names for current programme, up to and including the last date given in the date range. If a single mfID is given then it returns the single table that contains that mfID, otherwise it returns a list of all tables together with their mfID constraint ranges that contain the list of given mfIDs.

getName(self, **kwds)

source code 

Simple wrapper for getAttr('title').

Returns: str
Full name of the programme.

getOrphanTable(self, **kwds)

source code 
Returns: str
Orphan table name for current programme.

getPhotometryTable(self, **kwds)

source code 
Returns: str
DetectionPhotometry table name for current programme.

getSourceTable(self, **kwds)

source code 
Returns: str
Source table name for current programme.

getSourceRemeasTable(self, **kwds)

source code 
Returns: str
SourceRemeasurement table name for current programme.

getSynopticBestMatchTable(self, **kwds)

source code 
Returns: str
BestMatch table name for current programme.

getSynopticMergeLogTable(self, **kwds)

source code 
Returns: str
SynopticMergeLog table name for current programme.

getSynopticNeighbourTable(self, **kwds)

source code 
Returns: str
Name of neighbour table that was created for synoptic curation for current programme. This varies depending on whether a synoptic source table has been made.

getSynopticSourceTable(self, **kwds)

source code 
Returns: str
SynopticSource table name for current programme.

getTileSetTable(self, **kwds)

source code 
Returns: str
TileSet table name for current programme.

getTilePpwTable(self, **kwds)

source code 
Returns: str
TilePawPrints table name for current programme.

getVariabilityTable(self, **kwds)

source code 
Returns: str
Variability table name for current programme.

getVarFrameSetInfoTable(self, **kwds)

source code 
Returns: str
VarFrameSetInfo table name for current programme.

getSchemaScript(self, **kwds)

source code 

Get the name of the .sql script file that describes the schema for tables belonging to the current programme. For non-survey programmes the file name includes the NonSurvey directory name.

Parameters:
  • kwds (dict) - Optionally specify a keyword argument to select the desired programme in the table based on an attribute value that defines a unique row. For example: getSchemaScript(programmeID=101). If no keyword supplied, then the current programme as set with setCurRow() is used. If no current programme is set, then None is returned. If the keyword does not reference a unique row then the first row that contains this attribute value is used as the current programme.
Returns: str or None
Schema .sql script file name (and NonSurvey directory name if non-survey).

getProductTypes(self, **kwds)

source code 
Returns: list(str)
Product types to be created for the current programme.

getProgIDfromName(self, acronym)

source code 

Converts a programme acronym into the corresponding programme ID.

Parameters:
  • acronym (str) - Acronym for the programme.
Returns: int
Unique programme ID.

getProgIDsfromTable(self, tableName)

source code 

Finds the corresponding programme ID for a given database table. Rather than just looking for the acronym in the table name this function, does an exact table match from the list given in the Programme table.

Parameters:
  • tableName (str) - Name of a database table that potentially belongs to a programme.
Returns: set(int)
Set of programmeIDs that given table belongs to.

getProgIDList(self, onlyNonSurvey=False, onlySurvey=False, excludeNew=True, excludeSV=False)

source code 

Returns a list of programme IDs that are defined in the Programme table of the database and are correctly set-up with detection tables.

Parameters:
  • onlyNonSurvey (bool) - If True, just list non-survey programmes.
  • onlySurvey (bool) - If True, just list survey programmes.
  • excludeNew (bool) - If True, exclude programmes without detection tables.
  • excludeSV (bool) - If True, exclude science verification programmes.
Returns: list(int)
A list of all of the programme IDs in the database.

getProjection(self, **kwds)

source code 
Returns: str
Projection type, e.g. ZPN or TAN, for WCS co-ordinates in the products curated in current programme.

isAutomated(self, **kwds)

source code 
Returns: bool
True, if this programme is automatically set up and curated via AutoCurate.

isDeep(self, **kwds)

source code 
Returns: bool
True, if this programme requires deep stack frames.

isLowGalLat(self, **kwds)

source code 
Returns: bool
True, if this programme is mainly based in the Galactic Plane or Magellanic Clouds: high stellar density and cannot use Schlegal Dust Maps

isMosaicked(self, **kwds)

source code 
Returns: bool
True, if this programme requires mosaic frames.

isNonSurvey(self, **kwds)

source code 
Returns: bool
True, if this programme is a non-survey programme.

isSatelliteProg(self, **kwds)

source code 
Returns: bool
True, if this programme is a satellite programme.

isShallowTiled(self, **kwds)

source code 
Returns: bool
True, if this programme's merged source product should just consists of shallow tiles.

isSynoptic(self, **kwds)

source code 
Returns: bool
True, if this programme requires synoptic merging.

isUkidss(self, **kwds)

source code 
Returns: bool
True, if this programme is a UKIDSS programme.

setProgID(self, progStr)

source code 

Sets the current row to the given programme and returns the unique programme ID.

Parameters:
  • progStr (str) - Any string describing the programme; the unique ID, the acronym or the dfsIDString.
Returns: int
Unique programme ID.

updateDetails(self)

source code 

Updates the ProgrammeTable object with the latest database values.

Parameters:
  • uidName - Column name that contains the unique ID values in the table that will unchanged.
Overrides: Table.updateDetails

useSExtractor(self, **kwds)

source code 
Returns: bool
True, if the catalogues for this programme are produced with SExtractor rather than CASU's cirdr package.