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

defines a class for (SExtractor) catalogs

 
Modules
       
astro.external.LDAC
astro.external.Sextractor
sys

 
Classes
       
astro.main.BaseCatalog.BaseCatalog(common.database.DataObject.DataObject)
Catalog

 
class Catalog(astro.main.BaseCatalog.BaseCatalog)
    This class represents a catalog made by sextractor.
 
 
Method resolution order:
Catalog
astro.main.BaseCatalog.BaseCatalog
common.database.DataObject.DataObject
common.database.DBMain.DBObject
__builtin__.object

Methods defined here:
__init__(self, pathname='')
check_preconditions(self)
copy_attributes_from_frame(self)
Copy catalog attributes from the frame object
 
Requires:
   frame -- the BaseFrame object
 
Updates:
   weight    -- from frame.weight
   zeropoint -- from frame.get_zeropoint()
get_mag_id(self)
get_records(self, table, keyword_list)
Return a list of records from the given table.
 
Records will be dictionaries of key value pairs, with the keys
from the keyword_list.
get_sex_config(self)
calculate and return the fixed sextractor parameters
getlist(self, table, keyword_list)
make(self)
Run sextractor to make the catalog.
 
Requires:
   frame    -- the input frame over which to run the catalog
   sexconf  -- the sextractor configuration (optional)
   sexparam -- additional sextractor parameters (optional)
 
This procedure first runs sextractor and then runs ldacconv to
transform the sextractor catalog into an LDAC catalog. If the
sexconf is not given then a default sextractor configuration,
obtained from set_sextractor_config (q.v.) is used.
make_asciitable(self, tabname='OBJECTS', colnames=[])
make_skycat(self)
This method creates a "dump" of the Catalog object that can be used
to overplot a frame in ESO skycat.
run_sextractor(self)
set_number_of_sources(self, number_of_sources)
set_sextractor_config(self)
Configure sextractor
 
Requires:
  frame     -- the detection frame
  threshold -- The sextractor detection threshold
  seeing    -- used to determine SEEING_FWHM and FILTER (optional)
  weight    -- used to determine WEIGHT_TYPE and WEIGHT_IMAGE (optional)
  zeropoint -- used to detemine MAG_ZEROPOINT (optional)
 
Updates:
  sexconf   -- The SextractorConfig object 
 
Based on the catalog attributes a sextractor configuration
object is created.
set_weightscale(self, weightscale)

Data descriptors defined here:
filename
The name of the associated file [None]
frame
Pixel data from which the catalog will be derived [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
seeing
Seeing estimate for SExtractor configuration [pixel]
sexconf
The SExtractor configuration [None]
sexparam
Additional extraction parameters [None]
sourcecount
Number of detected objects [None]
threshold
SExtractor detection threshold [None]
weight
The weights associated with the frame [None]
weightscale
The weight scale [None]
zeropoint
Photometric zeropoint [mag]

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 0xc66a70>

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 0xa630e0>
pickle_id = None

 
Data
        __version__ = '@(#)$Revision: 1.65 $'