| | |
- astro.main.OnTheFly.OnTheFly
-
- SourceList(common.database.DataObject.DataObject, astro.main.OnTheFly.OnTheFly)
- common.database.DBMain.DBObject(__builtin__.object)
-
- SourceListParameters
- common.database.DataObject.DataObject(common.database.DBMain.DBObject)
-
- SourceList(common.database.DataObject.DataObject, astro.main.OnTheFly.OnTheFly)
- exceptions.Exception(exceptions.BaseException)
-
- SourceListError
class SourceList(common.database.DataObject.DataObject, astro.main.OnTheFly.OnTheFly) |
| | |
- Method resolution order:
- SourceList
- common.database.DataObject.DataObject
- common.database.DBMain.DBObject
- __builtin__.object
- astro.main.OnTheFly.OnTheFly
Methods defined here:
- __init__(self, debug=0, attributes=None, extractor=None)
- __str__(self)
- after_do_make(self, switches=None)
- This method is run after making the object (OnTheFly) and stores the checkimage,
this is without OnTheFly processing done in the Recipe
- append_from_catalog_on_sources(self, catalog, synonyms)
- append_on_sources(self, attr_names, fd=None, sep=' ', funcdict={}, nulldict={})
- area_search_on_sources(self, self_search=True, htm_depth=20, Area=None, attr_dict=None)
- area_search searches the specified area for sources within a given distance
from a position {i.e. Area=(RA,DEC,Distance)} or within an area delimited
by three or four positions {i.e. Area=[(RA0,DEC0),(RA1,DEC1),(RA2,DEC2)]}.
All positions and distances are in degrees.
For the search, htm trixel ranges are searched at a htm depth of 20.
If self_search = True, only the current SourceList is examined, if
self_search = False, all SourceLists will be examined.
attr_dict is a dictionary where the keys represent the attributes returned and their
subsequent values should be on input None or an empty list. If self_search is
False this keyword is ignored.
Return value is a dictionary with keys the SLID's (SourceList IDentifiers) and
values lists of SID's (Source IDentifiers).
- check_preconditions(self)
- commit(self)
- copy_attributes(self)
- copy_file(self, length=16384)
- delete(self)
- Deletes a SourceList with all its sources (after commit)!
THIS IS OBSOLETE, PLEASE USE THE CONTEXT.DELETE METHOD !!!
- derive_timestamp(self)
- get_attributes_on_sources(self)
- get_attributes returns a dictionary with the existing attributes as
keys and the corresponding types as values.
- get_boundingbox_from_sources(self)
- determine the bounding from the coordniates of teh sources
- get_data_dict_from_area_search_on_sources(self, self_search=True, htm_depth=20, Area=None, attr_list=[])
- get_data_dict_from_area_search returns a dictionary of the specified attributes of the
sources found in the specified area.
self_search True, only the current SourceList is examined, False, all available
SourceLists will be examined.
htm_depth The htm_depth [default 20].
Area search the specified area for sources within a given distance from a
position {i.e. Area=(RA,DEC,Distance)} or within an area delimited
by three or four positions {i.e. Area=[(RA0,DEC0),(RA1,DEC1),(RA2,DEC2)]}.
All positions and distances are in degrees.
attr_list list of attribute to be returned in the dictionary.
- get_data_dict_from_sql_query_on_sources(self, attr_list=[], query_string=None, area=None)
- get_data_dict_from_sql_query returns the data associated with given
attributes via an sql query in a dictionary.
query_string may contain only valid SQL query syntax and the names of the attributes
between double quotes (").
attr_list is a list with the wanted attributes.
area denotes the area of the sky [whole sky].
The function returns a dictionary with attribute names as keys and column
data as values (NOTE that in the dictionary the SID data is always returned).
- get_data_dict_on_sources(self, attr_list=[], area=None)
- get_data_dict returns the data associated with given attributes in a
dictionary.
attr_list is a list with the wanted attributes.
area denotes the area of the sky [whole sky].
The function returns a dictionary with attribute names as keys and columns
data as values (NOTE that in the dictionary the SID data is always returned).
- get_data_from_sql_query_on_sources(self, attr_dict={}, query_string=None, area=None)
- Performs an SQL query on source attributes and returns a list of
Source IDentifiers (SID's) and populates the supplied dictionary
with data associated with given attributes (dictionary keys) in the
form of a lists linked to the SID list.
attr_dict: a dictionary where the keys represent the attributes
to be retrieved (see NOTE)
query_string: may contain only valid SQL query syntax (suitable as
a WHERE clause) and the names of the attributes
between double quotes (")
area: denotes the area of the sky (None indicates as much
of the sky as covered by the SourceList)
NOTE: The values of each dictionary key should be on input None or
an empty list. On output the actual values of the attributes
are stored as key values.
- get_data_on_sources(self, attr_dict, area=None)
- Returns a list of Source IDentifiers (SID's) and populates the
supplied dictionary with data associated with given attributes
(dictionary keys) in the form of a lists linked to the SID list.
attr_dict: a dictionary where the keys represent the attributes
to be retrieved (see NOTE)
area: denotes the area of the sky (None indicates as much of
the sky as covered by the SourceList)
NOTE: The values of each dictionary key should be on input None or
an empty list. On output the actual values of the attributes
are stored as key values.
This method calls get_data_from_sql_query_on_sources without a
custom query_string.
- get_fixed_config(self)
- return the fixed sextractor parameters
- get_htm_ranges_on_sources(self, htm_depth=9, Area=None)
- get_htm_ranges returns the set of htm ranges which cover all the sources
in the sourcelist.
htm_depth The wanted htm level.
Area Area for which to return the htm_ranges. Area can be a tuple
to specify a cone {i.e. Area = (RA,DEC,Distance)} or an area
delimited by three or four positions {i.e.
Area=[(RA0,DEC0),(RA1,DEC1),(RA2,DEC2)]}.
Default is bounding box of SourceList.
return values are three ranges, the first range the ranges covering the area, the
second range covering the sources which are inside the specified area and the third
range the outersection of the prevous two ranges. A range is a list of tuples,
each tuple containing the start and end htm value.
- get_lock(self)
- Lock the SourceList and return the number of sources.
- get_mag_id(self)
- get_number_of_sources(self)
- get_number_of_sources returns the number of sources in the SourceList.
- get_table_description(self, filename=None, extname=None)
- getattr_on_sources(self, attr)
- getitem_on_sources(self, index)
- ingest_sources_from_catalog(self)
- Insert sources from a binary fits file into the db.
insert sources directly into SourceList using a flat-like insert statement.
- ingest_sources_from_usno_catalog(self, path)
- len_on_sources(self)
- make(self)
- make_bdsm_catalog(self)
- use BDSM to extract to the source list from the frame
- make_checkimage(self)
- make_gaap_catalog_on_sources(self)
- Simple Python based method to make the ascii catalog compatible with
GaaP code. This catalog has the following entries:
1 X_IMAGE (or Xpos)
2 Y_IMAGE (or Ypos)
3 FLUX_AUTO (or FLUX_ISO, or FLUX_APER)
4 FLUXERR_AUTO (or FLUXERR_ISO or FLUXERR_APER)
5 FWHM_IMAGE
6 A_IMAGE (or A)
7 B_IMAGE (or B)
8 THETA_IMAGE (or POSANG)
9 NUMBER (or SID, or SeqNr)
10 FLAGS (or FLAG)
- make_image_dict_on_sources(self, sids, mode='sky')
- make_image_dict creates an image dict which can be input to
the image server software.
sids An SID (or a list of SIDs) for which the input is generated.
mode Produce sky (default) or grid coordinates.
- make_ldac_catalog_on_sources(self, name=None, htm_depth=20, Area=None, attr_list=None, attr_type={}, rename_dict={}, projection=None)
- make_ldac_catalog creates an LDAC catalog (binary FITS table) from
a SourceList.
name: name of output file [SourceList.name + '.fits']
htm_depth: htm level on which the sources are selected according to
Area keyword [20]
Area: the specified area for sources within a given distance
from a position {i.e. Area=(RA,DEC,Distance)} or within
an area
delimited by three or four positions
{i.e. Area=[(RA0,DEC0),(RA1,DEC1),(RA2,DEC2)]}.
All positions and distances are in degrees.
[all sources in SourceList]
attr_list: list of attributes which will be stored in the binary
FITS file.
[all attributes]
attr_type: dictonary where key is table attribute and value the
FITS type to store in ldac catalogue i.e. '1D', '1E',
'1K', '1I' or '10A'.
[python type of table attribute]
rename_dict: dictonary where key is table attribute and value is
FITS column name.
[no attribute translation]
- make_sextractor_catalog(self)
- make_skycat_on_sources(self, Area=None, htm_depth=20, sid_list=None, filename=None, magname=None)
- make_skycat creates a "dump" of the SourceList object that can be used to
overplot a frame in ESO skycat.
Area search the specified area for sources within a given distance from a
position {i.e. Area=(RA,DEC,Distance)} or within an area delimited
by three or four positions {i.e. Area=[(RA0,DEC0),(RA1,DEC1),(RA2,DEC2)]}.
All positions and distances are in degrees.
htm_depth The htm_depth [default 20].
sid_list a list of wanted SID's (Source IDentifiers) which will be output to the
skycat output file.
filename name of file where to store the objects. The default filename is the name
of the SourceList with extension .scat.
magname Name of attribute to use for magnitudes in output file.
- make_sourcelist_from_catalog(self)
- make_sourcelist_from_catalog creates a SourceList from a catalog created
by sextractor.
- make_sourcelist_from_sourcelist(self, inlist=None, sidlist=[])
- make_sourcelist_from_usno_catalog(self, path)
- make_sourcelist_from_usno_catalog creates a Sourcelist from the USNO catalogs.
path denotes the directory where the zone*.cat files are to be found.
- make_votable(self, filename=None)
- votable returns a VOTable or put the content of SourceList in a user defined file
filename The name of the output file, optional
- rollback(self)
- set_attributes(self, attributes)
- set_coordinate_ranges(self)
- set the bounding box of the sourcelist
- set_made(self)
- set_sourcelist_identifier(self)
- set SLID, name and call set_sourcelist_identifier
- sql_query_on_sources(self, attr_dict={}, query_string=None, area=None)
- THIS FUNCTION IS DEPRECATED: use get_data_from_sql_query_on_sources
Performs an SQL query on source attributes and returns a list of
Source IDentifiers (SID's) and populates the supplied dictionary
with data associated with given attributes (dictionary keys) in the
form of a lists linked to the SID list.
attr_dict: a dictionary where the keys represent the attributes
to be retrieved (see NOTE)
query_string: may contain only valid SQL query syntax (suitable as
a WHERE clause) and the names of the attributes
between double quotes (")
area: denotes the area of the sky (None indicates as much
of the sky as covered by the SourceList)
NOTE: The values of each dictionary key should be on input None or
an empty list. On output the actual values of the attributes
are stored as key values.
This method simply calls get_data_from_sql_query_on_sources.
- update_number_of_sources(self)
- update_source_definition(self, attributes=None)
Data descriptors defined here:
- COMBINE_METHOD
- Method that was used to create this CombinedList [None]
- OBJECT
- Object name [None]
- SLID
- SourceList identifier [None]
- associatelist
- ALID (AssociateList identifier) that was used to create this CombinedList [None]
- astrom_params
- Information about the derived astrometry [None]
- chip
- Information about the chip [None]
- creation_date
- Date this object was created [None]
- detection_frame
- Optional second frame used in Sextractor double image mode [None]
- filename
- The name of the associated file [None]
- filter
- Information about the filter [None]
- filters
- Filters for which columns are present in this CombinedList [None]
- frame
- A BaseFrame object (source of the catalog) [None]
- globalname
- The name used to store and retrieve file to and from Storage [None]
- instrument
- Information about the instrument [None]
- is_valid
- Manual/external flag to disqualify bad data (SuperFlag) [None]
- llDEC
- Declination of lower left containing box [deg]
- llRA
- Right Ascension of lower left containing box [deg]
- lrDEC
- Declination of lower right containing box [deg]
- lrRA
- Right Ascension of lower right containing box [deg]
- name
- Name of the sourcelist [None]
- number_of_sources
- Number of sources [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
- process_params
- Processing parameters [None]
- sexconf
- Sextractor configuration parameters [None]
- sexparam
- Additional extraction parameters [None]
- sources
- SourceList documentation [None]
- ulDEC
- Declination of upperer left containing box [deg]
- ulRA
- Right Ascension of upper left containing box [deg]
- urDEC
- Declination of upper right containing box [deg]
- urRA
- Right Ascension of upper right containing box [deg]
Data and other attributes defined here:
- PROCESS_TIME = 50
- bdsm_params = {}
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
- 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 0x2aaabad1f6c8>
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 0x1028a70>
- 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_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:
- exist(cls, date_time=None, chip=None, filter=None, object_id=None, parent=None, parent_attr=None, template=None, extra=[], advanced=None, switches=None) from common.database.DBMeta.DBObjectMeta
- for the given parameters and class return the most
recent object(s), or None
- 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 SourceListParameters(common.database.DBMain.DBObject) |
| | |
- Method resolution order:
- SourceListParameters
- common.database.DBMain.DBObject
- __builtin__.object
Data descriptors defined here:
- HTM_DEPTH
- Highest level of HTM indexing [None]
- SOURCE_CODE_VERSION
- The version of the source code [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.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.
- commit(self)
- Commits object including objects that are referenced and have been changed.
If this object refers to other persistent object a commit() ensures that
1. ALL changes to the object and referred objects are made persistent.
2. NONE of the changed object and referred objects are made persistent.
Under normal circumstances only the first thing should ever happen.
If the second case occurs it is almost certainly because of some bug in
the routine that implements the DBProxy interface.
- 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 0x1028a70>
- pickle_id = None
| |