| | |
- astro.main.BaseFrame.BaseFrame(common.database.DataObject.DataObject, astro.main.ProcessTarget.ProcessTarget)
-
- RawFrame
-
- RawBiasFrame
- RawDarkFrame
- RawDomeFlatFrame
- RawScienceFrame
- RawTwilightFlatFrame
- common.database.DBMain.DBObject(__builtin__.object)
-
- RawBiasFrameParameters
- RawDomeFlatFrameParameters
- RawTwilightFlatFrameParameters
- common.log.Error.Error(exceptions.Exception)
-
- RawFrameError
class RawBiasFrame(RawFrame) |
| | |
- Method resolution order:
- RawBiasFrame
- RawFrame
- astro.main.BaseFrame.BaseFrame
- common.database.DataObject.DataObject
- common.database.DBMain.DBObject
- astro.main.ProcessTarget.ProcessTarget
- common.database.DBMeta.DBMixin
- __builtin__.object
- astro.main.OnTheFly.OnTheFly
Methods defined here:
- __init__(self, pathname='')
- verify(self)
- See if raw bias is valid
Data descriptors defined here:
- DATE
- UTC date the original data file was saved [None]
- DATE_OBS
- UTC date at the start of the observation [None]
- LST
- Local sidereal time at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- MJD_OBS
- Modified Julian date at the start of the observation (JD-2400000.5) [day]
- NAXIS1
- Length of data in axis 1 [pixel]
- NAXIS2
- Length of data in axis 2 [pixel]
- OBJECT
- Object name [None]
- OBSERVER
- The observer [None]
- OVSCX
- Number of overscan pixels in the x direction [pixel]
- OVSCXPRE
- Number of overscan pixels to skip in the x direction at the edge of the chip [pixel]
- OVSCXPST
- Number of overscan pixels to skip in the x direction at the edge of the data region [pixel]
- OVSCY
- Number of overscan pixels in the y direction [pixel]
- OVSCYPRE
- Number of overscan pixels to skip in the y direction at the edge of the chip [pixel]
- OVSCYPST
- Number of overscan pixels to skip in the y direction at the edge of the data region [pixel]
- PRSCX
- Number of prescan pixels in the x-direction [pixel]
- PRSCXPRE
- Number of prescan pixels to skip in the x-direction at the edge of the chip [pixel]
- PRSCXPST
- Number of prescan pixels to skip in the x-direction at the edge of the data region [pixel]
- PRSCY
- Number of prescan pixels in the y-direction [pixel]
- PRSCYPRE
- Number of prescan pixels to skip in the y-direction at the edge of the chip [pixel]
- PRSCYPST
- Number of prescan pixels to skip in the y-direction at the edge of the data region [pixel]
- STDEV_HIGH
- UTC
- Universal Coordinated Time (UTC) at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- chip
- Information about the chip [None]
- creation_date
- Date this object was created [None]
- extension
- The extension to extract [None]
- filename
- The name of the associated file [None]
- globalname
- The name used to store and retrieve file to and from Storage [None]
- imstat
- Image statistics for the frame [None]
- instrument
- Information about the instrument [None]
- is_valid
- Manual/external flag to disqualify bad data (SuperFlag) [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
- observing_block
- Information about the observing block [None]
- overscan_x_stat
- Statistics of the overscan region in the x-direction [None]
- overscan_y_stat
- Statistics of the overscan region in the x-direction [None]
- prescan_x_stat
- Statistics of the prescan region in the x-direction [None]
- prescan_y_stat
- Statistics of the prescan region in the y-direction [None]
- process_params
- Processing Parameters [None]
- process_status
- A flag indicating the processing status [None]
- quality_flags
- Automatic/internal quality flag [None]
- raw_fits_data
- The multi-extension raw image [None]
- template
- Information about the template [None]
Methods inherited from RawFrame:
- build_header(self)
- check_dimensions(self)
- Check that the raw (untrimmed) image has the size defined in its
chip. The method is private.
The Chip attributes used in this method are now part this class.
This method may be superfluous.
- copy_attributes(self)
- do_statistics(self)
- Determine the image statistics for the trim, prescan and overscan
regions.
- do_trim_and_overscan_correction(self, overscan_parameter=0)
- Replace image with a trimmed and overscan corrected version of
itself.
Requires:
chip -- A Chip object describing the pre/overscan layout
Argument:
overscan_parameter -- which overscan correction to use:
0 -- No overscan correction
1 -- Use median of prescan_x
2 -- Use median of overscan_x
3 -- Use median of prescan_y
4 -- Use median of overscan_y
5 -- Use per-row value of prescan_x
6 -- Use per-row value of overscan_x (default)
7 -- Use per-row average of prescan_x, smoothing the averages
over ~50 rows
8 -- Use per-row average of overscan_x, smoothing the
averages over ~50 rows
9 -- Use per-row average of prescan_x, smoothing the averages
over ~10 rows
10 -- Use per-row average of overscan_x, smoothing the
averages over ~10 rows
11 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions)
12 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~50 rows
13 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~10 rows
This method loads a raw image, trims it and (optionally) performs an
overscan correction, using the statics of the pre- and overscan
regions. This can be done with a single value for the whole image or
on a per-row basis.
Methods 1-4 assume that do_statistics() has been run.
- extract_extension(self)
- extract_header(self)
- get_orientation(self)
- Temporary fix to make sure the frame's orientation is always known
if obtainable.
- get_overscan_x_region(self)
- Return the fits coordinates of the overscan region in the x
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_overscan_y_region(self)
- Return the fits coordinates of the overscan region in the y
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_prescan_x_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_prescan_y_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_trim_region(self)
- Return a tuple of the FITS coordinates of the trim section.
The method returns (x0, y0, x1, y1), where the trim region is
[x0:x1, y0:y1]. This follows the eclipse coordinate ordering
conventions such that
>>> ima = eclipse.image("aaa.fits")
>>> ima.extract_region(*achip.get_trim_region())
extracts the trim section from image aaa.fits.
- get_trimmed_size(self)
- Returns the size of the image in pixels after it has been trimmed.
- has_overscan_x_region(self)
- This method is used to ask the image whether it has an overscan_x
region or not. The return type is Boolean.
- has_overscan_y_region(self)
- This method is used to ask the image whether it has an overscan_y
region or not. The return type is Boolean.
- has_prescan_x_region(self)
- This method is used to ask the image whether it has a prescan_x
region or not. The return type is Boolean.
- has_prescan_y_region(self)
- This method is used to ask the image whether it has a prescan_y
region or not. The return type is Boolean.
- initialize_overscan_attribute(self)
- This method is used to set the "overscan_x_stat" and
"overscan_y_stat" attributes of the RawFrame from the header. This
initializer is specific for RawFrame objects. The method is private.
- initialize_prescan_attribute(self)
- This method is used to set the "prescan_x_stat" and "prescan_y_stat"
attributes of the RawFrame from the header. This initializer is
specific for RawFrame objects. The method is private
- make(self)
- Make a RawFrame object by extracting the data from the proper
extension of the RawFitsData object.
Required inputs:
raw_fits_data -- the unsplit data
extension -- the extension to be extracted
- read_header(self)
- Extends the read_header method of BaseFrame. The method is private.
- set_all_caps_attributes_from_header(self)
- set_chip_and_filter_attributes_from_header(self)
- set_rawframe_specific_attributes_from_header(self)
- This method takes care of setting those attributes of the RawFrame
that are specific for the particular sub-class at hand. This method
should be fully implemented where this is needed. Example:
RawScienceFrame.
Data and other attributes inherited from RawFrame:
- PROCESS_TIME = 250
- orientation = -1
Methods inherited from astro.main.BaseFrame.BaseFrame:
- commit_subwinstat(self)
- Conditionally commit subwindow statistics
- display(self, viewer='skycat', filename=None)
- Independent display method for all frames.
- empty_header(self)
- Initalize to a default (empty) header
- estimate_statistics(self, pixmap=None, zone=None, max_iter=5, threshold=5.0)
- Estimate the mean, median and stddev, by iteratively excluding
pixelvalues deviating too far from the median
Arguments:
pixmap -- optional map for bad pixels (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
max_iter -- The maximum number of iterations
sig_thresh -- The threshold in number of standard deviations
- get_previous_version(self, level=0)
- Return previous version of this object. If it does not exist,
return None.
level: depth of query for previous version (0 goes as deep as
possible)
- initialize_astrom_attribute(self)
- initialize_chip_attribute(self)
- initialize_filter_attribute(self)
- initialize_imstat_attribute(self)
- initialize_instrument_attribute(self)
- initialize_lamp_attribute(self)
- initialize_observingblock_attribute(self)
- initialize_template_attribute(self)
- inspect(self, pixels=None, zone=None, kappa=3.0, iterations=2, cmap=None, vmin=None, vmax=None, interpolation='lanczos', width=6, ratio=None, viewer='skycat', force_figure=False, force_viewer=False, subplot_size=50, contour_levels=20, num_bins=100, extension=None, compare=False, level=0, other=None, clip=False, color=False)
- Optional visual inspection for quality control displays image in a
PyLab (MatPlotLib) window or optionally in an external viewer.
pixels: optional list or array representing the image to be
inspected (can be MxN for greyscale, or MxNx3 for RGB)
zone: tuple of (x0, y0, x1, y1) representing the image
coordinates of the two oposing corners of the sub
image to consider
kappa: the factor by which the dynamic range is increased in
units of sigma (0 gives full range)
iterations: number of iterations in the kappa-sigma range clipping
cmap: PyLab color map instance
vmin: lower display range in native units (e.g. ADU)
vmax: upper display range in native units (e.g. ADU)
interpolation: type of interpolation the PyLab viewer uses (nearest,
bilinear, etc.)
width: width of the PyLab figure window (in inches)
ratio: ratio by which to scale the figure height (default:
x_dim/y_dim)
viewer: external viewer to use in case the image is too large
force_figure: always use the PyLab figure window (Be Careful!
Statistics calculations on large images can be very
time and memory consuming.)
force_viewer: always use the viewer
subplot_size: width and height in pixels of region of interest
contour_levels: number of contour levels for the contour plot of the
region of interest
num_bins: number of bins in the histogram plot
extension: extension of the filetype to save plot to (png, ps,
or eps) None disables saving
compare: compare this frame to its previous version using
difference imaging (current-previous), pixels is
ignored
level: depth of query for previous version (0 goes as deep
as possible) when compare is True
other: a second of the same type of Frame object to replace
previous when compare is True (if color is True,
other can be a list of two images)
clip: kappa-sigma clip each image prior to subtraction when
compare is True
color: use color combining (RGB) instead of differencing
when compare is True (kappa, vmin/vmax only honored
when clip is True), this image is R, other is B if
single, other is [G, B] if it is a list
(EXPERIMENTAL)
When force_viewer is False, inspect() displays basic image
statistics (mean, stddev) and then a representation of the image
that can be zoomed and panned. Pressing various keys will give
different results described below in a region of interest described
by subplot_size:
q - closes the most recent plot window when pressed in the
main window
[space] - displays the X and Y coordinate (FITS standard unit
indexed) and the count level
a - performs aperture photometry on brightest feature in the
region of interest (NOT YET IMPLEMENTED)
c - displays a contour plot of the region of interest (see
contour_levels)
h - displays a histogram of the pixel values of the region of
interest (see num_bins)
r - displays a radial plot of the brightest feature in the
region of interest
s - displays a surface plot of the region of interest
p - displays profile plots in both X and Y dimensions versus
intensity (count level)
NOTE: None of the commands above work in the subplots.
- is_compressed(self)
- Find out if a FITS file is compressed
- load_header(self)
- Initialize self.header
- load_image(self, readonly=0)
- Initialize self.image.
- make_background(self)
- Make a background image,
Returns a new BaseFrame object. The name of the new file is
"name.back.fits"
- make_subwinstat(self)
- Compute statistics on subwindows
- retrieve(self)
- Retrieve this frame from the data server and uncompress it if it has
been compressed with FITSIO.
- save(self, filename='', overwrite=1)
- statistics(self, pixmap=None, zone=None)
- Compute statistics and store in self.imstat.
Arguments:
pixmap -- optional pixelmap object (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
- update_header(self)
- Update a header with values from descriptors
- update_history(self)
- Update a header with history
History is maintained in the instance attribute
history. History is written by appending string to the history
list.
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)
- 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 0x1235830>
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 0xbce170>
- pickle_id = None
Methods inherited from astro.main.ProcessTarget.ProcessTarget:
- check_observing_blocks(self, childs)
- check if all childs have the same observing_block
- check_templates(self, childs)
- check if all childs have the same template
- compare(self)
- Quality Control -- basic trend analysis
The compare() method is used for default trend analysis. This
is done by comparing with a previous version of the same
object (last weeks bias, for example). This may be as simple
as comparing attribute values, but may also involve more
complex computations (e.g., subtracting the two images, and
analysing the residuals)
- derive_timestamp(self)
- Set the creation_date attribute
- get_dependencies(self)
- Return a list of names of attributes that are required for make()
- get_qcflags_set(self)
- Return a list of names of flags that have been set.
- get_qcflags_set_dict(self)
- Return a dictionary of flags that have been set. The key is the
name, the value is a tuple of (index, docstring).
- is_compared(self)
- Return true if the object has been compared
- is_inspected(self)
- Return true if the object has been inspected
- is_made(self)
- Return true if the object has been made
- is_ok(self)
- Return true if no quality control flags have been set.
- is_verified(self)
- Return true if the object has been verified
- set_compared(self)
- Set the process status to indicate that the object has been
compared.
- set_inspected(self)
- Set the process status to indicate that the object has been
inspected.
- set_made(self)
- Set the process tatus to indicate that the object has been made
- set_verified(self)
- Set the process status to indicate that the object has been
verified.
Class methods inherited from astro.main.ProcessTarget.ProcessTarget:
- get_qcflags(cls) from common.database.DBMeta.DBObjectMeta
- Return a list of attribute names of QCflag() objects.
- select(cls, **searchterms) from common.database.DBMeta.DBObjectMeta
- Class method to select RawFrames, Calfiles and ReducedScienceFrames
from the database.
Syntax example:
q = RawScienceFrame.select(instrument='WFI', filter='#842',
chip='ccd50', time_from='2000-01-02 04:45:46',
time_to='2000-01-02 05:03:00')
Possible search terms:
----------------------
check_quality - (Default 1) Exclude invalidated data (quality_flags!=0)
check_validity - (Default 1) Exclude invalidated data (is_valid=0)
chip - select of the same CCD ('ccd50', 'ccd51', etc.)
date - select of the same date (i.e. date at the start of
observing night, in yyyy-mm-dd format)
exptime - select frames with similar exposure time
(EXPTIME-0.8sec to EXPTIME+0.8 sec)
extension - select (raw) frames for a certain extension of its
RawFitsData object
filename - select a frame(!) by its filename
filter - select of the same filter ('#842', '#843', etc.)
instrument - select of the same instrument ('WFI', 'WFC', 'OCAM')
object - select for OBJECT header keyword, uses "like"
functionality, which allows wildcards "*" and "?"
time_from - precise form of date, in yyyy-mm-dd hh:mm:ss format
time_to - required when using time_from
- select_for_raw(cls, raw, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Class method to select the most recent valid calfile for the
provided raw frame from the database.
- select_for_reduced(cls, reduced, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Synonym for the select_for_raw method; the implementation should
be identical.
Data and other attributes inherited from astro.main.ProcessTarget.ProcessTarget:
- STATUS_COMPARE = 2
- STATUS_INSPECT = 3
- STATUS_MAKE = 0
- STATUS_VERIFY = 1
Class methods inherited from common.database.DBMeta.DBMixin:
- get_persistent_attributes(cls) from common.database.DBMeta.DBObjectMeta
- return a list of persistent attributes
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:
- 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 RawBiasFrameParameters(common.database.DBMain.DBObject) |
| | |
- Method resolution order:
- RawBiasFrameParameters
- common.database.DBMain.DBObject
- __builtin__.object
Data descriptors defined here:
- MAX_BIAS_FLATNESS
- QC: maximum difference in subwindow statistics [ADU]
- MAX_BIAS_LEVEL
- QC: maximum average (?) bias level [ADU]
- MAX_BIAS_STDEV
- QC: maximum bias standard deviation [ADU]
- 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 0xbce170>
- pickle_id = None
|
class RawDarkFrame(RawFrame) |
| | |
- Method resolution order:
- RawDarkFrame
- RawFrame
- astro.main.BaseFrame.BaseFrame
- common.database.DataObject.DataObject
- common.database.DBMain.DBObject
- astro.main.ProcessTarget.ProcessTarget
- common.database.DBMeta.DBMixin
- __builtin__.object
- astro.main.OnTheFly.OnTheFly
Methods defined here:
- verify(self)
Data descriptors defined here:
- DATE
- UTC date the original data file was saved [None]
- DATE_OBS
- UTC date at the start of the observation [None]
- EXPTIME
- Total observation time [sec]
- LST
- Local sidereal time at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- MJD_OBS
- Modified Julian date at the start of the observation (JD-2400000.5) [day]
- NAXIS1
- Length of data in axis 1 [pixel]
- NAXIS2
- Length of data in axis 2 [pixel]
- OBJECT
- Object name [None]
- OBSERVER
- The observer [None]
- OVSCX
- Number of overscan pixels in the x direction [pixel]
- OVSCXPRE
- Number of overscan pixels to skip in the x direction at the edge of the chip [pixel]
- OVSCXPST
- Number of overscan pixels to skip in the x direction at the edge of the data region [pixel]
- OVSCY
- Number of overscan pixels in the y direction [pixel]
- OVSCYPRE
- Number of overscan pixels to skip in the y direction at the edge of the chip [pixel]
- OVSCYPST
- Number of overscan pixels to skip in the y direction at the edge of the data region [pixel]
- PRSCX
- Number of prescan pixels in the x-direction [pixel]
- PRSCXPRE
- Number of prescan pixels to skip in the x-direction at the edge of the chip [pixel]
- PRSCXPST
- Number of prescan pixels to skip in the x-direction at the edge of the data region [pixel]
- PRSCY
- Number of prescan pixels in the y-direction [pixel]
- PRSCYPRE
- Number of prescan pixels to skip in the y-direction at the edge of the chip [pixel]
- PRSCYPST
- Number of prescan pixels to skip in the y-direction at the edge of the data region [pixel]
- UTC
- Universal Coordinated Time (UTC) at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- chip
- Information about the chip [None]
- creation_date
- Date this object was created [None]
- extension
- The extension to extract [None]
- filename
- The name of the associated file [None]
- globalname
- The name used to store and retrieve file to and from Storage [None]
- imstat
- Image statistics for the frame [None]
- instrument
- Information about the instrument [None]
- is_valid
- Manual/external flag to disqualify bad data (SuperFlag) [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
- observing_block
- Information about the observing block [None]
- overscan_x_stat
- Statistics of the overscan region in the x-direction [None]
- overscan_y_stat
- Statistics of the overscan region in the x-direction [None]
- prescan_x_stat
- Statistics of the prescan region in the x-direction [None]
- prescan_y_stat
- Statistics of the prescan region in the y-direction [None]
- process_status
- A flag indicating the processing status [None]
- quality_flags
- Automatic/internal quality flag [None]
- raw_fits_data
- The multi-extension raw image [None]
- template
- Information about the template [None]
Methods inherited from RawFrame:
- build_header(self)
- check_dimensions(self)
- Check that the raw (untrimmed) image has the size defined in its
chip. The method is private.
The Chip attributes used in this method are now part this class.
This method may be superfluous.
- copy_attributes(self)
- do_statistics(self)
- Determine the image statistics for the trim, prescan and overscan
regions.
- do_trim_and_overscan_correction(self, overscan_parameter=0)
- Replace image with a trimmed and overscan corrected version of
itself.
Requires:
chip -- A Chip object describing the pre/overscan layout
Argument:
overscan_parameter -- which overscan correction to use:
0 -- No overscan correction
1 -- Use median of prescan_x
2 -- Use median of overscan_x
3 -- Use median of prescan_y
4 -- Use median of overscan_y
5 -- Use per-row value of prescan_x
6 -- Use per-row value of overscan_x (default)
7 -- Use per-row average of prescan_x, smoothing the averages
over ~50 rows
8 -- Use per-row average of overscan_x, smoothing the
averages over ~50 rows
9 -- Use per-row average of prescan_x, smoothing the averages
over ~10 rows
10 -- Use per-row average of overscan_x, smoothing the
averages over ~10 rows
11 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions)
12 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~50 rows
13 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~10 rows
This method loads a raw image, trims it and (optionally) performs an
overscan correction, using the statics of the pre- and overscan
regions. This can be done with a single value for the whole image or
on a per-row basis.
Methods 1-4 assume that do_statistics() has been run.
- extract_extension(self)
- extract_header(self)
- get_orientation(self)
- Temporary fix to make sure the frame's orientation is always known
if obtainable.
- get_overscan_x_region(self)
- Return the fits coordinates of the overscan region in the x
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_overscan_y_region(self)
- Return the fits coordinates of the overscan region in the y
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_prescan_x_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_prescan_y_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_trim_region(self)
- Return a tuple of the FITS coordinates of the trim section.
The method returns (x0, y0, x1, y1), where the trim region is
[x0:x1, y0:y1]. This follows the eclipse coordinate ordering
conventions such that
>>> ima = eclipse.image("aaa.fits")
>>> ima.extract_region(*achip.get_trim_region())
extracts the trim section from image aaa.fits.
- get_trimmed_size(self)
- Returns the size of the image in pixels after it has been trimmed.
- has_overscan_x_region(self)
- This method is used to ask the image whether it has an overscan_x
region or not. The return type is Boolean.
- has_overscan_y_region(self)
- This method is used to ask the image whether it has an overscan_y
region or not. The return type is Boolean.
- has_prescan_x_region(self)
- This method is used to ask the image whether it has a prescan_x
region or not. The return type is Boolean.
- has_prescan_y_region(self)
- This method is used to ask the image whether it has a prescan_y
region or not. The return type is Boolean.
- initialize_overscan_attribute(self)
- This method is used to set the "overscan_x_stat" and
"overscan_y_stat" attributes of the RawFrame from the header. This
initializer is specific for RawFrame objects. The method is private.
- initialize_prescan_attribute(self)
- This method is used to set the "prescan_x_stat" and "prescan_y_stat"
attributes of the RawFrame from the header. This initializer is
specific for RawFrame objects. The method is private
- make(self)
- Make a RawFrame object by extracting the data from the proper
extension of the RawFitsData object.
Required inputs:
raw_fits_data -- the unsplit data
extension -- the extension to be extracted
- read_header(self)
- Extends the read_header method of BaseFrame. The method is private.
- set_all_caps_attributes_from_header(self)
- set_chip_and_filter_attributes_from_header(self)
- set_rawframe_specific_attributes_from_header(self)
- This method takes care of setting those attributes of the RawFrame
that are specific for the particular sub-class at hand. This method
should be fully implemented where this is needed. Example:
RawScienceFrame.
Data and other attributes inherited from RawFrame:
- PROCESS_TIME = 250
- orientation = -1
Methods inherited from astro.main.BaseFrame.BaseFrame:
- __init__(self, **kw)
- commit_subwinstat(self)
- Conditionally commit subwindow statistics
- display(self, viewer='skycat', filename=None)
- Independent display method for all frames.
- empty_header(self)
- Initalize to a default (empty) header
- estimate_statistics(self, pixmap=None, zone=None, max_iter=5, threshold=5.0)
- Estimate the mean, median and stddev, by iteratively excluding
pixelvalues deviating too far from the median
Arguments:
pixmap -- optional map for bad pixels (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
max_iter -- The maximum number of iterations
sig_thresh -- The threshold in number of standard deviations
- get_previous_version(self, level=0)
- Return previous version of this object. If it does not exist,
return None.
level: depth of query for previous version (0 goes as deep as
possible)
- initialize_astrom_attribute(self)
- initialize_chip_attribute(self)
- initialize_filter_attribute(self)
- initialize_imstat_attribute(self)
- initialize_instrument_attribute(self)
- initialize_lamp_attribute(self)
- initialize_observingblock_attribute(self)
- initialize_template_attribute(self)
- inspect(self, pixels=None, zone=None, kappa=3.0, iterations=2, cmap=None, vmin=None, vmax=None, interpolation='lanczos', width=6, ratio=None, viewer='skycat', force_figure=False, force_viewer=False, subplot_size=50, contour_levels=20, num_bins=100, extension=None, compare=False, level=0, other=None, clip=False, color=False)
- Optional visual inspection for quality control displays image in a
PyLab (MatPlotLib) window or optionally in an external viewer.
pixels: optional list or array representing the image to be
inspected (can be MxN for greyscale, or MxNx3 for RGB)
zone: tuple of (x0, y0, x1, y1) representing the image
coordinates of the two oposing corners of the sub
image to consider
kappa: the factor by which the dynamic range is increased in
units of sigma (0 gives full range)
iterations: number of iterations in the kappa-sigma range clipping
cmap: PyLab color map instance
vmin: lower display range in native units (e.g. ADU)
vmax: upper display range in native units (e.g. ADU)
interpolation: type of interpolation the PyLab viewer uses (nearest,
bilinear, etc.)
width: width of the PyLab figure window (in inches)
ratio: ratio by which to scale the figure height (default:
x_dim/y_dim)
viewer: external viewer to use in case the image is too large
force_figure: always use the PyLab figure window (Be Careful!
Statistics calculations on large images can be very
time and memory consuming.)
force_viewer: always use the viewer
subplot_size: width and height in pixels of region of interest
contour_levels: number of contour levels for the contour plot of the
region of interest
num_bins: number of bins in the histogram plot
extension: extension of the filetype to save plot to (png, ps,
or eps) None disables saving
compare: compare this frame to its previous version using
difference imaging (current-previous), pixels is
ignored
level: depth of query for previous version (0 goes as deep
as possible) when compare is True
other: a second of the same type of Frame object to replace
previous when compare is True (if color is True,
other can be a list of two images)
clip: kappa-sigma clip each image prior to subtraction when
compare is True
color: use color combining (RGB) instead of differencing
when compare is True (kappa, vmin/vmax only honored
when clip is True), this image is R, other is B if
single, other is [G, B] if it is a list
(EXPERIMENTAL)
When force_viewer is False, inspect() displays basic image
statistics (mean, stddev) and then a representation of the image
that can be zoomed and panned. Pressing various keys will give
different results described below in a region of interest described
by subplot_size:
q - closes the most recent plot window when pressed in the
main window
[space] - displays the X and Y coordinate (FITS standard unit
indexed) and the count level
a - performs aperture photometry on brightest feature in the
region of interest (NOT YET IMPLEMENTED)
c - displays a contour plot of the region of interest (see
contour_levels)
h - displays a histogram of the pixel values of the region of
interest (see num_bins)
r - displays a radial plot of the brightest feature in the
region of interest
s - displays a surface plot of the region of interest
p - displays profile plots in both X and Y dimensions versus
intensity (count level)
NOTE: None of the commands above work in the subplots.
- is_compressed(self)
- Find out if a FITS file is compressed
- load_header(self)
- Initialize self.header
- load_image(self, readonly=0)
- Initialize self.image.
- make_background(self)
- Make a background image,
Returns a new BaseFrame object. The name of the new file is
"name.back.fits"
- make_subwinstat(self)
- Compute statistics on subwindows
- retrieve(self)
- Retrieve this frame from the data server and uncompress it if it has
been compressed with FITSIO.
- save(self, filename='', overwrite=1)
- statistics(self, pixmap=None, zone=None)
- Compute statistics and store in self.imstat.
Arguments:
pixmap -- optional pixelmap object (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
- update_header(self)
- Update a header with values from descriptors
- update_history(self)
- Update a header with history
History is maintained in the instance attribute
history. History is written by appending string to the history
list.
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)
- 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 0x1235830>
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 0xbce170>
- pickle_id = None
Methods inherited from astro.main.ProcessTarget.ProcessTarget:
- check_observing_blocks(self, childs)
- check if all childs have the same observing_block
- check_templates(self, childs)
- check if all childs have the same template
- compare(self)
- Quality Control -- basic trend analysis
The compare() method is used for default trend analysis. This
is done by comparing with a previous version of the same
object (last weeks bias, for example). This may be as simple
as comparing attribute values, but may also involve more
complex computations (e.g., subtracting the two images, and
analysing the residuals)
- derive_timestamp(self)
- Set the creation_date attribute
- get_dependencies(self)
- Return a list of names of attributes that are required for make()
- get_qcflags_set(self)
- Return a list of names of flags that have been set.
- get_qcflags_set_dict(self)
- Return a dictionary of flags that have been set. The key is the
name, the value is a tuple of (index, docstring).
- is_compared(self)
- Return true if the object has been compared
- is_inspected(self)
- Return true if the object has been inspected
- is_made(self)
- Return true if the object has been made
- is_ok(self)
- Return true if no quality control flags have been set.
- is_verified(self)
- Return true if the object has been verified
- set_compared(self)
- Set the process status to indicate that the object has been
compared.
- set_inspected(self)
- Set the process status to indicate that the object has been
inspected.
- set_made(self)
- Set the process tatus to indicate that the object has been made
- set_verified(self)
- Set the process status to indicate that the object has been
verified.
Class methods inherited from astro.main.ProcessTarget.ProcessTarget:
- get_qcflags(cls) from common.database.DBMeta.DBObjectMeta
- Return a list of attribute names of QCflag() objects.
- select(cls, **searchterms) from common.database.DBMeta.DBObjectMeta
- Class method to select RawFrames, Calfiles and ReducedScienceFrames
from the database.
Syntax example:
q = RawScienceFrame.select(instrument='WFI', filter='#842',
chip='ccd50', time_from='2000-01-02 04:45:46',
time_to='2000-01-02 05:03:00')
Possible search terms:
----------------------
check_quality - (Default 1) Exclude invalidated data (quality_flags!=0)
check_validity - (Default 1) Exclude invalidated data (is_valid=0)
chip - select of the same CCD ('ccd50', 'ccd51', etc.)
date - select of the same date (i.e. date at the start of
observing night, in yyyy-mm-dd format)
exptime - select frames with similar exposure time
(EXPTIME-0.8sec to EXPTIME+0.8 sec)
extension - select (raw) frames for a certain extension of its
RawFitsData object
filename - select a frame(!) by its filename
filter - select of the same filter ('#842', '#843', etc.)
instrument - select of the same instrument ('WFI', 'WFC', 'OCAM')
object - select for OBJECT header keyword, uses "like"
functionality, which allows wildcards "*" and "?"
time_from - precise form of date, in yyyy-mm-dd hh:mm:ss format
time_to - required when using time_from
- select_for_raw(cls, raw, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Class method to select the most recent valid calfile for the
provided raw frame from the database.
- select_for_reduced(cls, reduced, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Synonym for the select_for_raw method; the implementation should
be identical.
Data and other attributes inherited from astro.main.ProcessTarget.ProcessTarget:
- STATUS_COMPARE = 2
- STATUS_INSPECT = 3
- STATUS_MAKE = 0
- STATUS_VERIFY = 1
Class methods inherited from common.database.DBMeta.DBMixin:
- get_persistent_attributes(cls) from common.database.DBMeta.DBObjectMeta
- return a list of persistent attributes
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:
- 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 RawDomeFlatFrame(RawFrame) |
| | |
- Method resolution order:
- RawDomeFlatFrame
- RawFrame
- astro.main.BaseFrame.BaseFrame
- common.database.DataObject.DataObject
- common.database.DBMain.DBObject
- astro.main.ProcessTarget.ProcessTarget
- common.database.DBMeta.DBMixin
- __builtin__.object
- astro.main.OnTheFly.OnTheFly
Methods defined here:
- __init__(self, pathname='')
- set_rawframe_specific_attributes_from_header(self)
- This method sets the "lamp" attribute which is specific for the
RawDomeFlatFrame.
- verify(self)
- Verify the flat.
The following flags may be set in the status attribute:
MEAN_LOW -- mean < 5000.0
MEAN_HIGH -- mean > 45000.0
Data descriptors defined here:
- DATE
- UTC date the original data file was saved [None]
- DATE_OBS
- UTC date at the start of the observation [None]
- EXPTIME
- Total observation time [sec]
- LST
- Local sidereal time at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- MEAN_HIGH
- MEAN_LOW
- MJD_OBS
- Modified Julian date at the start of the observation (JD-2400000.5) [day]
- NAXIS1
- Length of data in axis 1 [pixel]
- NAXIS2
- Length of data in axis 2 [pixel]
- OBJECT
- Object name [None]
- OBSERVER
- The observer [None]
- OVSCX
- Number of overscan pixels in the x direction [pixel]
- OVSCXPRE
- Number of overscan pixels to skip in the x direction at the edge of the chip [pixel]
- OVSCXPST
- Number of overscan pixels to skip in the x direction at the edge of the data region [pixel]
- OVSCY
- Number of overscan pixels in the y direction [pixel]
- OVSCYPRE
- Number of overscan pixels to skip in the y direction at the edge of the chip [pixel]
- OVSCYPST
- Number of overscan pixels to skip in the y direction at the edge of the data region [pixel]
- PRSCX
- Number of prescan pixels in the x-direction [pixel]
- PRSCXPRE
- Number of prescan pixels to skip in the x-direction at the edge of the chip [pixel]
- PRSCXPST
- Number of prescan pixels to skip in the x-direction at the edge of the data region [pixel]
- PRSCY
- Number of prescan pixels in the y-direction [pixel]
- PRSCYPRE
- Number of prescan pixels to skip in the y-direction at the edge of the chip [pixel]
- PRSCYPST
- Number of prescan pixels to skip in the y-direction at the edge of the data region [pixel]
- UTC
- Universal Coordinated Time (UTC) at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- chip
- Information about the chip [None]
- creation_date
- Date this object was created [None]
- extension
- The extension to extract [None]
- filename
- The name of the associated file [None]
- filter
- Information about the filter [None]
- globalname
- The name used to store and retrieve file to and from Storage [None]
- imstat
- Image statistics for the frame [None]
- instrument
- Information about the instrument [None]
- is_valid
- Manual/external flag to disqualify bad data (SuperFlag) [None]
- lamp
- Information about the lamp [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
- observing_block
- Information about the observing block [None]
- overscan_x_stat
- Statistics of the overscan region in the x-direction [None]
- overscan_y_stat
- Statistics of the overscan region in the x-direction [None]
- prescan_x_stat
- Statistics of the prescan region in the x-direction [None]
- prescan_y_stat
- Statistics of the prescan region in the y-direction [None]
- process_params
- Processing Parameters [None]
- process_status
- A flag indicating the processing status [None]
- quality_flags
- Automatic/internal quality flag [None]
- raw_fits_data
- The multi-extension raw image [None]
- template
- Information about the template [None]
Methods inherited from RawFrame:
- build_header(self)
- check_dimensions(self)
- Check that the raw (untrimmed) image has the size defined in its
chip. The method is private.
The Chip attributes used in this method are now part this class.
This method may be superfluous.
- copy_attributes(self)
- do_statistics(self)
- Determine the image statistics for the trim, prescan and overscan
regions.
- do_trim_and_overscan_correction(self, overscan_parameter=0)
- Replace image with a trimmed and overscan corrected version of
itself.
Requires:
chip -- A Chip object describing the pre/overscan layout
Argument:
overscan_parameter -- which overscan correction to use:
0 -- No overscan correction
1 -- Use median of prescan_x
2 -- Use median of overscan_x
3 -- Use median of prescan_y
4 -- Use median of overscan_y
5 -- Use per-row value of prescan_x
6 -- Use per-row value of overscan_x (default)
7 -- Use per-row average of prescan_x, smoothing the averages
over ~50 rows
8 -- Use per-row average of overscan_x, smoothing the
averages over ~50 rows
9 -- Use per-row average of prescan_x, smoothing the averages
over ~10 rows
10 -- Use per-row average of overscan_x, smoothing the
averages over ~10 rows
11 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions)
12 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~50 rows
13 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~10 rows
This method loads a raw image, trims it and (optionally) performs an
overscan correction, using the statics of the pre- and overscan
regions. This can be done with a single value for the whole image or
on a per-row basis.
Methods 1-4 assume that do_statistics() has been run.
- extract_extension(self)
- extract_header(self)
- get_orientation(self)
- Temporary fix to make sure the frame's orientation is always known
if obtainable.
- get_overscan_x_region(self)
- Return the fits coordinates of the overscan region in the x
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_overscan_y_region(self)
- Return the fits coordinates of the overscan region in the y
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_prescan_x_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_prescan_y_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_trim_region(self)
- Return a tuple of the FITS coordinates of the trim section.
The method returns (x0, y0, x1, y1), where the trim region is
[x0:x1, y0:y1]. This follows the eclipse coordinate ordering
conventions such that
>>> ima = eclipse.image("aaa.fits")
>>> ima.extract_region(*achip.get_trim_region())
extracts the trim section from image aaa.fits.
- get_trimmed_size(self)
- Returns the size of the image in pixels after it has been trimmed.
- has_overscan_x_region(self)
- This method is used to ask the image whether it has an overscan_x
region or not. The return type is Boolean.
- has_overscan_y_region(self)
- This method is used to ask the image whether it has an overscan_y
region or not. The return type is Boolean.
- has_prescan_x_region(self)
- This method is used to ask the image whether it has a prescan_x
region or not. The return type is Boolean.
- has_prescan_y_region(self)
- This method is used to ask the image whether it has a prescan_y
region or not. The return type is Boolean.
- initialize_overscan_attribute(self)
- This method is used to set the "overscan_x_stat" and
"overscan_y_stat" attributes of the RawFrame from the header. This
initializer is specific for RawFrame objects. The method is private.
- initialize_prescan_attribute(self)
- This method is used to set the "prescan_x_stat" and "prescan_y_stat"
attributes of the RawFrame from the header. This initializer is
specific for RawFrame objects. The method is private
- make(self)
- Make a RawFrame object by extracting the data from the proper
extension of the RawFitsData object.
Required inputs:
raw_fits_data -- the unsplit data
extension -- the extension to be extracted
- read_header(self)
- Extends the read_header method of BaseFrame. The method is private.
- set_all_caps_attributes_from_header(self)
- set_chip_and_filter_attributes_from_header(self)
Data and other attributes inherited from RawFrame:
- PROCESS_TIME = 250
- orientation = -1
Methods inherited from astro.main.BaseFrame.BaseFrame:
- commit_subwinstat(self)
- Conditionally commit subwindow statistics
- display(self, viewer='skycat', filename=None)
- Independent display method for all frames.
- empty_header(self)
- Initalize to a default (empty) header
- estimate_statistics(self, pixmap=None, zone=None, max_iter=5, threshold=5.0)
- Estimate the mean, median and stddev, by iteratively excluding
pixelvalues deviating too far from the median
Arguments:
pixmap -- optional map for bad pixels (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
max_iter -- The maximum number of iterations
sig_thresh -- The threshold in number of standard deviations
- get_previous_version(self, level=0)
- Return previous version of this object. If it does not exist,
return None.
level: depth of query for previous version (0 goes as deep as
possible)
- initialize_astrom_attribute(self)
- initialize_chip_attribute(self)
- initialize_filter_attribute(self)
- initialize_imstat_attribute(self)
- initialize_instrument_attribute(self)
- initialize_lamp_attribute(self)
- initialize_observingblock_attribute(self)
- initialize_template_attribute(self)
- inspect(self, pixels=None, zone=None, kappa=3.0, iterations=2, cmap=None, vmin=None, vmax=None, interpolation='lanczos', width=6, ratio=None, viewer='skycat', force_figure=False, force_viewer=False, subplot_size=50, contour_levels=20, num_bins=100, extension=None, compare=False, level=0, other=None, clip=False, color=False)
- Optional visual inspection for quality control displays image in a
PyLab (MatPlotLib) window or optionally in an external viewer.
pixels: optional list or array representing the image to be
inspected (can be MxN for greyscale, or MxNx3 for RGB)
zone: tuple of (x0, y0, x1, y1) representing the image
coordinates of the two oposing corners of the sub
image to consider
kappa: the factor by which the dynamic range is increased in
units of sigma (0 gives full range)
iterations: number of iterations in the kappa-sigma range clipping
cmap: PyLab color map instance
vmin: lower display range in native units (e.g. ADU)
vmax: upper display range in native units (e.g. ADU)
interpolation: type of interpolation the PyLab viewer uses (nearest,
bilinear, etc.)
width: width of the PyLab figure window (in inches)
ratio: ratio by which to scale the figure height (default:
x_dim/y_dim)
viewer: external viewer to use in case the image is too large
force_figure: always use the PyLab figure window (Be Careful!
Statistics calculations on large images can be very
time and memory consuming.)
force_viewer: always use the viewer
subplot_size: width and height in pixels of region of interest
contour_levels: number of contour levels for the contour plot of the
region of interest
num_bins: number of bins in the histogram plot
extension: extension of the filetype to save plot to (png, ps,
or eps) None disables saving
compare: compare this frame to its previous version using
difference imaging (current-previous), pixels is
ignored
level: depth of query for previous version (0 goes as deep
as possible) when compare is True
other: a second of the same type of Frame object to replace
previous when compare is True (if color is True,
other can be a list of two images)
clip: kappa-sigma clip each image prior to subtraction when
compare is True
color: use color combining (RGB) instead of differencing
when compare is True (kappa, vmin/vmax only honored
when clip is True), this image is R, other is B if
single, other is [G, B] if it is a list
(EXPERIMENTAL)
When force_viewer is False, inspect() displays basic image
statistics (mean, stddev) and then a representation of the image
that can be zoomed and panned. Pressing various keys will give
different results described below in a region of interest described
by subplot_size:
q - closes the most recent plot window when pressed in the
main window
[space] - displays the X and Y coordinate (FITS standard unit
indexed) and the count level
a - performs aperture photometry on brightest feature in the
region of interest (NOT YET IMPLEMENTED)
c - displays a contour plot of the region of interest (see
contour_levels)
h - displays a histogram of the pixel values of the region of
interest (see num_bins)
r - displays a radial plot of the brightest feature in the
region of interest
s - displays a surface plot of the region of interest
p - displays profile plots in both X and Y dimensions versus
intensity (count level)
NOTE: None of the commands above work in the subplots.
- is_compressed(self)
- Find out if a FITS file is compressed
- load_header(self)
- Initialize self.header
- load_image(self, readonly=0)
- Initialize self.image.
- make_background(self)
- Make a background image,
Returns a new BaseFrame object. The name of the new file is
"name.back.fits"
- make_subwinstat(self)
- Compute statistics on subwindows
- retrieve(self)
- Retrieve this frame from the data server and uncompress it if it has
been compressed with FITSIO.
- save(self, filename='', overwrite=1)
- statistics(self, pixmap=None, zone=None)
- Compute statistics and store in self.imstat.
Arguments:
pixmap -- optional pixelmap object (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
- update_header(self)
- Update a header with values from descriptors
- update_history(self)
- Update a header with history
History is maintained in the instance attribute
history. History is written by appending string to the history
list.
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)
- 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 0x1235830>
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 0xbce170>
- pickle_id = None
Methods inherited from astro.main.ProcessTarget.ProcessTarget:
- check_observing_blocks(self, childs)
- check if all childs have the same observing_block
- check_templates(self, childs)
- check if all childs have the same template
- compare(self)
- Quality Control -- basic trend analysis
The compare() method is used for default trend analysis. This
is done by comparing with a previous version of the same
object (last weeks bias, for example). This may be as simple
as comparing attribute values, but may also involve more
complex computations (e.g., subtracting the two images, and
analysing the residuals)
- derive_timestamp(self)
- Set the creation_date attribute
- get_dependencies(self)
- Return a list of names of attributes that are required for make()
- get_qcflags_set(self)
- Return a list of names of flags that have been set.
- get_qcflags_set_dict(self)
- Return a dictionary of flags that have been set. The key is the
name, the value is a tuple of (index, docstring).
- is_compared(self)
- Return true if the object has been compared
- is_inspected(self)
- Return true if the object has been inspected
- is_made(self)
- Return true if the object has been made
- is_ok(self)
- Return true if no quality control flags have been set.
- is_verified(self)
- Return true if the object has been verified
- set_compared(self)
- Set the process status to indicate that the object has been
compared.
- set_inspected(self)
- Set the process status to indicate that the object has been
inspected.
- set_made(self)
- Set the process tatus to indicate that the object has been made
- set_verified(self)
- Set the process status to indicate that the object has been
verified.
Class methods inherited from astro.main.ProcessTarget.ProcessTarget:
- get_qcflags(cls) from common.database.DBMeta.DBObjectMeta
- Return a list of attribute names of QCflag() objects.
- select(cls, **searchterms) from common.database.DBMeta.DBObjectMeta
- Class method to select RawFrames, Calfiles and ReducedScienceFrames
from the database.
Syntax example:
q = RawScienceFrame.select(instrument='WFI', filter='#842',
chip='ccd50', time_from='2000-01-02 04:45:46',
time_to='2000-01-02 05:03:00')
Possible search terms:
----------------------
check_quality - (Default 1) Exclude invalidated data (quality_flags!=0)
check_validity - (Default 1) Exclude invalidated data (is_valid=0)
chip - select of the same CCD ('ccd50', 'ccd51', etc.)
date - select of the same date (i.e. date at the start of
observing night, in yyyy-mm-dd format)
exptime - select frames with similar exposure time
(EXPTIME-0.8sec to EXPTIME+0.8 sec)
extension - select (raw) frames for a certain extension of its
RawFitsData object
filename - select a frame(!) by its filename
filter - select of the same filter ('#842', '#843', etc.)
instrument - select of the same instrument ('WFI', 'WFC', 'OCAM')
object - select for OBJECT header keyword, uses "like"
functionality, which allows wildcards "*" and "?"
time_from - precise form of date, in yyyy-mm-dd hh:mm:ss format
time_to - required when using time_from
- select_for_raw(cls, raw, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Class method to select the most recent valid calfile for the
provided raw frame from the database.
- select_for_reduced(cls, reduced, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Synonym for the select_for_raw method; the implementation should
be identical.
Data and other attributes inherited from astro.main.ProcessTarget.ProcessTarget:
- STATUS_COMPARE = 2
- STATUS_INSPECT = 3
- STATUS_MAKE = 0
- STATUS_VERIFY = 1
Class methods inherited from common.database.DBMeta.DBMixin:
- get_persistent_attributes(cls) from common.database.DBMeta.DBObjectMeta
- return a list of persistent attributes
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:
- 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 RawDomeFlatFrameParameters(common.database.DBMain.DBObject) |
| | |
- Method resolution order:
- RawDomeFlatFrameParameters
- common.database.DBMain.DBObject
- __builtin__.object
Data descriptors defined here:
- MAX_FLAT_MEAN
- QC: maximum mean value of the flat [ADU]
- MIN_FLAT_MEAN
- QC: minimum mean value of the flat [ADU]
- 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 0xbce170>
- pickle_id = None
|
class RawFrame(astro.main.BaseFrame.BaseFrame) |
| | |
- Method resolution order:
- RawFrame
- astro.main.BaseFrame.BaseFrame
- common.database.DataObject.DataObject
- common.database.DBMain.DBObject
- astro.main.ProcessTarget.ProcessTarget
- common.database.DBMeta.DBMixin
- __builtin__.object
- astro.main.OnTheFly.OnTheFly
Methods defined here:
- build_header(self)
- check_dimensions(self)
- Check that the raw (untrimmed) image has the size defined in its
chip. The method is private.
The Chip attributes used in this method are now part this class.
This method may be superfluous.
- copy_attributes(self)
- do_statistics(self)
- Determine the image statistics for the trim, prescan and overscan
regions.
- do_trim_and_overscan_correction(self, overscan_parameter=0)
- Replace image with a trimmed and overscan corrected version of
itself.
Requires:
chip -- A Chip object describing the pre/overscan layout
Argument:
overscan_parameter -- which overscan correction to use:
0 -- No overscan correction
1 -- Use median of prescan_x
2 -- Use median of overscan_x
3 -- Use median of prescan_y
4 -- Use median of overscan_y
5 -- Use per-row value of prescan_x
6 -- Use per-row value of overscan_x (default)
7 -- Use per-row average of prescan_x, smoothing the averages
over ~50 rows
8 -- Use per-row average of overscan_x, smoothing the
averages over ~50 rows
9 -- Use per-row average of prescan_x, smoothing the averages
over ~10 rows
10 -- Use per-row average of overscan_x, smoothing the
averages over ~10 rows
11 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions)
12 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~50 rows
13 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~10 rows
This method loads a raw image, trims it and (optionally) performs an
overscan correction, using the statics of the pre- and overscan
regions. This can be done with a single value for the whole image or
on a per-row basis.
Methods 1-4 assume that do_statistics() has been run.
- extract_extension(self)
- extract_header(self)
- get_orientation(self)
- Temporary fix to make sure the frame's orientation is always known
if obtainable.
- get_overscan_x_region(self)
- Return the fits coordinates of the overscan region in the x
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_overscan_y_region(self)
- Return the fits coordinates of the overscan region in the y
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_prescan_x_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_prescan_y_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_trim_region(self)
- Return a tuple of the FITS coordinates of the trim section.
The method returns (x0, y0, x1, y1), where the trim region is
[x0:x1, y0:y1]. This follows the eclipse coordinate ordering
conventions such that
>>> ima = eclipse.image("aaa.fits")
>>> ima.extract_region(*achip.get_trim_region())
extracts the trim section from image aaa.fits.
- get_trimmed_size(self)
- Returns the size of the image in pixels after it has been trimmed.
- has_overscan_x_region(self)
- This method is used to ask the image whether it has an overscan_x
region or not. The return type is Boolean.
- has_overscan_y_region(self)
- This method is used to ask the image whether it has an overscan_y
region or not. The return type is Boolean.
- has_prescan_x_region(self)
- This method is used to ask the image whether it has a prescan_x
region or not. The return type is Boolean.
- has_prescan_y_region(self)
- This method is used to ask the image whether it has a prescan_y
region or not. The return type is Boolean.
- initialize_overscan_attribute(self)
- This method is used to set the "overscan_x_stat" and
"overscan_y_stat" attributes of the RawFrame from the header. This
initializer is specific for RawFrame objects. The method is private.
- initialize_prescan_attribute(self)
- This method is used to set the "prescan_x_stat" and "prescan_y_stat"
attributes of the RawFrame from the header. This initializer is
specific for RawFrame objects. The method is private
- make(self)
- Make a RawFrame object by extracting the data from the proper
extension of the RawFitsData object.
Required inputs:
raw_fits_data -- the unsplit data
extension -- the extension to be extracted
- read_header(self)
- Extends the read_header method of BaseFrame. The method is private.
- set_all_caps_attributes_from_header(self)
- set_chip_and_filter_attributes_from_header(self)
- set_rawframe_specific_attributes_from_header(self)
- This method takes care of setting those attributes of the RawFrame
that are specific for the particular sub-class at hand. This method
should be fully implemented where this is needed. Example:
RawScienceFrame.
Data descriptors defined here:
- DATE
- UTC date the original data file was saved [None]
- DATE_OBS
- UTC date at the start of the observation [None]
- LST
- Local sidereal time at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- MJD_OBS
- Modified Julian date at the start of the observation (JD-2400000.5) [day]
- NAXIS1
- Length of data in axis 1 [pixel]
- NAXIS2
- Length of data in axis 2 [pixel]
- OBJECT
- Object name [None]
- OBSERVER
- The observer [None]
- OVSCX
- Number of overscan pixels in the x direction [pixel]
- OVSCXPRE
- Number of overscan pixels to skip in the x direction at the edge of the chip [pixel]
- OVSCXPST
- Number of overscan pixels to skip in the x direction at the edge of the data region [pixel]
- OVSCY
- Number of overscan pixels in the y direction [pixel]
- OVSCYPRE
- Number of overscan pixels to skip in the y direction at the edge of the chip [pixel]
- OVSCYPST
- Number of overscan pixels to skip in the y direction at the edge of the data region [pixel]
- PRSCX
- Number of prescan pixels in the x-direction [pixel]
- PRSCXPRE
- Number of prescan pixels to skip in the x-direction at the edge of the chip [pixel]
- PRSCXPST
- Number of prescan pixels to skip in the x-direction at the edge of the data region [pixel]
- PRSCY
- Number of prescan pixels in the y-direction [pixel]
- PRSCYPRE
- Number of prescan pixels to skip in the y-direction at the edge of the chip [pixel]
- PRSCYPST
- Number of prescan pixels to skip in the y-direction at the edge of the data region [pixel]
- UTC
- Universal Coordinated Time (UTC) at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- chip
- Information about the chip [None]
- creation_date
- Date this object was created [None]
- extension
- The extension to extract [None]
- filename
- The name of the associated file [None]
- globalname
- The name used to store and retrieve file to and from Storage [None]
- imstat
- Image statistics for the frame [None]
- instrument
- Information about the instrument [None]
- is_valid
- Manual/external flag to disqualify bad data (SuperFlag) [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
- observing_block
- Information about the observing block [None]
- overscan_x_stat
- Statistics of the overscan region in the x-direction [None]
- overscan_y_stat
- Statistics of the overscan region in the x-direction [None]
- prescan_x_stat
- Statistics of the prescan region in the x-direction [None]
- prescan_y_stat
- Statistics of the prescan region in the y-direction [None]
- process_status
- A flag indicating the processing status [None]
- quality_flags
- Automatic/internal quality flag [None]
- raw_fits_data
- The multi-extension raw image [None]
- template
- Information about the template [None]
Data and other attributes defined here:
- PROCESS_TIME = 250
- orientation = -1
Methods inherited from astro.main.BaseFrame.BaseFrame:
- __init__(self, **kw)
- commit_subwinstat(self)
- Conditionally commit subwindow statistics
- display(self, viewer='skycat', filename=None)
- Independent display method for all frames.
- empty_header(self)
- Initalize to a default (empty) header
- estimate_statistics(self, pixmap=None, zone=None, max_iter=5, threshold=5.0)
- Estimate the mean, median and stddev, by iteratively excluding
pixelvalues deviating too far from the median
Arguments:
pixmap -- optional map for bad pixels (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
max_iter -- The maximum number of iterations
sig_thresh -- The threshold in number of standard deviations
- get_previous_version(self, level=0)
- Return previous version of this object. If it does not exist,
return None.
level: depth of query for previous version (0 goes as deep as
possible)
- initialize_astrom_attribute(self)
- initialize_chip_attribute(self)
- initialize_filter_attribute(self)
- initialize_imstat_attribute(self)
- initialize_instrument_attribute(self)
- initialize_lamp_attribute(self)
- initialize_observingblock_attribute(self)
- initialize_template_attribute(self)
- inspect(self, pixels=None, zone=None, kappa=3.0, iterations=2, cmap=None, vmin=None, vmax=None, interpolation='lanczos', width=6, ratio=None, viewer='skycat', force_figure=False, force_viewer=False, subplot_size=50, contour_levels=20, num_bins=100, extension=None, compare=False, level=0, other=None, clip=False, color=False)
- Optional visual inspection for quality control displays image in a
PyLab (MatPlotLib) window or optionally in an external viewer.
pixels: optional list or array representing the image to be
inspected (can be MxN for greyscale, or MxNx3 for RGB)
zone: tuple of (x0, y0, x1, y1) representing the image
coordinates of the two oposing corners of the sub
image to consider
kappa: the factor by which the dynamic range is increased in
units of sigma (0 gives full range)
iterations: number of iterations in the kappa-sigma range clipping
cmap: PyLab color map instance
vmin: lower display range in native units (e.g. ADU)
vmax: upper display range in native units (e.g. ADU)
interpolation: type of interpolation the PyLab viewer uses (nearest,
bilinear, etc.)
width: width of the PyLab figure window (in inches)
ratio: ratio by which to scale the figure height (default:
x_dim/y_dim)
viewer: external viewer to use in case the image is too large
force_figure: always use the PyLab figure window (Be Careful!
Statistics calculations on large images can be very
time and memory consuming.)
force_viewer: always use the viewer
subplot_size: width and height in pixels of region of interest
contour_levels: number of contour levels for the contour plot of the
region of interest
num_bins: number of bins in the histogram plot
extension: extension of the filetype to save plot to (png, ps,
or eps) None disables saving
compare: compare this frame to its previous version using
difference imaging (current-previous), pixels is
ignored
level: depth of query for previous version (0 goes as deep
as possible) when compare is True
other: a second of the same type of Frame object to replace
previous when compare is True (if color is True,
other can be a list of two images)
clip: kappa-sigma clip each image prior to subtraction when
compare is True
color: use color combining (RGB) instead of differencing
when compare is True (kappa, vmin/vmax only honored
when clip is True), this image is R, other is B if
single, other is [G, B] if it is a list
(EXPERIMENTAL)
When force_viewer is False, inspect() displays basic image
statistics (mean, stddev) and then a representation of the image
that can be zoomed and panned. Pressing various keys will give
different results described below in a region of interest described
by subplot_size:
q - closes the most recent plot window when pressed in the
main window
[space] - displays the X and Y coordinate (FITS standard unit
indexed) and the count level
a - performs aperture photometry on brightest feature in the
region of interest (NOT YET IMPLEMENTED)
c - displays a contour plot of the region of interest (see
contour_levels)
h - displays a histogram of the pixel values of the region of
interest (see num_bins)
r - displays a radial plot of the brightest feature in the
region of interest
s - displays a surface plot of the region of interest
p - displays profile plots in both X and Y dimensions versus
intensity (count level)
NOTE: None of the commands above work in the subplots.
- is_compressed(self)
- Find out if a FITS file is compressed
- load_header(self)
- Initialize self.header
- load_image(self, readonly=0)
- Initialize self.image.
- make_background(self)
- Make a background image,
Returns a new BaseFrame object. The name of the new file is
"name.back.fits"
- make_subwinstat(self)
- Compute statistics on subwindows
- retrieve(self)
- Retrieve this frame from the data server and uncompress it if it has
been compressed with FITSIO.
- save(self, filename='', overwrite=1)
- statistics(self, pixmap=None, zone=None)
- Compute statistics and store in self.imstat.
Arguments:
pixmap -- optional pixelmap object (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
- update_header(self)
- Update a header with values from descriptors
- update_history(self)
- Update a header with history
History is maintained in the instance attribute
history. History is written by appending string to the history
list.
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)
- 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 0x1235830>
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 0xbce170>
- pickle_id = None
Methods inherited from astro.main.ProcessTarget.ProcessTarget:
- check_observing_blocks(self, childs)
- check if all childs have the same observing_block
- check_templates(self, childs)
- check if all childs have the same template
- compare(self)
- Quality Control -- basic trend analysis
The compare() method is used for default trend analysis. This
is done by comparing with a previous version of the same
object (last weeks bias, for example). This may be as simple
as comparing attribute values, but may also involve more
complex computations (e.g., subtracting the two images, and
analysing the residuals)
- derive_timestamp(self)
- Set the creation_date attribute
- get_dependencies(self)
- Return a list of names of attributes that are required for make()
- get_qcflags_set(self)
- Return a list of names of flags that have been set.
- get_qcflags_set_dict(self)
- Return a dictionary of flags that have been set. The key is the
name, the value is a tuple of (index, docstring).
- is_compared(self)
- Return true if the object has been compared
- is_inspected(self)
- Return true if the object has been inspected
- is_made(self)
- Return true if the object has been made
- is_ok(self)
- Return true if no quality control flags have been set.
- is_verified(self)
- Return true if the object has been verified
- set_compared(self)
- Set the process status to indicate that the object has been
compared.
- set_inspected(self)
- Set the process status to indicate that the object has been
inspected.
- set_made(self)
- Set the process tatus to indicate that the object has been made
- set_verified(self)
- Set the process status to indicate that the object has been
verified.
- verify(self)
- Quality Control -- internal consistency
This method inspects the values of various attributes of the
object to see if these are within the expected range for that
object. The purpose of this method is mostly to perform
sanity-checks on measured results. It is assumed that the
required measurements (for example image statistics) are done
during data reduction (i.e. while executing make()), and stored
in persistent attributes.
Class methods inherited from astro.main.ProcessTarget.ProcessTarget:
- get_qcflags(cls) from common.database.DBMeta.DBObjectMeta
- Return a list of attribute names of QCflag() objects.
- select(cls, **searchterms) from common.database.DBMeta.DBObjectMeta
- Class method to select RawFrames, Calfiles and ReducedScienceFrames
from the database.
Syntax example:
q = RawScienceFrame.select(instrument='WFI', filter='#842',
chip='ccd50', time_from='2000-01-02 04:45:46',
time_to='2000-01-02 05:03:00')
Possible search terms:
----------------------
check_quality - (Default 1) Exclude invalidated data (quality_flags!=0)
check_validity - (Default 1) Exclude invalidated data (is_valid=0)
chip - select of the same CCD ('ccd50', 'ccd51', etc.)
date - select of the same date (i.e. date at the start of
observing night, in yyyy-mm-dd format)
exptime - select frames with similar exposure time
(EXPTIME-0.8sec to EXPTIME+0.8 sec)
extension - select (raw) frames for a certain extension of its
RawFitsData object
filename - select a frame(!) by its filename
filter - select of the same filter ('#842', '#843', etc.)
instrument - select of the same instrument ('WFI', 'WFC', 'OCAM')
object - select for OBJECT header keyword, uses "like"
functionality, which allows wildcards "*" and "?"
time_from - precise form of date, in yyyy-mm-dd hh:mm:ss format
time_to - required when using time_from
- select_for_raw(cls, raw, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Class method to select the most recent valid calfile for the
provided raw frame from the database.
- select_for_reduced(cls, reduced, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Synonym for the select_for_raw method; the implementation should
be identical.
Data and other attributes inherited from astro.main.ProcessTarget.ProcessTarget:
- STATUS_COMPARE = 2
- STATUS_INSPECT = 3
- STATUS_MAKE = 0
- STATUS_VERIFY = 1
Class methods inherited from common.database.DBMeta.DBMixin:
- get_persistent_attributes(cls) from common.database.DBMeta.DBObjectMeta
- return a list of persistent attributes
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:
- 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 RawScienceFrame(RawFrame) |
| | |
- Method resolution order:
- RawScienceFrame
- RawFrame
- astro.main.BaseFrame.BaseFrame
- common.database.DataObject.DataObject
- common.database.DBMain.DBObject
- astro.main.ProcessTarget.ProcessTarget
- common.database.DBMeta.DBMixin
- __builtin__.object
- astro.main.OnTheFly.OnTheFly
Methods defined here:
- set_rawframe_specific_attributes_from_header(self)
- This method sets the AIRMSTRT and AIRMEND attributes which are
specific for the RawScienceFrame. The method also sets the
RawScienceFrame specific "astrom" attribute.
- verify(self)
Data descriptors defined here:
- AIRMEND
- Airmass at end of observation [None]
- AIRMSTRT
- Airmass at start of observation [None]
- DATE
- UTC date the original data file was saved [None]
- DATE_OBS
- UTC date at the start of the observation [None]
- EXPTIME
- Total observation time [sec]
- LST
- Local sidereal time at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- MJD_OBS
- Modified Julian date at the start of the observation (JD-2400000.5) [day]
- NAXIS1
- Length of data in axis 1 [pixel]
- NAXIS2
- Length of data in axis 2 [pixel]
- OBJECT
- Object name [None]
- OBSERVER
- The observer [None]
- OVSCX
- Number of overscan pixels in the x direction [pixel]
- OVSCXPRE
- Number of overscan pixels to skip in the x direction at the edge of the chip [pixel]
- OVSCXPST
- Number of overscan pixels to skip in the x direction at the edge of the data region [pixel]
- OVSCY
- Number of overscan pixels in the y direction [pixel]
- OVSCYPRE
- Number of overscan pixels to skip in the y direction at the edge of the chip [pixel]
- OVSCYPST
- Number of overscan pixels to skip in the y direction at the edge of the data region [pixel]
- PRSCX
- Number of prescan pixels in the x-direction [pixel]
- PRSCXPRE
- Number of prescan pixels to skip in the x-direction at the edge of the chip [pixel]
- PRSCXPST
- Number of prescan pixels to skip in the x-direction at the edge of the data region [pixel]
- PRSCY
- Number of prescan pixels in the y-direction [pixel]
- PRSCYPRE
- Number of prescan pixels to skip in the y-direction at the edge of the chip [pixel]
- PRSCYPST
- Number of prescan pixels to skip in the y-direction at the edge of the data region [pixel]
- UTC
- Universal Coordinated Time (UTC) at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- astrom
- Information about the astrometry [None]
- chip
- Information about the chip [None]
- creation_date
- Date this object was created [None]
- extension
- The extension to extract [None]
- filename
- The name of the associated file [None]
- filter
- Information about the filter [None]
- globalname
- The name used to store and retrieve file to and from Storage [None]
- imstat
- Image statistics for the frame [None]
- instrument
- Information about the instrument [None]
- is_valid
- Manual/external flag to disqualify bad data (SuperFlag) [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
- observing_block
- Information about the observing block [None]
- overscan_x_stat
- Statistics of the overscan region in the x-direction [None]
- overscan_y_stat
- Statistics of the overscan region in the x-direction [None]
- prescan_x_stat
- Statistics of the prescan region in the x-direction [None]
- prescan_y_stat
- Statistics of the prescan region in the y-direction [None]
- process_status
- A flag indicating the processing status [None]
- quality_flags
- Automatic/internal quality flag [None]
- raw_fits_data
- The multi-extension raw image [None]
- template
- Information about the template [None]
Methods inherited from RawFrame:
- build_header(self)
- check_dimensions(self)
- Check that the raw (untrimmed) image has the size defined in its
chip. The method is private.
The Chip attributes used in this method are now part this class.
This method may be superfluous.
- copy_attributes(self)
- do_statistics(self)
- Determine the image statistics for the trim, prescan and overscan
regions.
- do_trim_and_overscan_correction(self, overscan_parameter=0)
- Replace image with a trimmed and overscan corrected version of
itself.
Requires:
chip -- A Chip object describing the pre/overscan layout
Argument:
overscan_parameter -- which overscan correction to use:
0 -- No overscan correction
1 -- Use median of prescan_x
2 -- Use median of overscan_x
3 -- Use median of prescan_y
4 -- Use median of overscan_y
5 -- Use per-row value of prescan_x
6 -- Use per-row value of overscan_x (default)
7 -- Use per-row average of prescan_x, smoothing the averages
over ~50 rows
8 -- Use per-row average of overscan_x, smoothing the
averages over ~50 rows
9 -- Use per-row average of prescan_x, smoothing the averages
over ~10 rows
10 -- Use per-row average of overscan_x, smoothing the
averages over ~10 rows
11 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions)
12 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~50 rows
13 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~10 rows
This method loads a raw image, trims it and (optionally) performs an
overscan correction, using the statics of the pre- and overscan
regions. This can be done with a single value for the whole image or
on a per-row basis.
Methods 1-4 assume that do_statistics() has been run.
- extract_extension(self)
- extract_header(self)
- get_orientation(self)
- Temporary fix to make sure the frame's orientation is always known
if obtainable.
- get_overscan_x_region(self)
- Return the fits coordinates of the overscan region in the x
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_overscan_y_region(self)
- Return the fits coordinates of the overscan region in the y
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_prescan_x_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_prescan_y_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_trim_region(self)
- Return a tuple of the FITS coordinates of the trim section.
The method returns (x0, y0, x1, y1), where the trim region is
[x0:x1, y0:y1]. This follows the eclipse coordinate ordering
conventions such that
>>> ima = eclipse.image("aaa.fits")
>>> ima.extract_region(*achip.get_trim_region())
extracts the trim section from image aaa.fits.
- get_trimmed_size(self)
- Returns the size of the image in pixels after it has been trimmed.
- has_overscan_x_region(self)
- This method is used to ask the image whether it has an overscan_x
region or not. The return type is Boolean.
- has_overscan_y_region(self)
- This method is used to ask the image whether it has an overscan_y
region or not. The return type is Boolean.
- has_prescan_x_region(self)
- This method is used to ask the image whether it has a prescan_x
region or not. The return type is Boolean.
- has_prescan_y_region(self)
- This method is used to ask the image whether it has a prescan_y
region or not. The return type is Boolean.
- initialize_overscan_attribute(self)
- This method is used to set the "overscan_x_stat" and
"overscan_y_stat" attributes of the RawFrame from the header. This
initializer is specific for RawFrame objects. The method is private.
- initialize_prescan_attribute(self)
- This method is used to set the "prescan_x_stat" and "prescan_y_stat"
attributes of the RawFrame from the header. This initializer is
specific for RawFrame objects. The method is private
- make(self)
- Make a RawFrame object by extracting the data from the proper
extension of the RawFitsData object.
Required inputs:
raw_fits_data -- the unsplit data
extension -- the extension to be extracted
- read_header(self)
- Extends the read_header method of BaseFrame. The method is private.
- set_all_caps_attributes_from_header(self)
- set_chip_and_filter_attributes_from_header(self)
Data and other attributes inherited from RawFrame:
- PROCESS_TIME = 250
- orientation = -1
Methods inherited from astro.main.BaseFrame.BaseFrame:
- __init__(self, **kw)
- commit_subwinstat(self)
- Conditionally commit subwindow statistics
- display(self, viewer='skycat', filename=None)
- Independent display method for all frames.
- empty_header(self)
- Initalize to a default (empty) header
- estimate_statistics(self, pixmap=None, zone=None, max_iter=5, threshold=5.0)
- Estimate the mean, median and stddev, by iteratively excluding
pixelvalues deviating too far from the median
Arguments:
pixmap -- optional map for bad pixels (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
max_iter -- The maximum number of iterations
sig_thresh -- The threshold in number of standard deviations
- get_previous_version(self, level=0)
- Return previous version of this object. If it does not exist,
return None.
level: depth of query for previous version (0 goes as deep as
possible)
- initialize_astrom_attribute(self)
- initialize_chip_attribute(self)
- initialize_filter_attribute(self)
- initialize_imstat_attribute(self)
- initialize_instrument_attribute(self)
- initialize_lamp_attribute(self)
- initialize_observingblock_attribute(self)
- initialize_template_attribute(self)
- inspect(self, pixels=None, zone=None, kappa=3.0, iterations=2, cmap=None, vmin=None, vmax=None, interpolation='lanczos', width=6, ratio=None, viewer='skycat', force_figure=False, force_viewer=False, subplot_size=50, contour_levels=20, num_bins=100, extension=None, compare=False, level=0, other=None, clip=False, color=False)
- Optional visual inspection for quality control displays image in a
PyLab (MatPlotLib) window or optionally in an external viewer.
pixels: optional list or array representing the image to be
inspected (can be MxN for greyscale, or MxNx3 for RGB)
zone: tuple of (x0, y0, x1, y1) representing the image
coordinates of the two oposing corners of the sub
image to consider
kappa: the factor by which the dynamic range is increased in
units of sigma (0 gives full range)
iterations: number of iterations in the kappa-sigma range clipping
cmap: PyLab color map instance
vmin: lower display range in native units (e.g. ADU)
vmax: upper display range in native units (e.g. ADU)
interpolation: type of interpolation the PyLab viewer uses (nearest,
bilinear, etc.)
width: width of the PyLab figure window (in inches)
ratio: ratio by which to scale the figure height (default:
x_dim/y_dim)
viewer: external viewer to use in case the image is too large
force_figure: always use the PyLab figure window (Be Careful!
Statistics calculations on large images can be very
time and memory consuming.)
force_viewer: always use the viewer
subplot_size: width and height in pixels of region of interest
contour_levels: number of contour levels for the contour plot of the
region of interest
num_bins: number of bins in the histogram plot
extension: extension of the filetype to save plot to (png, ps,
or eps) None disables saving
compare: compare this frame to its previous version using
difference imaging (current-previous), pixels is
ignored
level: depth of query for previous version (0 goes as deep
as possible) when compare is True
other: a second of the same type of Frame object to replace
previous when compare is True (if color is True,
other can be a list of two images)
clip: kappa-sigma clip each image prior to subtraction when
compare is True
color: use color combining (RGB) instead of differencing
when compare is True (kappa, vmin/vmax only honored
when clip is True), this image is R, other is B if
single, other is [G, B] if it is a list
(EXPERIMENTAL)
When force_viewer is False, inspect() displays basic image
statistics (mean, stddev) and then a representation of the image
that can be zoomed and panned. Pressing various keys will give
different results described below in a region of interest described
by subplot_size:
q - closes the most recent plot window when pressed in the
main window
[space] - displays the X and Y coordinate (FITS standard unit
indexed) and the count level
a - performs aperture photometry on brightest feature in the
region of interest (NOT YET IMPLEMENTED)
c - displays a contour plot of the region of interest (see
contour_levels)
h - displays a histogram of the pixel values of the region of
interest (see num_bins)
r - displays a radial plot of the brightest feature in the
region of interest
s - displays a surface plot of the region of interest
p - displays profile plots in both X and Y dimensions versus
intensity (count level)
NOTE: None of the commands above work in the subplots.
- is_compressed(self)
- Find out if a FITS file is compressed
- load_header(self)
- Initialize self.header
- load_image(self, readonly=0)
- Initialize self.image.
- make_background(self)
- Make a background image,
Returns a new BaseFrame object. The name of the new file is
"name.back.fits"
- make_subwinstat(self)
- Compute statistics on subwindows
- retrieve(self)
- Retrieve this frame from the data server and uncompress it if it has
been compressed with FITSIO.
- save(self, filename='', overwrite=1)
- statistics(self, pixmap=None, zone=None)
- Compute statistics and store in self.imstat.
Arguments:
pixmap -- optional pixelmap object (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
- update_header(self)
- Update a header with values from descriptors
- update_history(self)
- Update a header with history
History is maintained in the instance attribute
history. History is written by appending string to the history
list.
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)
- 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 0x1235830>
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 0xbce170>
- pickle_id = None
Methods inherited from astro.main.ProcessTarget.ProcessTarget:
- check_observing_blocks(self, childs)
- check if all childs have the same observing_block
- check_templates(self, childs)
- check if all childs have the same template
- compare(self)
- Quality Control -- basic trend analysis
The compare() method is used for default trend analysis. This
is done by comparing with a previous version of the same
object (last weeks bias, for example). This may be as simple
as comparing attribute values, but may also involve more
complex computations (e.g., subtracting the two images, and
analysing the residuals)
- derive_timestamp(self)
- Set the creation_date attribute
- get_dependencies(self)
- Return a list of names of attributes that are required for make()
- get_qcflags_set(self)
- Return a list of names of flags that have been set.
- get_qcflags_set_dict(self)
- Return a dictionary of flags that have been set. The key is the
name, the value is a tuple of (index, docstring).
- is_compared(self)
- Return true if the object has been compared
- is_inspected(self)
- Return true if the object has been inspected
- is_made(self)
- Return true if the object has been made
- is_ok(self)
- Return true if no quality control flags have been set.
- is_verified(self)
- Return true if the object has been verified
- set_compared(self)
- Set the process status to indicate that the object has been
compared.
- set_inspected(self)
- Set the process status to indicate that the object has been
inspected.
- set_made(self)
- Set the process tatus to indicate that the object has been made
- set_verified(self)
- Set the process status to indicate that the object has been
verified.
Class methods inherited from astro.main.ProcessTarget.ProcessTarget:
- get_qcflags(cls) from common.database.DBMeta.DBObjectMeta
- Return a list of attribute names of QCflag() objects.
- select(cls, **searchterms) from common.database.DBMeta.DBObjectMeta
- Class method to select RawFrames, Calfiles and ReducedScienceFrames
from the database.
Syntax example:
q = RawScienceFrame.select(instrument='WFI', filter='#842',
chip='ccd50', time_from='2000-01-02 04:45:46',
time_to='2000-01-02 05:03:00')
Possible search terms:
----------------------
check_quality - (Default 1) Exclude invalidated data (quality_flags!=0)
check_validity - (Default 1) Exclude invalidated data (is_valid=0)
chip - select of the same CCD ('ccd50', 'ccd51', etc.)
date - select of the same date (i.e. date at the start of
observing night, in yyyy-mm-dd format)
exptime - select frames with similar exposure time
(EXPTIME-0.8sec to EXPTIME+0.8 sec)
extension - select (raw) frames for a certain extension of its
RawFitsData object
filename - select a frame(!) by its filename
filter - select of the same filter ('#842', '#843', etc.)
instrument - select of the same instrument ('WFI', 'WFC', 'OCAM')
object - select for OBJECT header keyword, uses "like"
functionality, which allows wildcards "*" and "?"
time_from - precise form of date, in yyyy-mm-dd hh:mm:ss format
time_to - required when using time_from
- select_for_raw(cls, raw, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Class method to select the most recent valid calfile for the
provided raw frame from the database.
- select_for_reduced(cls, reduced, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Synonym for the select_for_raw method; the implementation should
be identical.
Data and other attributes inherited from astro.main.ProcessTarget.ProcessTarget:
- STATUS_COMPARE = 2
- STATUS_INSPECT = 3
- STATUS_MAKE = 0
- STATUS_VERIFY = 1
Class methods inherited from common.database.DBMeta.DBMixin:
- get_persistent_attributes(cls) from common.database.DBMeta.DBObjectMeta
- return a list of persistent attributes
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:
- 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 RawTwilightFlatFrame(RawFrame) |
| | |
- Method resolution order:
- RawTwilightFlatFrame
- RawFrame
- astro.main.BaseFrame.BaseFrame
- common.database.DataObject.DataObject
- common.database.DBMain.DBObject
- astro.main.ProcessTarget.ProcessTarget
- common.database.DBMeta.DBMixin
- __builtin__.object
- astro.main.OnTheFly.OnTheFly
Methods defined here:
- __init__(self, pathname='')
- verify(self)
- Verify the flat.
The following flags may be set in the status attribute:
MEAN_LOW -- mean < 5000.0
MEAN_HIGH -- mean > 45000.0
Data descriptors defined here:
- DATE
- UTC date the original data file was saved [None]
- DATE_OBS
- UTC date at the start of the observation [None]
- EXPTIME
- Total observation time [sec]
- LST
- Local sidereal time at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- MEAN_HIGH
- MEAN_LOW
- MJD_OBS
- Modified Julian date at the start of the observation (JD-2400000.5) [day]
- NAXIS1
- Length of data in axis 1 [pixel]
- NAXIS2
- Length of data in axis 2 [pixel]
- OBJECT
- Object name [None]
- OBSERVER
- The observer [None]
- OVSCX
- Number of overscan pixels in the x direction [pixel]
- OVSCXPRE
- Number of overscan pixels to skip in the x direction at the edge of the chip [pixel]
- OVSCXPST
- Number of overscan pixels to skip in the x direction at the edge of the data region [pixel]
- OVSCY
- Number of overscan pixels in the y direction [pixel]
- OVSCYPRE
- Number of overscan pixels to skip in the y direction at the edge of the chip [pixel]
- OVSCYPST
- Number of overscan pixels to skip in the y direction at the edge of the data region [pixel]
- PRSCX
- Number of prescan pixels in the x-direction [pixel]
- PRSCXPRE
- Number of prescan pixels to skip in the x-direction at the edge of the chip [pixel]
- PRSCXPST
- Number of prescan pixels to skip in the x-direction at the edge of the data region [pixel]
- PRSCY
- Number of prescan pixels in the y-direction [pixel]
- PRSCYPRE
- Number of prescan pixels to skip in the y-direction at the edge of the chip [pixel]
- PRSCYPST
- Number of prescan pixels to skip in the y-direction at the edge of the data region [pixel]
- UTC
- Universal Coordinated Time (UTC) at the start of the observation expressed as the number of seconds (a float) since UTC midnight [sec]
- chip
- Information about the chip [None]
- creation_date
- Date this object was created [None]
- extension
- The extension to extract [None]
- filename
- The name of the associated file [None]
- filter
- Information about the filter [None]
- globalname
- The name used to store and retrieve file to and from Storage [None]
- imstat
- Image statistics for the frame [None]
- instrument
- Information about the instrument [None]
- is_valid
- Manual/external flag to disqualify bad data (SuperFlag) [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
- observing_block
- Information about the observing block [None]
- overscan_x_stat
- Statistics of the overscan region in the x-direction [None]
- overscan_y_stat
- Statistics of the overscan region in the x-direction [None]
- prescan_x_stat
- Statistics of the prescan region in the x-direction [None]
- prescan_y_stat
- Statistics of the prescan region in the y-direction [None]
- process_params
- Processing Parameters [None]
- process_status
- A flag indicating the processing status [None]
- quality_flags
- Automatic/internal quality flag [None]
- raw_fits_data
- The multi-extension raw image [None]
- template
- Information about the template [None]
Methods inherited from RawFrame:
- build_header(self)
- check_dimensions(self)
- Check that the raw (untrimmed) image has the size defined in its
chip. The method is private.
The Chip attributes used in this method are now part this class.
This method may be superfluous.
- copy_attributes(self)
- do_statistics(self)
- Determine the image statistics for the trim, prescan and overscan
regions.
- do_trim_and_overscan_correction(self, overscan_parameter=0)
- Replace image with a trimmed and overscan corrected version of
itself.
Requires:
chip -- A Chip object describing the pre/overscan layout
Argument:
overscan_parameter -- which overscan correction to use:
0 -- No overscan correction
1 -- Use median of prescan_x
2 -- Use median of overscan_x
3 -- Use median of prescan_y
4 -- Use median of overscan_y
5 -- Use per-row value of prescan_x
6 -- Use per-row value of overscan_x (default)
7 -- Use per-row average of prescan_x, smoothing the averages
over ~50 rows
8 -- Use per-row average of overscan_x, smoothing the
averages over ~50 rows
9 -- Use per-row average of prescan_x, smoothing the averages
over ~10 rows
10 -- Use per-row average of overscan_x, smoothing the
averages over ~10 rows
11 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions)
12 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~50 rows
13 -- Use per row average of prescan and overscan X in two
parts applying prescan correction to the prescan side
and overscan correction to the overscan side (requires
both prescan and overscan regions), smoothing the
averages over ~10 rows
This method loads a raw image, trims it and (optionally) performs an
overscan correction, using the statics of the pre- and overscan
regions. This can be done with a single value for the whole image or
on a per-row basis.
Methods 1-4 assume that do_statistics() has been run.
- extract_extension(self)
- extract_header(self)
- get_orientation(self)
- Temporary fix to make sure the frame's orientation is always known
if obtainable.
- get_overscan_x_region(self)
- Return the fits coordinates of the overscan region in the x
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_overscan_y_region(self)
- Return the fits coordinates of the overscan region in the y
direction. The method returns (x0, y0, x1, y1), where the overscan
region is [x0:x1, y0:y1].
- get_prescan_x_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_prescan_y_region(self)
- Return the FITS coordinates of the prescan region in the x
direction. The method returns (x0, y0, x1, y1), where the prescan
region is [x0:x1, y0:y1].
- get_trim_region(self)
- Return a tuple of the FITS coordinates of the trim section.
The method returns (x0, y0, x1, y1), where the trim region is
[x0:x1, y0:y1]. This follows the eclipse coordinate ordering
conventions such that
>>> ima = eclipse.image("aaa.fits")
>>> ima.extract_region(*achip.get_trim_region())
extracts the trim section from image aaa.fits.
- get_trimmed_size(self)
- Returns the size of the image in pixels after it has been trimmed.
- has_overscan_x_region(self)
- This method is used to ask the image whether it has an overscan_x
region or not. The return type is Boolean.
- has_overscan_y_region(self)
- This method is used to ask the image whether it has an overscan_y
region or not. The return type is Boolean.
- has_prescan_x_region(self)
- This method is used to ask the image whether it has a prescan_x
region or not. The return type is Boolean.
- has_prescan_y_region(self)
- This method is used to ask the image whether it has a prescan_y
region or not. The return type is Boolean.
- initialize_overscan_attribute(self)
- This method is used to set the "overscan_x_stat" and
"overscan_y_stat" attributes of the RawFrame from the header. This
initializer is specific for RawFrame objects. The method is private.
- initialize_prescan_attribute(self)
- This method is used to set the "prescan_x_stat" and "prescan_y_stat"
attributes of the RawFrame from the header. This initializer is
specific for RawFrame objects. The method is private
- make(self)
- Make a RawFrame object by extracting the data from the proper
extension of the RawFitsData object.
Required inputs:
raw_fits_data -- the unsplit data
extension -- the extension to be extracted
- read_header(self)
- Extends the read_header method of BaseFrame. The method is private.
- set_all_caps_attributes_from_header(self)
- set_chip_and_filter_attributes_from_header(self)
- set_rawframe_specific_attributes_from_header(self)
- This method takes care of setting those attributes of the RawFrame
that are specific for the particular sub-class at hand. This method
should be fully implemented where this is needed. Example:
RawScienceFrame.
Data and other attributes inherited from RawFrame:
- PROCESS_TIME = 250
- orientation = -1
Methods inherited from astro.main.BaseFrame.BaseFrame:
- commit_subwinstat(self)
- Conditionally commit subwindow statistics
- display(self, viewer='skycat', filename=None)
- Independent display method for all frames.
- empty_header(self)
- Initalize to a default (empty) header
- estimate_statistics(self, pixmap=None, zone=None, max_iter=5, threshold=5.0)
- Estimate the mean, median and stddev, by iteratively excluding
pixelvalues deviating too far from the median
Arguments:
pixmap -- optional map for bad pixels (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
max_iter -- The maximum number of iterations
sig_thresh -- The threshold in number of standard deviations
- get_previous_version(self, level=0)
- Return previous version of this object. If it does not exist,
return None.
level: depth of query for previous version (0 goes as deep as
possible)
- initialize_astrom_attribute(self)
- initialize_chip_attribute(self)
- initialize_filter_attribute(self)
- initialize_imstat_attribute(self)
- initialize_instrument_attribute(self)
- initialize_lamp_attribute(self)
- initialize_observingblock_attribute(self)
- initialize_template_attribute(self)
- inspect(self, pixels=None, zone=None, kappa=3.0, iterations=2, cmap=None, vmin=None, vmax=None, interpolation='lanczos', width=6, ratio=None, viewer='skycat', force_figure=False, force_viewer=False, subplot_size=50, contour_levels=20, num_bins=100, extension=None, compare=False, level=0, other=None, clip=False, color=False)
- Optional visual inspection for quality control displays image in a
PyLab (MatPlotLib) window or optionally in an external viewer.
pixels: optional list or array representing the image to be
inspected (can be MxN for greyscale, or MxNx3 for RGB)
zone: tuple of (x0, y0, x1, y1) representing the image
coordinates of the two oposing corners of the sub
image to consider
kappa: the factor by which the dynamic range is increased in
units of sigma (0 gives full range)
iterations: number of iterations in the kappa-sigma range clipping
cmap: PyLab color map instance
vmin: lower display range in native units (e.g. ADU)
vmax: upper display range in native units (e.g. ADU)
interpolation: type of interpolation the PyLab viewer uses (nearest,
bilinear, etc.)
width: width of the PyLab figure window (in inches)
ratio: ratio by which to scale the figure height (default:
x_dim/y_dim)
viewer: external viewer to use in case the image is too large
force_figure: always use the PyLab figure window (Be Careful!
Statistics calculations on large images can be very
time and memory consuming.)
force_viewer: always use the viewer
subplot_size: width and height in pixels of region of interest
contour_levels: number of contour levels for the contour plot of the
region of interest
num_bins: number of bins in the histogram plot
extension: extension of the filetype to save plot to (png, ps,
or eps) None disables saving
compare: compare this frame to its previous version using
difference imaging (current-previous), pixels is
ignored
level: depth of query for previous version (0 goes as deep
as possible) when compare is True
other: a second of the same type of Frame object to replace
previous when compare is True (if color is True,
other can be a list of two images)
clip: kappa-sigma clip each image prior to subtraction when
compare is True
color: use color combining (RGB) instead of differencing
when compare is True (kappa, vmin/vmax only honored
when clip is True), this image is R, other is B if
single, other is [G, B] if it is a list
(EXPERIMENTAL)
When force_viewer is False, inspect() displays basic image
statistics (mean, stddev) and then a representation of the image
that can be zoomed and panned. Pressing various keys will give
different results described below in a region of interest described
by subplot_size:
q - closes the most recent plot window when pressed in the
main window
[space] - displays the X and Y coordinate (FITS standard unit
indexed) and the count level
a - performs aperture photometry on brightest feature in the
region of interest (NOT YET IMPLEMENTED)
c - displays a contour plot of the region of interest (see
contour_levels)
h - displays a histogram of the pixel values of the region of
interest (see num_bins)
r - displays a radial plot of the brightest feature in the
region of interest
s - displays a surface plot of the region of interest
p - displays profile plots in both X and Y dimensions versus
intensity (count level)
NOTE: None of the commands above work in the subplots.
- is_compressed(self)
- Find out if a FITS file is compressed
- load_header(self)
- Initialize self.header
- load_image(self, readonly=0)
- Initialize self.image.
- make_background(self)
- Make a background image,
Returns a new BaseFrame object. The name of the new file is
"name.back.fits"
- make_subwinstat(self)
- Compute statistics on subwindows
- retrieve(self)
- Retrieve this frame from the data server and uncompress it if it has
been compressed with FITSIO.
- save(self, filename='', overwrite=1)
- statistics(self, pixmap=None, zone=None)
- Compute statistics and store in self.imstat.
Arguments:
pixmap -- optional pixelmap object (default=None)
zone -- optional region (x0, y0, x1, y1) (default=None)
- update_header(self)
- Update a header with values from descriptors
- update_history(self)
- Update a header with history
History is maintained in the instance attribute
history. History is written by appending string to the history
list.
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)
- 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 0x1235830>
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 0xbce170>
- pickle_id = None
Methods inherited from astro.main.ProcessTarget.ProcessTarget:
- check_observing_blocks(self, childs)
- check if all childs have the same observing_block
- check_templates(self, childs)
- check if all childs have the same template
- compare(self)
- Quality Control -- basic trend analysis
The compare() method is used for default trend analysis. This
is done by comparing with a previous version of the same
object (last weeks bias, for example). This may be as simple
as comparing attribute values, but may also involve more
complex computations (e.g., subtracting the two images, and
analysing the residuals)
- derive_timestamp(self)
- Set the creation_date attribute
- get_dependencies(self)
- Return a list of names of attributes that are required for make()
- get_qcflags_set(self)
- Return a list of names of flags that have been set.
- get_qcflags_set_dict(self)
- Return a dictionary of flags that have been set. The key is the
name, the value is a tuple of (index, docstring).
- is_compared(self)
- Return true if the object has been compared
- is_inspected(self)
- Return true if the object has been inspected
- is_made(self)
- Return true if the object has been made
- is_ok(self)
- Return true if no quality control flags have been set.
- is_verified(self)
- Return true if the object has been verified
- set_compared(self)
- Set the process status to indicate that the object has been
compared.
- set_inspected(self)
- Set the process status to indicate that the object has been
inspected.
- set_made(self)
- Set the process tatus to indicate that the object has been made
- set_verified(self)
- Set the process status to indicate that the object has been
verified.
Class methods inherited from astro.main.ProcessTarget.ProcessTarget:
- get_qcflags(cls) from common.database.DBMeta.DBObjectMeta
- Return a list of attribute names of QCflag() objects.
- select(cls, **searchterms) from common.database.DBMeta.DBObjectMeta
- Class method to select RawFrames, Calfiles and ReducedScienceFrames
from the database.
Syntax example:
q = RawScienceFrame.select(instrument='WFI', filter='#842',
chip='ccd50', time_from='2000-01-02 04:45:46',
time_to='2000-01-02 05:03:00')
Possible search terms:
----------------------
check_quality - (Default 1) Exclude invalidated data (quality_flags!=0)
check_validity - (Default 1) Exclude invalidated data (is_valid=0)
chip - select of the same CCD ('ccd50', 'ccd51', etc.)
date - select of the same date (i.e. date at the start of
observing night, in yyyy-mm-dd format)
exptime - select frames with similar exposure time
(EXPTIME-0.8sec to EXPTIME+0.8 sec)
extension - select (raw) frames for a certain extension of its
RawFitsData object
filename - select a frame(!) by its filename
filter - select of the same filter ('#842', '#843', etc.)
instrument - select of the same instrument ('WFI', 'WFC', 'OCAM')
object - select for OBJECT header keyword, uses "like"
functionality, which allows wildcards "*" and "?"
time_from - precise form of date, in yyyy-mm-dd hh:mm:ss format
time_to - required when using time_from
- select_for_raw(cls, raw, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Class method to select the most recent valid calfile for the
provided raw frame from the database.
- select_for_reduced(cls, reduced, overscan=None, check_quality=1, check_validity=1) from common.database.DBMeta.DBObjectMeta
- Synonym for the select_for_raw method; the implementation should
be identical.
Data and other attributes inherited from astro.main.ProcessTarget.ProcessTarget:
- STATUS_COMPARE = 2
- STATUS_INSPECT = 3
- STATUS_MAKE = 0
- STATUS_VERIFY = 1
Class methods inherited from common.database.DBMeta.DBMixin:
- get_persistent_attributes(cls) from common.database.DBMeta.DBObjectMeta
- return a list of persistent attributes
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:
- 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 RawTwilightFlatFrameParameters(common.database.DBMain.DBObject) |
| | |
- Method resolution order:
- RawTwilightFlatFrameParameters
- common.database.DBMain.DBObject
- __builtin__.object
Data descriptors defined here:
- MAX_FLAT_MEAN
- QC: maximum mean value of the flat [ADU]
- MIN_FLAT_MEAN
- QC: minimum mean value of the flat [ADU]
- 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 0xbce170>
- pickle_id = None
| |