Package gavo :: Package user :: Module info
[frames] | no frames]

Module info

source code

Commands for obtaining information about various things in the data center.

Classes
  Interval
an interval class.
  AnnotationMaker
A class for producing column annotations.
Functions
 
annotateDBTable(td, extended=True, requireValues=False)
returns the TableDef td with domain annotations for its columns.
source code
 
getSCSCoverageQuery(td, order)
returns a database query for getting a MOC for a table suitable for cone search.
source code
 
getSSAPCoverageQuery(td, order)
returns a database query for getting a MOC for a table using one of our standard SSAP mixins.
source code
 
getSIAPCoverageQuery(td, order)
returns a database query for getting a MOC for a table using //siap#pgs (i.e., SIAv1)
source code
 
getObscoreCoverageQuery(td, order)
returns a database query for getting a MOC for tables with obscore columns
source code
 
getMOCQuery(td, order)
returns a MOC-generating query for a tableDef with standard columns.
source code
 
getMOCForStdTable(td, order=6)
returns a MOC for a tableDef with one of the standard protocol mixins.
source code
 
getTimeLimitsColumnNames(td)
returns the names of columns hopefully containing minimal and maximal time coverage of each row of a tabe defined by td.
source code
 
getSpectralLimitsColumnNames(td)
returns the name of columns hopefully containing minimal and maximal spectral coverage.
source code
 
iterScalarLimits(td, columnsDeterminer)
yields Interal instances for time or spectral coverage.
source code
 
printTableInfo(td)
tries to obtain various information on the properties of the database table described by td.
source code
 
parseCmdline() source code
 
main() source code
Function Details

annotateDBTable(td, extended=True, requireValues=False)

source code 

returns the TableDef td with domain annotations for its columns.

td must be an existing on-Disk table.

The annotations come in a dictionary-valued attribute on each column annotated. Possible keys include "min", "max", "avg", and "hasnulls". Only columns with the appropriate types (i.e., orderable, and, for avg, numeric) are annotated.

Without extended, only min and max are annotated. With requireValues, only numeric columns that already have a values child are annotated.

getSCSCoverageQuery(td, order)

source code 

returns a database query for getting a MOC for a table suitable for cone search.

This will return None if no such query can be built.

getSSAPCoverageQuery(td, order)

source code 

returns a database query for getting a MOC for a table using one of our standard SSAP mixins.

This will return None if no such query can be built.

getSIAPCoverageQuery(td, order)

source code 

returns a database query for getting a MOC for a table using //siap#pgs (i.e., SIAv1)

TODO pgsphere is missing features to make this really work properly, so so far we're just using centers. Make sure you're using small orders here.

This will return None if no such query can be built.

For SIAv2, no such thing is available yet; the assumption is that for the time being, for all image collections there's always a SIAv1 service, too.

getObscoreCoverageQuery(td, order)

source code 

returns a database query for getting a MOC for tables with obscore columns

TODO pgsphere is missing features to make this really work properly, so so far we're just using s_ra and s_dec; we should move to s_region.

This will return None if no such query can be built.

getMOCQuery(td, order)

source code 

returns a MOC-generating query for a tableDef with standard columns.

(this is a helper for getMOCForStdTable)

getMOCForStdTable(td, order=6)

source code 

returns a MOC for a tableDef with one of the standard protocol mixins.

The function knows about SCS and SSAP for now; protocols are tested for in this order.

getTimeLimitsColumnNames(td)

source code 

returns the names of columns hopefully containing minimal and maximal time coverage of each row of a tabe defined by td.

As required by getScalarLimits, this will also return a function that (hopefully) turns the detected columns to julian years,

This tries a couple of known criteria for columns containing times in some order, and the first one matching wins.

This will raise a NotFoundError if none of our heuristics work.

getSpectralLimitsColumnNames(td)

source code 

returns the name of columns hopefully containing minimal and maximal spectral coverage.

As transformer function, we currently return the identity, as we're only using IVOA standard columns anyway. Based on unit and ucd, we could pretty certainly do better.

If this doesn't find any, it raise a NotFoundError.

iterScalarLimits(td, columnsDeterminer)

source code 

yields Interal instances for time or spectral coverage.

ColumnsDeterminer is a function td -> (mincol, maxcol, transformer) expected to raise a NotFoundError if no appropriate columns can be found. This is either getTimeLimitsColumnNames or getSpectralLimitsColumnNames at this point. transformer here is a function val -> val turning what's coming back from the database to what's expected by the coverage machinery (e.g., MJD -> jYear).

It's conceivable that at some point we'll give multiple intervals, and hence this is an iterator (that can very well yield nothing for a variety of reasons).