astro.main.PhotRefCatalog (version @(#)$Revision: 1.103 $)
index
/astro-wise/AWEHOME/AWBASE/astro/main/PhotRefCatalog.py

 
Modules
       
astro.external.LDAC
datetime
os
string

 
Classes
       
astro.main.BaseCatalog.BaseCatalog(common.database.DataObject.DataObject)
PhotRefCatalog(astro.main.BaseCatalog.BaseCatalog, astro.main.OnTheFly.OnTheFly)
astro.main.OnTheFly.OnTheFly
PhotRefCatalog(astro.main.BaseCatalog.BaseCatalog, astro.main.OnTheFly.OnTheFly)
PhotRefCatalogReader
PhotRefCatalogReaderDatabase
PhotRefCatalogReaderFile
PhotRefSource
SourceFilterOrigin
exceptions.Exception(exceptions.BaseException)
PhotRefCatalogError

 
class PhotRefCatalog(astro.main.BaseCatalog.BaseCatalog, astro.main.OnTheFly.OnTheFly)
    This class describes the complete catalog of reference sources.
 
 
Method resolution order:
PhotRefCatalog
astro.main.BaseCatalog.BaseCatalog
common.database.DataObject.DataObject
common.database.DBMain.DBObject
__builtin__.object
astro.main.OnTheFly.OnTheFly

Methods defined here:
__init__(self, pathname='')
associate(self, incat, outcat, ra_range=[], dec_range=[])
This method is used to associate the input SExtractor catalog
("incat") with the standard star catalog. The resulting catalog is
"outcat".
dump(self, dump_file='cal569E_dump.txt')
This method dumps the content of the catalog into an ASCII-file.
get_dict_of_magnitudes(self, mag_id, index_list=[])
This method returns a dictionary that contains the magnitudes of the
sources in the catalog for the requested photometric band. If an
index_list is given, only for the stars in this index_list the
magnitudes are returned.
 
   Examples of use : get_dict_of_magnitudes('SloanR')
                     get_dict_of_magnitudes('JohnsonV',
                                            index_list = [1, 2, 3])
get_dict_of_origins(self, index_list=[])
get_list_of_bands(self)
get_number_of_sources(self)
get_source_attributes(self)
get_source_data(self, columns, index_list=[])
make_skycat(self)
This method creates a dump of the reference catalog that can be used
to overplot images in skycat.

Class methods defined here:
exist(cls, **args) from common.database.DBMeta.DBObjectMeta
Search for PhotRefCatalog for on-the-fly parameters.

Static methods defined here:
get()
This static method is used to retrieve a PhotRefCatalog object from
the database.

Data descriptors defined here:
creation_date
Date this object was created [None]
filename
The name of the associated file [None]
globalname
The name used to store and retrieve file to and from Storage [None]
object_id
The object identifier
 
The object identifier is an attribute shared by all persistent
instances. It is the prime key, by which object identity is established

Methods inherited from common.database.DataObject.DataObject:
FileName(self)
Return the pathame of the object
Name(self)
Return the name of the object
check_mandatory_dependencies(self)
check if all the mandatory dependencies are set
commit(self)
derive_hash(self)
Apply hashing function to the contents of the file that is part of
this object.
 
The SHA hashing function is used to calculate a hash value of the
contents of this DataObject. The hash value is returned as a
hexadecimal string.
distinct(self, param_list)
This method returns the distinct values from an input list. The
current implementation is kinda cheesy.
exists(self)
Test is the file existsts
get_canonical_name(self, processlevel='')
The canonical name of a DataObject.
get_pathname(self)
Getter for pathname
is_on_dataserver(self)
Checks if file is accessable on the dataserver.
 
NOTE: A return of False does NOT imply the file is not on any
      dataserver!  It is simply not on any accessable
      dataserver.
is_stored(self)
locate(self)
See common/net/dataserver_client.py (Data_IO.locate).
 
Returns a list of strings describing all dataservers where the file is
located as well as a few properties of the file, i.e.
 ['ip=...,port=...,path=...,size=...,mdate=...,
  'ip=...,port=...,path=?,size=?,mdate=?']
 
Question marks indicate that this dataserver is not reachable.
name_insert_suffix(self, suffix)
name_replace_suffix(self, suffix)
name_with_new_suffix(self, suffix)
release(self)
retrieve(self)
set_filename(self, pathname=None, processlevel='')
Specify a filename for this DataObject or use the default filename.
 
This method is used to set the filename attribute of a DataObject.
If called without a filename, the filename is set to the canonical name.
Classes that are derived from DataObject are expected to define a
method get_canonical_name() that returns the name for an instance
of that class. This is mandatory for CalFiles (or files that are
store()d on the data server) and optional for other files.
set_pathname(self, pathname)
Setter for pathname
set_process_parameters_from_dict(self, pars={})
pars is a dictionary of the type e.g.:
{'BiasFrame.process_params.SIGMA_CLIP':8}
set_stored(self)
set_user_config(self, pars={})
store(self)
store_with_hash_as_name(self, prefix='', suffix='fits')
Name the file after the hash value of the file and store it.
 
First the hash value of the file is calculated. The pathname of the
dataobject is renamed to the hash value with the given suffix appended.
Then the file is stored.

Class methods inherited from common.database.DataObject.DataObject:
is_cal(cls) from common.database.DBMeta.DBObjectMeta
Test for being cal, derived raw classes should set _IS_CAL to 1
is_config(cls) from common.database.DBMeta.DBObjectMeta
Test for being config, derived raw classes should set _IS_CONFIG to 1
is_raw(cls) from common.database.DBMeta.DBObjectMeta
Test for being raw, derived raw classes should set _IS_RAW to 1
is_science(cls) from common.database.DBMeta.DBObjectMeta
Test for being science, derived raw classes should set _IS_SCIENCE to 1
is_seq(cls) from common.database.DBMeta.DBObjectMeta
Test for being seq, derived raw classes should set _IS_SEQ to 1
is_support(cls) from common.database.DBMeta.DBObjectMeta
Test for being config, derived raw classes should set _IS_SUPPORT to 1

Data descriptors inherited from common.database.DataObject.DataObject:
pathname

Data and other attributes inherited from common.database.DataObject.DataObject:
filepath = './'
localname = ''
mandatory_dependencies = ()
storage = <common.net.dataserver_client.Storage at 0xe27ef0>

Methods inherited from common.database.DBMain.DBObject:
__del__(self)
Destructor for the DBObject
 
This destructor is called by the garbage collector for the transient
part of the DBObject. When it is called it calls the gc_transient()
method of the DBProxy implementation. The implementation of the
gc_transient() method can then decide what to do with the persistent
counterpart.
E.g. the database can be synchronized with its transient counterpart.
Another possibility is that the gc_transient() implementation checks
whether any attributes of a read-only object have changed since an
object was fetched from the database. If there are differences an
exception can be raised.
__reduce__(self)
Method necessary to create picklable objects
 
This mehod return a tuple containg a function object used for
unpickling and a picklable state tuple, to be used as argument
to the unpickle function. If necessary this object is registered
in the pickle cache
as_dict(self, seqnr=1, dependency_name='', dictionary={}, allow_lazy_typed_list=False)
Method much like the info method, but returns a dictionary.
 
Dictionary looks like:
  {'<classname>.<property1_name>.<property2_name>': value,
   '<classname>.<property2_name>.<property3_name>': value}
 
Problem: infinite loops for cold/flat dependencies. It seems a maximum
recursion depth limits the problem.
get_creator(self)
Returns the name of the user who created this object.
get_persistent(self)
get_project(self)
Returns the name of the project to which this object belongs.
info(self, level=0, doc=False, _indent=0, _printclass=True)
Print the values of all persistent properties of the object.
 
level       : level of introspection
doc         : display docstrings for attributes
_indent     : internal parameter used for formatting
_printclass : internal parameter used for formatting
inverse_objects(self, max_results=100)
Iterate through and return all objects that use the current object
max_results     The maximum number of objects returned per query
inverse_query(self)
go through all inverse properties to see if this object is used
persists(self)
Returns whether an object is already made persistent or transient.
recommit(self)
Commits changes to an object, without following links.

Class methods inherited from common.database.DBMain.DBObject:
get_inverse_properties(cls, props=None) from common.database.DBMeta.DBObjectMeta
return all inverse properties 
that are all the properties that point to this class

Data descriptors inherited from common.database.DBMain.DBObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from common.database.DBMain.DBObject:
__metaclass__ = <class 'common.database.DBMeta.DBObjectMeta'>
This is the metaclass for persistent classes
 
Provides:
  __new__ -- manages class construction
  __call__ -- manages object instantiation
database = <common.database.DBOracle.DBProxy instance at 0x12fb7e8>
pickle_id = None

Methods inherited from astro.main.OnTheFly.OnTheFly:
Flagged(self)
Check if any flag is set
return 1 for flag is set
return 0 no flag
after_do_make(self, switches=None)
extra make statements, this method can be overridden by OnTheFly classes to
implement extra make statements which will be executed after the make of self
after_set_onthefly_dependencies(self, switches, advanced)
this method is called after the onthefly method set_onthefly_dependencies
derived classes can implement this method to customize the dependencies
setting after this has been done automatically by onthefly
after_uptodate_object(self, dependencies_missing, dependencies_new, dependencies_obsolete)
The uptodate_object method determines if the object is uptodate, and will result in three listings :
 dependencies_missing - missing mandatory dependencies
 dependencies_new - new dependencies
 dependencies_obsolete - current dependencies that are obsolete
Derived classes can override this method to tweak the listings
check_for_mandatory(self, dep_str, dep_new)
check if dependency is mandatory and present
dep_str is the name of the attribute, dep_new is the (attribute) object
get_onthefly_dependencies(self, advanced=None)
Method retrieves a list of all dependencies used for
on-the-fly processing
Return: [dependency, dependency class, dependency name]
uptodate(self, date_time=None, template=None, switches=None, advanced=None)
This method checks if the object is up-to-date, for the given datetime.
OnTheFly_uptodate class has the functionality for checking uptodate

Class methods inherited from astro.main.OnTheFly.OnTheFly:
get_onthefly(cls, date_time=None, filter=None, chip=None, object_id=None, advanced=None, switches=None, template=None, parent=None, parent_attr=None) from common.database.DBMeta.DBObjectMeta
For the given parameters and class get the object,
if the object does not exist -> make it.
This is done recursively for all dependencies.
 
The object can only be made if there are raws

 
class PhotRefCatalogError(exceptions.Exception)
    
Method resolution order:
PhotRefCatalogError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x719220>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class PhotRefCatalogReader
    This abstract base class represents the entity that reads the content of     the standard star catalog.
 
  Methods defined here:
get_LDAC_fits(self, refcat, ra_range=[], dec_range=[])
This abstract method is used to make a dump of the retrieved data to
an LDAC fits file when appropriate.
read(self, refcat, *args)

 
class PhotRefCatalogReaderDatabase(PhotRefCatalogReader)
     Methods defined here:
base_clause(self, catalog_name)
get_LDAC_fits(self, refcat, ra_range=[], dec_range=[])
index_clause(self, index_list)
order_by(self, column)
origin_clause(self, origin_list)
query_database(self, query)
read(self, refcat, index_list)

 
class PhotRefCatalogReaderFile(PhotRefCatalogReader)
     Methods defined here:
__init__(self)
filter_on_index(self, srclist, index_list)
filter_on_origin(self, ldac_list, refcat)
get_LDAC_fits(self, refcat, ra_range=[], dec_range=[])
read(self, refcat, index_list)
This method is used to read the LDAC file underlying the
PhotRefCatalog object and to remove those sources from the list that do
not comply with the indices in the input "index_list".
 
Any filters active on the standard star catalog restricting the view on
its contents are enforced here as well.

 
class PhotRefSource
    This class describes a single reference source used for the photometric
calibration.
 
  Methods defined here:
get_data(self, columns)
get_magnitude(self, mag_id)

Static methods defined here:
get_attributes()
get_list_of_bands()
is_invalid(magnitude, **kw)
This static method checks whether a given standard star from the
catalog is actually fit for its purpose. One reason why a star can be
invalidated is because it does not have a magnitude associated with a
given photometric band. In the standard star catalog this is indicated
by a 0.00 value for that magnitude.

Data and other attributes defined here:
CousinsI = 0.0
CousinsI_err = 0.0
CousinsR = 0.0
CousinsR_err = 0.0
JohnsonB = 0.0
JohnsonB_err = 0.0
JohnsonU = 0.0
JohnsonU_err = 0.0
JohnsonV = 0.0
JohnsonV_err = 0.0
SloanG = 0.0
SloanG_err = 0.0
SloanI = 0.0
SloanI_err = 0.0
SloanR = 0.0
SloanR_err = 0.0
SloanU = 0.0
SloanU_err = 0.0
SloanZ = 0.0
SloanZ_err = 0.0
dec = 0.0
dec_err = 0.0
epoch = 0.0
flag = 0
index = 0
origin = 'Unknown'
ra = 0.0
ra_err = 0.0
star_id = 'NN'

 
class SourceFilterOrigin
    This little class represents the filter on the "origin" attribute of the
sources contained in the standard star catalog.
 
  Methods defined here:
__init__(self)
activate(self, *origins)
deactivate(self)
get_settings(self)
is_active(self)

 
Functions
       
create_reader(refcat)
instantiate_sources(ldac_list)
This little function is a factory for PhotRefSource objects.
write_skycat_catalog_to_disk(output_name, params)

 
Data
        PHOTREF_CONF = [('VERBOSE', 'NORMAL'), ('COL_NAME', 'SeqNr'), ('COL_TTYPE', 'LONG'), ('COL_HTYPE', 'INT'), ('COL_COMM', '"Standard star ID"'), ('COL_UNIT', '""'), ('COL_DEPTH', '1'), ('COL_NAME', 'origin'), ('COL_TTYPE', 'STRING'), ('COL_HTYPE', 'STRING'), ('COL_COMM', '""'), ('COL_UNIT', '""'), ('COL_DEPTH', '20'), ('COL_NAME', 'Name'), ('COL_TTYPE', 'STRING'), ('COL_HTYPE', 'STRING'), ('COL_COMM', '""'), ('COL_UNIT', '""'), ('COL_DEPTH', '20'), ('COL_NAME', 'Ra'), ...]
__version__ = '@(#)$Revision: 1.103 $'
database = <common.database.Database.Database object at 0xcadd10>