astro.main package

Subpackages

Submodules

astro.main.ApertureCorrectionAttributeCalculator module

Aperture Corrections

astro.main.ApertureCorrectionAttributeCalculator.ApertureCorrectionAttributeCalculator

alias of astro.main.ApertureCorrectionAttributeCalculator.AttributeCalculator

class astro.main.ApertureCorrectionAttributeCalculator.AttributeCalculator(sourcelist_data=None)

Bases: astro.main.sourcecollection.AttributeCalculator.AttributeCalculator

Aperture Correction Calculator

SCID

SourceCollection identifier [None]

acd_attributes = [{'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUX_APERCOR_4', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUX_APERCOR_6', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUX_APERCOR_10', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUX_APERCOR_14', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUX_APERCOR_25', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUX_APERCOR_40', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUX_APERCOR_100', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUXERR_APERCOR_4', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUXERR_APERCOR_6', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUXERR_APERCOR_10', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUXERR_APERCOR_14', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUXERR_APERCOR_25', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUXERR_APERCOR_40', 'ucd': ''}, {'null': nan, 'length': 1, 'format': 'float32', 'name': 'FLUXERR_APERCOR_100', 'ucd': ''}]
acd_input_attribute_names = ['2DPHOT', 'MAG_AUTO', 'MAGERR_AUTO', 'IMAFLAGS_ISO', 'Flag', 'FLUX_RADIUS', 'FLUX_APER_4', 'FLUX_APER_6', 'FLUX_APER_10', 'FLUX_APER_14', 'FLUX_APER_25', 'FLUX_APER_40', 'FLUX_APER_100', 'FLUXERR_APER_4', 'FLUXERR_APER_6', 'FLUXERR_APER_10', 'FLUXERR_APER_14', 'FLUXERR_APER_25', 'FLUXERR_APER_40', 'FLUXERR_APER_100']
acd_name = 'Python based ApertureCorrectionAttributeCalculator'
acd_parameters = []
all_data_stored

Flag to indicate whether all data has been stored in sourcelist_data, 0 means no (or unknown), 1 means yes

apertures = [4, 6, 10, 14, 25, 40, 100]
attribute_columns

Column names of the attributes in the sourcelist_data

attribute_names

Names of the attributes corresponding to the attribute_columns

calculate_attributes_vector(*args, **kwargs)
creation_date

Date this object was created [None]

definition

The Definition of this AttributeCalculator instance.

get_attribute_names(cache=False)
get_attribute_names_nc(cache=False)

Returns the names of the attributes.

get_attributes(cache=False)
get_attributes_full(cache=False)
get_attributes_full_nc(cache=False)

Returns a TableConverter like attribute list with extra keys.

Should only be used by SourceCollection functions. Other classes and awe-prompt users should use get_attributes().

This function should be overloaded by the derived classes. The version in this base class is essentially the variant of the External.

get_attributes_nc(cache=False)

Returns a list of dictionaries with meta data about the attributes.

Keys of the dictionaries:
  • name: The name (and identifier) of the attribute.
  • format: A format string that can be used by numpy.dtype()
  • ucd: Unified Content Descriptor (not always filled properly)
  • null: A null value, usually numpy.nan (not always present)
  • length: The length for multi length cells, only used for strings.

The dictionaries have the same structure as those used in the TableConverter class.

TODO LT L: [NOCAT] Use ‘ucd’ and ‘null’ properly.

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make(optimize=True)

New make() function that works with old ACDs for which the original make() function does not accept the optimize keyword.

E.g. ACD 100031 for calculating comoving distances.

make_aperture_corrections(tc)

Calculate the Aperture Corrections given an input TableConverter.

make_nc(optimize=True)

This is a virtual make() method for an AttributeCalculator instance.

The AttributeCalculatorDefinition should provide either: - an entire make() function - a calculate_attributes() or calculate_attributes_vector() function.

The default make() of the AttributeCalculator is a wrapper around the calculate_attributes_vector() function.

name

Name of the SourceCollection [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

parent_collection

Parent SourceCollections [None].

process_parameters

Process parameters

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

sourcelist_data

Optional SourceList containing the data described by this SourceCollection

sourcelist_sources

Optional SourceList containing the sources described by this SourceCollection

astro.main.AssociateList module

class astro.main.AssociateList.AssociateList(debug=0)

Bases: common.database.DataObject.DataObject, common.main.ProcessTarget.ProcessTarget, astro.main.OnTheFly.OnTheFly

This class represents the result of the association between two or more sourcelists.

ALID

AssociateList ID [None]

CHAIN = 1
MASTER = 2
MATCH = 3
MOSAIC = 4
OBJECT

Object name [None]

PROCESS_TIME = 100
associate_lists(list1=None, list2=None)
associate_sourcelists()
associatelisttype

Type of AssociateList [None]

associates

Definition of base-type of AssociateList [None]

check_master()
check_number_of_associates()
check_preconditions()
commit()
consistency_check(silent=False)
copy_attributes()
count_from_flag_on_associates(mask=None, mode='ANY', count=None, countmode='EQ')

count_from_flag[_on_associates] returns the number of associations which contain sources from specified sourcelists

mask mask to filter which associations are to be counted. The mask works as a
bitmask, each bit set representing a sourcelist which was input to the associatelist. For example bit 2 set means that only the wanted associations which contain a source from sourcelist number 2 will be counted (depends on mode). Default: all associations.
mode Determines how the masking works. Mode can be:
ALL Use only the associations which contain sources from exact
the specified sourcelists.
INTERSECT Use only the associations which contain sources from at least
the specified sourcelists.
ANY Use only the associations which contain sources from at least
one of the specified sourcelists.

Default (if mask is specified): ANY.

count determines the number of different sourcelists which participate in an
association, i.e. if count = 3 then only associations are counted which have sources from 3 different sourcelists (depends on countmode). Actually count is the bitcount of the number of participating sourcelists.
countmode Mode can be:
LT returns number of associations with less than the specified
number of participating sourcelists.
LE returns number of associations with less than or equal the
specified number of participating sourcelists.
EQ returns number of associations with exact the specified number
of participating sourcelists.
GE returns number of associations with greater than or equal the
specified number of participating sourcelists.
GT returns number of associations with greater than the specified
number of participating sourcelists.

Default: EQ. Only works when count is defined.

count_from_members_on_associates(members=0, mode='EQ')

count_from_members[_on_associates] counts the number of associations which have a specified number of groupmembers.

members Number of members to look for (depends on mode) mode Mode can be:

LT returns number of associations with less than the specified
number of members.
LE returns number of associations with less than or equal the
specified number of members
EQ returns number of associations with exact the specified number
of members
GE returns number of associations with greater than or equal the
specified number of members
GT returns number of associations with greater than the specified
number of members.

Default: EQ.

creation_date

Date this object was created [None]

derive_timestamp()
filename

The name of the associated file [None]

find_associatelists_with_missing_flags()
get_attributes_of_pairs(dict1=None, dict2=None)
get_attributes_of_singles(sourcelistnumber, dict=None)
get_attributes_on_associates()

get_attributes[_on_associates] returns all available attributes of all participating SourceLists.

get_data_from_area_on_associates(Area=None, depth=20, attrlist=[], mask=None, mode='ANY', count=None, countmode='EQ')

get_data[_on_associates] returns data associated with requested attributes of the associated sources. The function returns a dictionary with as key the AID (Association IDentifier) and as value the attribute values according to the (modified) list of specified attributes, for each requested sourcelist a list.

Area specifies the wanted area [coverage of AssociateList]. depth the HTM trixel index depth on which the area is defined [20]. attrlist list containing the wanted attributes. Note that SLID and SID will always

be returned and that SLID is the first and SID the second item. On return attrlist will be modified accordingly. Default: [].
mask mask to filter which associations are to be returned. The mask works as a
bitmask, each bit set representing a sourcelist which was input to the associatelist. For example bit 2 set means that only the wanted attributes of sourcelist number 2 will be returned (depends on mode). The mask can also be a list of SLIDs (SourceList IDentifiers) or SourceList Instances. Default: all associations.
mode Determines how the masking works. Mode can be:
ALL Use only the associations which contain sources from exact
the specified sourcelists.
INTERSECT Use only the associations which contain sources from at least
the specified sourcelists.
ANY Use only the associations which contain sources from at least
one of the specified sourcelists.

Default (if mask is specified): ANY.

count determines the number of different sourcelists which participate in an
association, i.e. if count = 3 then only associations are counted which have sources from 3 different sourcelists (depends on countmode). Actually count is the bitcount of the number of participating sourcelists.
countmode Mode can be:
LT returns number of associations with less than the specified
number of participating sourcelists.
LE returns number of associations with less than or equal the
specified number of participating sourcelists.
EQ returns number of associations with exact the specified number
of participating sourcelists.
GE returns number of associations with greater than or equal the
specified number of participating sourcelists.
GT returns number of associations with greater than the specified
number of participating sourcelists.

Default: EQ. Only works when count is defined.

get_data_on_associates(attrlist=[], mask=None, mode='ANY', count=None, countmode='EQ')

get_data[_on_associates] returns data associated with requested attributes of the associated sources. The function returns a dictionary with as key the AID (Association IDentifier) and as value the attribute values according to the (modified) list of specified attributes, for each requested sourcelist a list.

attrlist list containing the wanted attributes. Note that SLID and SID will always
be returned and that SLID is the first and SID the second item. On return attrlist will be modified accordingly. Default: [].
mask mask to filter which associations are to be returned. The mask works as a
bitmask, each bit set representing a sourcelist which was input to the associatelist. For example bit 2 set means that only the wanted attributes of sourcelist number 2 will be returned (depends on mode). The mask can also be a list of SLIDs (SourceList IDentifiers) or SourceList Instances. Default: all associations.
mode Determines how the masking works. Mode can be:
ALL Use only the associations which contain sources from exact
the specified sourcelists.
INTERSECT Use only the associations which contain sources from at least
the specified sourcelists.
ANY Use only the associations which contain sources from at least
one of the specified sourcelists.

Default (if mask is specified): ANY.

count determines the number of different sourcelists which participate in an
association, i.e. if count = 3 then only associations are counted which have sources from 3 different sourcelists (depends on countmode). Actually count is the bitcount of the number of participating sourcelists.
countmode Mode can be:
LT returns number of associations with less than the specified
number of participating sourcelists.
LE returns number of associations with less than or equal the
specified number of participating sourcelists.
EQ returns number of associations with exact the specified number
of participating sourcelists.
GE returns number of associations with greater than or equal the
specified number of participating sourcelists.
GT returns number of associations with greater than the specified
number of participating sourcelists.

Default: EQ. Only works when count is defined.

get_distances_on_associates()

get_distances calculates the distances between all possible pairs in an association. The output is a dictionary with as key the associate ID (AID) and as value a list containing for each pair a tuple which consists of three items: ((SLID1, SID1), (SLID2, SID2), DISTANCE). SLID1 is always <= SLID2 and when SLID1=SLID2 SID1 < SID2.

get_earliest_catalog_source_progenitors(identifier, _done=None)

Uses get_source_progenitors recursively to find the earliest catalogs that contributed to this source. Usually these will be normal SourceLists whose sources are created by running SExtractor on a frame. However, these could also be External SourceCollections for which no frame exist.

get_number_of_associations()
get_number_of_pairs()
get_number_of_singles()
get_onthefly_dependencies(config=None)

get_onthefly_dependencies() is overloaded to return the SourceCollections that the input SourceLists belong to, if any.

SourceCollections cannot (yet) be associated directly, and are therefore ‘converted’ into a SourceList first. The original SourceCollections have to be returned by this function to preserve data lineage.

This overloading is a hack. The dependencies returned here should be properly encoded in the data model as true persistent attributes at some point.

get_pairs()
get_singles()
get_source_progenitors(identifier)

Returns a list of objects and identifiers that represent the progenitors of the source. Also implemented for SourceCollections and SourceList. This function can be called hierarchically.

Identifier should be a AID.

Returns a list of SourceLists and SIDs.

get_statistics_of_pairs()
getitem_on_associates(index)
globalname

The name used to store and retrieve file to and from Storage [None]

inputassociatelist

Input AssociateList [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

len_on_associates()
llDEC

Declination of lower left containing box [deg]

llRA

Right Ascension of lower left containing box [deg]

lrDEC

Declination of lower right containing box [deg]

lrRA

Right Ascension of lowe r right containing box [deg]

make()
make_Master_AssociateList(sourcelists, filters, declo, dechi, distance, decstep=0.001, decstep2=0.001)

make_Master_AssociateList creates a Master AssociateList from a list of SourceLists.

sourcelists List of SourceLists which should be Master Associated. The Master is the first one. filters Filters used to select the source which should participate in the association. declo, dechi Range in Declination in which the input SourceLists have there sources. distance Search distance in arcsec for pairing sources. decstep Step in Declination for looping over Master sources between declo and dechi. decstep2 Step in Declination for looping over the other sources.

make_from_dictionary_on_associates(dictionary=None)

make_from_dictionary[_on_associates] creates an AssociateList where the associations are defined by the user. If the input_lists contain two Sourcelists, the dictionary should contain as keys the AIDs, as value a tuple containing two lists, the first list containing the SIDS of the first SourceList, the second list containing those of the second SourceList. If the input_lists contains an AssociateList, the dictionary should then contain as keys the AIDs, as value a list of SIDs.

make_from_list_on_associates(inputlist)

make_from_list[_on_associates] creates an AssociateList where the associations are defined by the user. The inputlist should contain the lists of (SLID, SID) tuples which make up one association. For xample the input list containing [[(1,0), (2,0), (3,1)], [(1,1), (2,1)], [(3,2)]] describes three associations, the first with three sources, the second with2 and the last with only 1 source. The associatelisttype will be set to 0, the inputsourcelists will be calculated from the inputlist. The user is free to specify name, process_params, llRA etc and OBJECT. If the AssociateList already exists, the associations are append to the associatelist. The should however contain the same Sourclists as the existing AssociateList.

make_image_dict_on_associates(aids, mode='sky')

make_image_dict[_on_associates] creates an image dict which can be input to the image server software.

aids An aid (or a list of aids) for which the input is generated. mode Produce sky (default) or grid coordinates.

make_mask(mask)

Converts a list or tuple of SLIDs or SourceLists into a bitmask.

make_matched_associatelist()
make_skycat_on_associates(slid, mask=None, mode='ALL', magname='')

Make a skycat catalog to visualize associated sources.

If mask and mode are not specified the catalog will be made for the associates which have a member in all input SourceLists.

Possible arguments:
slid: SourceList identifier, catalog is made for this SourceList mask: See AssociateList.get_data_on_associates() method mode: See AssociateList.get_data_on_associates() method

AssociateList.sourcelists can be used to find back the SLIDs taking part in the AssociateList.

migrate_flag()
name

Name of the AssociateList [None]

number_of_associates

Number of associates [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

onthefly_after_set_dependencies(config)

Customized version for setting the associate type, before the actual make is called When not in testrun copy the input SourceLists to the input_lists attribute

process_params

Processing parameters [None]

repair_flags(commit=False)
set_associatelist_identifier()
set_assoclist_name()

Generate and set the unique filename for this AssociateList.

set_coordinate_ranges(L1, L2)
set_made()
set_process_parameters_from_dict(pars={})

pars is a dictionary of the type e.g.: {‘BiasFrame.process_params.SIGMA_CLIP’:8}

set_search_area(llRA, llDEC, lrRA, lrDEC, urRA, urDEC, ulRA, ulDEC)
set_search_distance(search_distance)
set_sextractor_flag_mask(mask)
set_single_out_closest_pairs(single_out_closest_pairs)
set_user_config(user_config_dict)

Store the user specified configuration (as produced e.g. by the util.Pars tool) in a transient attribute.

sourcelists

Input list of SourceLists [None]

sql_query_on_associates(attrlist=[], mask=None, mode='ANY')
ulDEC

Declination of upper left containing box [deg]

ulRA

Right Ascension of upper left containing box [deg]

update_number_of_associates()
urDEC

Declination of upper right containing box [deg]

urRA

Right Ascension of upper right containing box [deg]

exception astro.main.AssociateList.AssociateListError

Bases: Exception

class astro.main.AssociateList.AssociateListParameters

Bases: common.database.DBMain.DBObject

SEARCH_DISTANCE

Radius of search for associates [arcsec]

SEXTRACTOR_FLAG_MASK

SExtractor flag mask value to use to filter sources [None]

SINGLE_OUT_CLOSEST_PAIRS

Single out closest pairs [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

astro.main.AssociateList.alid_sort(AL1, AL2)
astro.main.AssociateList.find_bounding_box(lists)
astro.main.AssociateList.get_associate_htm_depth(search_distance)

Finds the htm depth needed for neighbour search

astro.main.AssociateList.get_sky_boundingbox(tuple1, tuple2)
astro.main.AssociateList.get_sky_overlap(tuple1, tuple2)
astro.main.AssociateList.get_sql_trixel_search_method(method, schema_owner, levelin=None, levelout=None, radius=None, prefix=None)
astro.main.AssociateList.inputselectquery_Master(cursor, sourcelists, filters, schema, pairstable, distance, declo, dechi, dlo, dhi, aid)
astro.main.AssociateList.iswholesky(s)
astro.main.AssociateList.make_decode_query(slids, name='T1.SLID')
astro.main.AssociateList.make_select_sources_query(htm_range, depth_factor, alias=None, mode='N', index='"HTM"', SL=None, flag=255, awschema=None)
astro.main.AssociateList.onesource(llRA, llDEC, lrRA, lrDEC, urRA, urDEC, ulRA, ulDEC)
astro.main.AssociateList.print_insert_results(cursor, q, alid)
astro.main.AssociateList.print_pairstable(cursor, schema, pairstable)
astro.main.AssociateList.print_query(q)
astro.main.AssociateList.q_get_attributes_of_associates(ALID, attrs, hint='', owner='AWOPER', atable=None, aoltable=None, stable=None, soltable=None, stype='SourceList$sources$', attrname=None, cursor=None)

q_get_attributes_of_associates returns the query which will return the attributes connected to an associatelist.

ALID AssociateList IDentifier attrs list of attributes which should be returned. Note that “AID” from associatelist

is always returned as the first item

hint Oracle hint (i.e. /+INDEX(T)/) owner Schema Owner (i.e. AWOPER) atable name of table (i.e. AssociateList) aoltable name of objectlist table containing the associates (i.e. AssociateList*associates) stable name of table containing the sources (i.e. SourceList*sources) soltable name of objectlist table containing the sources (i.e. SourceList*sources) stype basetype of the above table (i.e SourceList$sources$’) attrname name of attribute where the type name is stored (i.e. +*sources)

astro.main.AssociateList.q_get_attrs_of_associatelist(ALID, hint='', owner='AWOPER', table=None, soltable=None, type='SourceList$sources$', attrname=None)

q_get_attrs_of_sourcelists returns the name and types of all atributes which are connected to a number of sourcelist.

ALID SLIDs (list of SourceList IDentifiers) hint Oracle hint (i.e. /+INDEX(T)/) owner Schema Owner (i.e. AWOPER) table name of table (i.e. AssociateList) soltable name of objectlist table (i.e. SourceList*sources) type basetype of table row (i.e. SourceList$sources$) attrname name of attribute where the type name is stored (i.e. +*sources)

astro.main.AssociateList.q_get_export_master(sourcelists, schema, associatelisttablename, pairstable, alid, aid)
astro.main.AssociateList.q_get_filter_pairs(awschema, old_tablename, new_tablename)
astro.main.AssociateList.q_get_filter_pairs_master(awschema, old_tablename, new_tablename, aid)
astro.main.AssociateList.q_get_makenestedtemptable(schema, tablename, columns, types, nested_types)
astro.main.AssociateList.q_get_maketemptable(schema, tablename, columns, types, indxs=None)
astro.main.AssociateList.q_get_pairs(SL1, SL2, awschema, TempTable, STempTable, search_distance, depth, change_order=False, trixel_search_method=0, use_trixels=True)
astro.main.AssociateList.q_get_rowcount_of_associatelist(ALID, hint='', owner='AWOPER', oltable=None)

q_get_rowcount_of_associatelist returns the query which will obtain the number of rows (i.e. the number of sources) in the specified associatelist

ALID AssociateList IDentifier hint Oracle hint (i.e. /+INDEX(T)/) owner Schema Owner (i.e. AWOPER) oltable Name of objectlist table containing the associates (i.e. AssociateList*associates)

astro.main.AssociateList.q_get_slids_of_associatelist(ALID, hint='', owner='AWOPER', table=None)

q_get_slids_of_associatelist returns the query which will obtain the SLID’s of the sourcelists which were input to the associatelist

ALID AssociateList IDentifier hint Oracle hint (i.e. /+INDEX(T)/) owner Schema Owner (i.e. AWOPER) table name of table (i.e. AssociateList)

astro.main.AssociateList.wholesky(llRA, llDEC, lrRA, lrDEC, urRA, urDEC, ulRA, ulDEC)

astro.main.AssociateListNew module

class astro.main.AssociateListNew.AssociateList(debug=0)

Bases: common.database.DataObject.DataObject, astro.main.OnTheFly.OnTheFly

This class represents the result of the association between two or more sourcelists.

ALID

AssociateList ID [None]

CHAIN = 1
MASTER = 2
MATCH = 3
MOSAIC = 4
NONINTERLACED = True
OBJECT

Object name [None]

PROCESS_TIME = 100
WITH_NULLS = True
associate_lists(list1=None, list2=None)
associate_lists_BIG(list1=None, list2=None)
associate_lists_MULTI()
associate_sourcelists()
associatelisttype

Type of AssociateList [None]

associates

Definition of base-type of AssociateList [None]

check_master()
check_number_of_associates()
check_preconditions()
commit()
consistency_check(silent=False)
copy_attributes()
count_from_flag_on_associates(mask=None, mode='ANY', count=None, countmode='EQ')

count_from_flag[_on_associates] returns the number of associations which contain sources from specified sourcelists

mask mask to filter which associations are to be counted. The mask works as a
bitmask, each bit set representing a sourcelist which was input to the associatelist. For example bit 2 set means that only the wanted associations which contain a source from sourcelist number 2 will be counted (depends on mode). Default: all associations.
mode Determines how the masking works. Mode can be:
ALL Use only the associations which contain sources from exact
the specified sourcelists.
INTERSECT Use only the associations which contain sources from at least
the specified sourcelists.
ANY Use only the associations which contain sources from at least
one of the specified sourcelists.

Default (if mask is specified): ANY.

count determines the number of different sourcelists which participate in an
association, i.e. if count = 3 then only associations are counted which have sources from 3 different sourcelists (depends on countmode). Actually count is the bitcount of the number of participating sourcelists.
countmode Mode can be:
LT returns number of associations with less than the specified
number of participating sourcelists.
LE returns number of associations with less than or equal the
specified number of participating sourcelists.
EQ returns number of associations with exact the specified number
of participating sourcelists.
GE returns number of associations with greater than or equal the
specified number of participating sourcelists.
GT returns number of associations with greater than the specified
number of participating sourcelists.

Default: EQ. Only works when count is defined.

count_from_members_on_associates(members=0, mode='EQ')

count_from_members[_on_associates] counts the number of associations which have a specified number of groupmembers.

members Number of members to look for (depends on mode) mode Mode can be:

LT returns number of associations with less than the specified
number of members.
LE returns number of associations with less than or equal the
specified number of members
EQ returns number of associations with exact the specified number
of members
GE returns number of associations with greater than or equal the
specified number of members
GT returns number of associations with greater than the specified
number of members.

Default: EQ.

creation_date

Date this object was created [None]

dec_step = 1.0
derive_timestamp()
filename

The name of the associated file [None]

get_attributes_of_pairs(dict1=None, dict2=None)
get_attributes_of_singles(sourcelistnumber, dict=None)
get_attributes_on_associates()

get_attributes[_on_associates] returns all available attributes of all participating SourceLists.

get_data_from_area_on_associates(Area=None, depth=20, attrlist=[], mask=None, mode='ANY', count=None, countmode='EQ')

get_data[_on_associates] returns data associated with requested attributes of the associated sources. The function returns a dictionary with as key the AID (Association IDentifier) and as value the attribute values according to the (modified) list of specified attributes, for each requested sourcelist a list.

Area specifies the wanted area [coverage of AssociateList]. depth the HTM trixel index depth on which the area is defined [20]. attrlist list containing the wanted attributes. Note that SLID and SID will always

be returned and that SLID is the first and SID the second item. On return attrlist will be modified accordingly. Default: [].
mask mask to filter which associations are to be returned. The mask works as a
bitmask, each bit set representing a sourcelist which was input to the associatelist. For example bit 2 set means that only the wanted attributes of sourcelist number 2 will be returned (depends on mode). The mask can also be a list of SLIDs (SourceList IDentifiers) or SourceList Instances. Default: all associations.
mode Determines how the masking works. Mode can be:
ALL Use only the associations which contain sources from exact
the specified sourcelists.
INTERSECT Use only the associations which contain sources from at least
the specified sourcelists.
ANY Use only the associations which contain sources from at least
one of the specified sourcelists.

Default (if mask is specified): ANY.

count determines the number of different sourcelists which participate in an
association, i.e. if count = 3 then only associations are counted which have sources from 3 different sourcelists (depends on countmode). Actually count is the bitcount of the number of participating sourcelists.
countmode Mode can be:
LT returns number of associations with less than the specified
number of participating sourcelists.
LE returns number of associations with less than or equal the
specified number of participating sourcelists.
EQ returns number of associations with exact the specified number
of participating sourcelists.
GE returns number of associations with greater than or equal the
specified number of participating sourcelists.
GT returns number of associations with greater than the specified
number of participating sourcelists.

Default: EQ. Only works when count is defined.

get_data_on_associates(attrlist=[], mask=None, mode='ANY', count=None, countmode='EQ')

get_data[_on_associates] returns data associated with requested attributes of the associated sources. The function returns a dictionary with as key the AID (Association IDentifier) and as value the attribute values according to the (modified) list of specified attributes, for each requested sourcelist a list.

attrlist list containing the wanted attributes. Note that SLID and SID will always
be returned and that SLID is the first and SID the second item. On return attrlist will be modified accordingly. Default: [].
mask mask to filter which associations are to be returned. The mask works as a
bitmask, each bit set representing a sourcelist which was input to the associatelist. For example bit 2 set means that only the wanted attributes of sourcelist number 2 will be returned (depends on mode). The mask can also be a list of SLIDs (SourceList IDentifiers) or SourceList Instances. Default: all associations.
mode Determines how the masking works. Mode can be:
ALL Use only the associations which contain sources from exact
the specified sourcelists.
INTERSECT Use only the associations which contain sources from at least
the specified sourcelists.
ANY Use only the associations which contain sources from at least
one of the specified sourcelists.

Default (if mask is specified): ANY.

count determines the number of different sourcelists which participate in an
association, i.e. if count = 3 then only associations are counted which have sources from 3 different sourcelists (depends on countmode). Actually count is the bitcount of the number of participating sourcelists.
countmode Mode can be:
LT returns number of associations with less than the specified
number of participating sourcelists.
LE returns number of associations with less than or equal the
specified number of participating sourcelists.
EQ returns number of associations with exact the specified number
of participating sourcelists.
GE returns number of associations with greater than or equal the
specified number of participating sourcelists.
GT returns number of associations with greater than the specified
number of participating sourcelists.

Default: EQ. Only works when count is defined.

get_distances_on_associates()

get_distances calculates the distances between all possible pairs in an association. The output is a dictionary with as key the associate ID (AID) and as value a list containing for each pair a tuple which consists of three items: ((SLID1, SID1), (SLID2, SID2), DISTANCE). SLID1 is always <= SLID2 and when SLID1=SLID2 SID1 < SID2.

get_number_of_associations()
get_number_of_pairs()
get_number_of_singles()
get_onthefly_dependencies(config=None)

The dependencies that will be onthefly processable This overrides the method in OnTheFly because input_lists must be filled in and not sourcelists

get_pairs()
get_singles()
get_statistics_of_pairs()
getitem_on_associates(index)
globalname

The name used to store and retrieve file to and from Storage [None]

inputassociatelist

Input AssociateList [None]

is_BIG = False
is_MULTI = False
is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

len_on_associates()
llDEC

Declination of lower left containing box [deg]

llRA

Right Ascension of lower left containing box [deg]

lrDEC

Declination of lower right containing box [deg]

lrRA

Right Ascension of lowe r right containing box [deg]

make(is_BIG=False, is_MULTI=False)
make_Master_AssociateList(sourcelists, filters, declo, dechi, distance, decstep=0.001, decstep2=0.001)

make_Master_AssociateList creates a Master AssociateList from a list of SourceLists.

sourcelists List of SourceLists which should be Master Associated. The Master is the first one. filters Filters used to select the source which should participate in the association. declo, dechi Range in Declination in which the input SourceLists have there sources. distance Search distance in arcsec for pairing sources. decstep Step in Declination for looping over Master sources between declo and dechi. decstep2 Step in Declination for looping over the other sources.

make_from_dictionary_on_associates(dictionary=None)

make_from_dictionary[_on_associates] creates an AssociateList where the associations are defined by the user. If the input_lists contain two Sourcelists, the dictionary should contain as keys the AIDs, as value a tuple containing two lists, the first list containing the SIDS of the first SourceList, the second list containing those of the second SourceList. If the input_lists contains an AssociateList, the dictionary should then contain as keys the AIDs, as value a list of SIDs.

make_from_list_on_associates(inputlist)

make_from_list[_on_associates] creates an AssociateList where the associations are defined by the user. The inputlist should contain the lists of (SLID, SID) tuples which make up one association. For xample the input list containing [[(1,0), (2,0), (3,1)], [(1,1), (2,1)], [(3,2)]] describes three associations, the first with three sources, the second with2 and the last with only 1 source. The associatelisttype will be set to 0, the inputsourcelists will be calculated from the inputlist. The user is free to specify name, process_params, llRA etc and OBJECT. If the AssociateList already exists, the associations are append to the associatelist. The should however contain the same Sourclists as the existing AssociateList.

make_image_dict_on_associates(aids, mode='sky')

make_image_dict[_on_associates] creates an image dict which can be input to the image server software.

aids An aid (or a list of aids) for which the input is generated. mode Produce sky (default) or grid coordinates.

make_mask(mask)

Converts a list or tuple of SLIDs or SourceLists into a bitmask.

make_matched_associatelist()
make_skycat_on_associates(slid, mask=None, mode='ALL')

Make a skycat catalog to visualize associated sources.

If mask and mode are not specified the catalog will be made for the associates which have a member in all input SourceLists.

Possible arguments:
slid: SourceList identifier, catalog is made for this SourceList mask: See AssociateList.get_data_on_associates() method mode: See AssociateList.get_data_on_associates() method

AssociateList.sourcelists can be used to find back the SLIDs taking part in the AssociateList.

migrate_flag()
name

Name of the AssociateList [None]

number_of_associates

Number of associates [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

onthefly_after_set_dependencies(config)

customized version for setting the associate type, before the actual make is called

process_params

Processing parameters [None]

ra_step = 1.0
set_associatelist_identifier()
set_assoclist_name()

Generate and set the unique filename for this AssociateList.

set_coordinate_ranges(L1, L2)
set_made()
set_process_parameters_from_dict(pars={})

pars is a dictionary of the type e.g.: {‘BiasFrame.process_params.SIGMA_CLIP’:8}

set_search_area(llRA, llDEC, lrRA, lrDEC, urRA, urDEC, ulRA, ulDEC)
set_search_distance(search_distance)
set_sextractor_flag_mask(mask)
set_single_out_closest_pairs(single_out_closest_pairs)
set_user_config(user_config_dict)

Store the user specified configuration (as produced e.g. by the util.Pars tool) in a transient attribute.

sourcelists

Input list of SourceLists [None]

sql_query_on_associates(attrlist=[], mask=None, mode='ANY')
ulDEC

Declination of upper left containing box [deg]

ulRA

Right Ascension of upper left containing box [deg]

update_number_of_associates()
urDEC

Declination of upper right containing box [deg]

urRA

Right Ascension of upper right containing box [deg]

exception astro.main.AssociateListNew.AssociateListError

Bases: Exception

class astro.main.AssociateListNew.AssociateListParameters

Bases: common.database.DBMain.DBObject

SEARCH_DISTANCE

Radius of search for associates [arcsec]

SEXTRACTOR_FLAG_MASK

SExtractor flag mask value to use to filter sources [None]

SINGLE_OUT_CLOSEST_PAIRS

Single out closest pairs [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

astro.main.AssociateListNew.alid_sort(AL1, AL2)
astro.main.AssociateListNew.correct_sky_overlap(r)
astro.main.AssociateListNew.find_bounding_box(lists)
astro.main.AssociateListNew.get_associate_htm_depth(search_distance)

Finds the htm depth needed for neighbour search

astro.main.AssociateListNew.get_sky_boundingbox(tuple1, tuple2)
astro.main.AssociateListNew.get_sky_overlap(tuple1, tuple2)
astro.main.AssociateListNew.get_sql_trixel_search_method(method, schema_owner, levelin=None, levelout=None, radius=None, prefix=None)
astro.main.AssociateListNew.inputselectquery_Master(cursor, sourcelists, filters, schema, pairstable, distance, declo, dechi, dlo, dhi, aid)
astro.main.AssociateListNew.iswholesky(s)
astro.main.AssociateListNew.make_decode_query(slids, name='T1.SLID')
astro.main.AssociateListNew.make_select_sources_query(htm_range, depth_factor, alias=None, mode='N', index='"HTM"', SL=None, flag=255, awschema=None)
astro.main.AssociateListNew.onesource(llRA, llDEC, lrRA, lrDEC, urRA, urDEC, ulRA, ulDEC)
astro.main.AssociateListNew.print_insert_results(cursor, q, alid)
astro.main.AssociateListNew.print_pairstable(cursor, schema, pairstable)
astro.main.AssociateListNew.print_query(q)
astro.main.AssociateListNew.q_get_attributes_of_associates(ALID, attrs, hint='', owner='AWOPER', atable=None, aoltable=None, stable=None, soltable=None, stype='SourceList$sources$', attrname=None, cursor=None)

q_get_attributes_of_associates returns the query which will return the attributes connected to an associatelist.

ALID AssociateList IDentifier attrs list of attributes which should be returned. Note that “AID” from associatelist

is always returned as the first item

hint Oracle hint (i.e. /+INDEX(T)/) owner Schema Owner (i.e. AWOPER) atable name of table (i.e. AssociateList) aoltable name of objectlist table containing the associates (i.e. AssociateList*associates) stable name of table containing the sources (i.e. SourceList*sources) soltable name of objectlist table containing the sources (i.e. SourceList*sources) stype basetype of the above table (i.e SourceList$sources$’) attrname name of attribute where the type name is stored (i.e. +*sources)

astro.main.AssociateListNew.q_get_attrs_of_associatelist(ALID, hint='', owner='AWOPER', table=None, soltable=None, type='SourceList$sources$', attrname=None)

q_get_attrs_of_sourcelists returns the name and types of all atributes which are connected to a number of sourcelist.

ALID SLIDs (list of SourceList IDentifiers) hint Oracle hint (i.e. /+INDEX(T)/) owner Schema Owner (i.e. AWOPER) table name of table (i.e. AssociateList) soltable name of objectlist table (i.e. SourceList*sources) type basetype of table row (i.e. SourceList$sources$) attrname name of attribute where the type name is stored (i.e. +*sources)

astro.main.AssociateListNew.q_get_export_master(sourcelists, schema, associatelisttablename, pairstable, alid, aid)
astro.main.AssociateListNew.q_get_filter_pairs(awschema, old_tablename, new_tablename)
astro.main.AssociateListNew.q_get_filter_pairs_master(awschema, old_tablename, new_tablename, aid)
astro.main.AssociateListNew.q_get_makenestedtemptable(schema, tablename, columns, types, nested_types)
astro.main.AssociateListNew.q_get_maketemptable(schema, tablename, columns, types, indxs=None)
astro.main.AssociateListNew.q_get_pairs(SL1, SL2, awschema, TempTable, STempTable, search_distance, depth, change_order=False, trixel_search_method=0, use_trixels=True)
astro.main.AssociateListNew.q_get_pairs_multi(cr, inp_sl_list, ra_1, ra_2, dec_1, dec_2, awschema, TempTable, STempTable, TempTable2, search_distance, depth, trixel_search_method=0, use_trixels=True)
astro.main.AssociateListNew.q_get_rowcount_of_associatelist(ALID, hint='', owner='AWOPER', oltable=None)

q_get_rowcount_of_associatelist returns the query which will obtain the number of rows (i.e. the number of sources) in the specified associatelist

ALID AssociateList IDentifier hint Oracle hint (i.e. /+INDEX(T)/) owner Schema Owner (i.e. AWOPER) oltable Name of objectlist table containing the associates (i.e. AssociateList*associates)

astro.main.AssociateListNew.q_get_slids_of_associatelist(ALID, hint='', owner='AWOPER', table=None)

q_get_slids_of_associatelist returns the query which will obtain the SLID’s of the sourcelists which were input to the associatelist

ALID AssociateList IDentifier hint Oracle hint (i.e. /+INDEX(T)/) owner Schema Owner (i.e. AWOPER) table name of table (i.e. AssociateList)

astro.main.AssociateListNew.wholesky(llRA, llDEC, lrRA, lrDEC, urRA, urDEC, ulRA, ulDEC)

astro.main.Astrom module

the world coordinate system of a FITS file

class astro.main.Astrom.Astrom

Bases: common.database.DBMain.DBObject

Base container for astrometric parameters.

CD1_1

Value at (1,1) of pixel coordinate translation matrix [None]

CD1_2

Value at (1,2) of pixel coordinate translation matrix [None]

CD2_1

Value at (2,1) of pixel coordinate translation matrix [None]

CD2_2

Value at (2,2) of pixel coordinate translation matrix [None]

CRPIX1

Reference pixel in X [pixel]

CRPIX2

Reference pixel in Y [pixel]

CRVAL1

Physical value of the reference pixel X [deg]

CRVAL2

Physical value of the reference pixel Y [deg]

CTYPE1

Pixel coordinate system and projection of first axis (X) [None]

CTYPE2

Pixel coordinate system and projection of second axis (Y) [None]

copy()
get_pixelarea()

Calculate area of a pixel from the CDm_n matrix

Given the CD matrix, which defines the scale and rotation from grid coordinates to physical coordinates:

Then the area of a pixel in physical coordinates is roughly

PIXELAREA = ABS(CD11*CD22 - CD21*CD12)

The units of “pixelarea” are CTYPE1*CTYPE2, which should be arcsec-squared for most - if not all - widefield imaging instruments.

get_pixelscale()

Returns the pixelscale in arcsec

get_rotation_angle()

Returns angle, in degrees, of detector pixel coordinate system with respect to the world coordinate system.

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

set_from_header(header)
shift_refcoord(dx, dy, scale_xx, scale_xy, scale_yx, scale_yy)

Shift the reference coordinate by dx, dy pixels,

This method uses the full CD matrix to transform a pixel offset into a coordinate offset.

This method is used to apply the astrometric offset of the AstrometricCorrection object. E.g:

astrom = Astrom() corr = AstrometricCorrection()

astrom.shift_refcoord(corr.xoffset, corr.yoffset)

According to http://archive.eso.org/dicb/ CDn_m gives the translation from array axis n to coordinate axis m. (images (CD1_2, CD2_1 >> 0)).

shift_refpix(dx, dy)

Shift the reference pixel by dx, dy pixels

This method is used (a.o.) to correct the reference pixels after image trimming:

astrom = Astrom() chip = Chip()

astrom.shift_refpix(-chip.TRIMX1+1, -chip.TRIMY1+1)

update_header(header)

astro.main.AstrometricCorrection module

Astrometric Correction

class astro.main.AstrometricCorrection.AstrometricCorrection(mosaic=True)

Bases: common.database.DBMain.DBObject, astro.main.ProcessTarget.ProcessTarget

A calibration object containing a prelimary astrometric offset

WFI suffers from large astrometric offsets. In order to correct these, the header and Astrom object of a RawScienceFrame can be updated. This correction is determined by running preastrom on the concatenated data of all input chips. E.g.:

cats = [] for raw_frame in raw_frames:

c = Catalog() c.frame = raw_frame c.make() cats.append(c)

corr = AstrometricCorrection() corr.catalogs = cats corr.make()

for cat in corr.catalogs:
cat.frame.astrom.shift_refcoord(corr.xoffset, corr.yoffset, corr.scale_xx, corr.scale_xy, corr.scale_yx, corr.scale_yy) cat.frame.update_header() cat.frame.save()
See also:
Astrom.shift_refcoord()
BAD_SCALE
BAD_SOLUTION
catalogs

Input catalogs [None]

creation_date

Date this object was created [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make()

Determine preliminary astrometric correction

Dependencies:
catalogs – A list of catalogs, one catalog for each chip
object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

scale_xx

Affine scaling correction coefficient a1 [None]

scale_xy

Affine scaling correction coefficient a2 [None]

scale_yx

Affine scaling correction coefficient b1 [None]

scale_yy

Affine scaling correction coefficient b2 [None]

verify()

Verify the result

The following flags may be set:
BAD_SCALE – The affine transformation suggests a scaling of the
CD matric that would change one of the matrix elements by more than one percent

BAD_SOLUTION – ?

xoffset

Affine scaling correction offset coefficent a0 [pixel]

yoffset

Affine scaling correction offset coefficent b0 [pixel]

exception astro.main.AstrometricCorrection.AstrometricCorrectionError

Bases: Exception

astro.main.AstrometricParameters module

class astro.main.AstrometricParameters.AstrometricParameters(pathname='')

Bases: common.database.DBMain.DBObject, astro.main.ProcessTarget.ProcessTarget

This class represents the calfile used in the astrometric calibration of the science images.

The details of the steps performed in the derive_astrometry() method which derives the formal astrometric solution with LDAC are as follows:

Steps: Sextractor.sex - creates original catalog from source
frame

LDAC.ldacconv - converts SExtractor catalog to cat_name LDAC.preastrom - determines linear affine parameters and

creates USNO catalog to be associated
LDAC.aplastrom - applies affine prameters from AFFINE
table created by preastrom
LDAC.filter - filters out most non-stellar-like
sources from OBJECTS table
LDAC.associate - associates modified catalog from
aplastrom after preatrom to the USNO catlog output from preatrom
LDAC.make_ssc - makes a pairs catalog from individual
catalogs output from associate
LDAC.astrom - runs the astrometric solution on the
unmodified catalog output from preastrom using the pairs catalog output from make_ssc
LDAC.aplastrom - applies the OBJECTS table of the
astrom output catalog with the values from the ASTROM table added by astrom
LDAC.make_distort - adds the DISTORTIONS table, converting
back to world coordinates
Files: cat_name - input LDAC catalog to preastrom as
converted from the SExtractor catalog by ldacconv (contains first OBJECTS table)
refcat - environmental pointer to USNO input
reference catalog (input to preastrom)
*.cat1 - output catalog of preastrom (contains
unaltered OBJECTS table and the addition of the AFFINE table containing the linear solution from preastrom) and input catalog to aplastrom and astrom
*.cat2 - output reference catalog from preastrom
(contains a copy of the applicable portion of the USNO catalog) and input catalog to associate

distances_file - output distances catalog from preastrom *.cat3 - output catalog of aplastrom (has had

OBJECTS table modified by values in AFFINE table) and input catalog to filter
*.cat3a - output catalog of filter (OBJECTS table
filtered to retain only most stellar-like sources, i.e., most circular sources) input catalog to associate
*.cat4 - output catalog of associate (contains
pairing information from extracted sources) and input catalog to make_ssc
*.cat5 - output catalog of associate (contains
pairing information from reference sources) and input catalog to make_ssc
*.cat6 - output catalog of make_ssc (contains
contents of associated catalogs filtered to single occurance of sources) and input pairs catalog to astrom
*.cat7 - output catalog of astrom (contains
unmodified OBJECTS table and AFFINE table from preastrom, and ASTROM table from astrom) and input to aplastrom

residuals_file - output residuals catalog from astrom self.residuals - name of final residuals catalog (derived

from residuals_file separately)
*.cat8 - output of aplastrom (has had OBJECTS table
modified by values in ASTROM table) and input to make_distort
astcat_file - output catalog of make_distort (has had
DISTORTIONS table added) containing the final solution information
CD1_1

Linear transformation matrix parameter at i,j=1,1 (a1) [deg]

CD1_2

Linear transformation matrix parameter at i,j=1,2 (a2) [deg]

CD2_1

Linear transformation matrix parameter at i,j=2,1 (b1) [deg]

CD2_2

Linear transformation matrix parameter at i,j=2,2 (b2) [deg]

CRPIX1

Reference pixel in X [pixel]

CRPIX2

Reference pixel in Y [pixel]

CRVAL1

Physical value of the reference pixel X [deg]

CRVAL2

Physical value of the reference pixel Y [deg]

CTYPE1

Pixel coordinate system and projection of first axis (X) [None]

CTYPE2

Pixel coordinate system and projection of second axis (Y) [None]

FITERRS

Errors on fitted parameters [rad]

FITPARMS

Degrees of freedom of fitted parameters [None]

INCONSISTENT_SOLUTION

The derived parameters differ too greatly from original parameters

MEAN_DDEC

Average residual w.r.t. reference catalog: DEC [arcsec]

MEAN_DDEC_OVERLAP

Average residual w.r.t. overlap positions: DEC [arcsec]

MEAN_DRA

Average residual w.r.t. reference catalog: RA [arcsec]

MEAN_DRA_OVERLAP

Average residual w.r.t. overlap positions: RA [arcsec]

NFITPARM

Number of fitted parameters [None]

NO_SOLUTION_FOUND

No formal solution found, using original astrometric values.

NREF

Number of matched pairs of reference stars [None]

NREF_TOO_HIGH

There are too many reference stars.

NREF_TOO_LOW

There are too few reference stars.

N_OVERLAP

Number of matched pairs of overlapping stars [None]

N_OVERLAP_TOO_HIGH

There are too many overlap stars.

N_OVERLAP_TOO_LOW

There are too few overlap stars.

PREASTROM_FAILED

Preastrom failed with default settings and less stringent settings had to be used.

PROCESS_TIME = 60
PV1_0

Non-linear transformation matrix Parameter value a0 [None]

PV1_1

Non-linear transformation matrix Parameter value b11 [None]

PV1_10

Non-linear transformation matrix Parameter value b110 [None]

PV1_2

Non-linear transformation matrix Parameter value b12 [None]

PV1_3

Non-linear transformation matrix Parameter value b13 [None]

PV1_4

Non-linear transformation matrix Parameter value b14 [None]

PV1_5

Non-linear transformation matrix Parameter value b15 [None]

PV1_6

Non-linear transformation matrix Parameter value b16 [None]

PV1_7

Non-linear transformation matrix Parameter value b17 [None]

PV1_8

Non-linear transformation matrix Parameter value b18 [None]

PV1_9

Non-linear transformation matrix Parameter value b19 [None]

PV2_0

Non-linear transformation matrix Parameter value c0 [None]

PV2_1

Non-linear transformation matrix Parameter value d11 [None]

PV2_10

Non-linear transformation matrix Parameter value d110 [None]

PV2_2

Non-linear transformation matrix Parameter value d12 [None]

PV2_3

Non-linear transformation matrix Parameter value d13 [None]

PV2_4

Non-linear transformation matrix Parameter value d14 [None]

PV2_5

Non-linear transformation matrix Parameter value d15 [None]

PV2_6

Non-linear transformation matrix Parameter value d16 [None]

PV2_7

Non-linear transformation matrix Parameter value d17 [None]

PV2_8

Non-linear transformation matrix Parameter value d18 [None]

PV2_9

Non-linear transformation matrix Parameter value d19 [None]

RMS

Two-dimensional Root-Mean-Square (RMS) of the RA/DEC residuals [arcsec]

RMS_HAS_INCREASED

RMS increased compared to previous version.

RMS_OVERLAP

Two-dimensional Root-Mean-Square (RMS) of the RA/DEC overlap residuals [arcsec]

RMS_OVERLAP_HAS_INCREASED

RMS_OVERLAP has increased compared to previous version.

RMS_OVERLAP_TOO_HIGH

Overlap RMS too high.

RMS_TOO_HIGH

RMS too high.

SEEING

The derived seeing [arcsec]

SIGMA_HAS_INCREASED

SIG_DRA or SIG_DDEC have increased compared to previous version.

SIGMA_OVERLAP_HAS_INCREASED

SIG_DRA_OVERLAP or SIG_DDEC_OVERLAP have increased compared to previous version.

SIGMA_OVERLAP_TOO_HIGH

SIG_DRA_OVERLAP or SIG_DDEC_OVERLAP is too high.

SIGMA_TOO_HIGH

SIG_DRA or SIG_DDEC is too high.

SIG_DDEC

Standard deviation of DEC residuals [arcsec]

SIG_DDEC_OVERLAP

Standard deviation of DEC residuals [arcsec]

SIG_DRA

Standard deviation of RA residuals [arcsec]

SIG_DRA_OVERLAP

Standard deviation of RA residuals [arcsec]

associateconf

The associate configuration [None]

astromconf

The astrom configuration [None]

check_preconditions()
chip

Information about the chip [None]

commit()
compare(exact=False)

Compare method for AstrometricParameters

Checks values tested in verify to see how they compare to the previous version derived from the same RawFrame and sets a flag if they are out of tolerence.

exact : bool
Use most recent, valid version derived from the same ReducedScienceFrame, otherwise from the same RawScienceFrame.
compare_residuals_to_regrid(derived_type='sextractor', detect_thresh=10.0, filter_stellar=True, inter_color_tol=1.0, filter_closest=True)

Compare the derived astrometric solution made or stored in this object to the solution as applied to a RegriddedFrame.

derived_type: type of method to use for creating catalog

detect_thresh: SExtractor DETECT_THRESH value

filter_stellar: filter out most non-stellar sources from input
catalogs prior to association
inter_color_tol: LDAC.associate INTER_COLOR_TOL value
filter_closest: toggle filtering of closest pairs when creating
residuals catalog (does not affect existing catalogs)

The applied solution is represented by a catalog extracted from a RegriddedFrame created by applying the astrometric solution to the source ReducedScienceFrame. The derived (predicted) solution can be represented in one of three ways: 1. the catalog that the solution parameters are derived from as

created by LDAC during the AstrometricParameters make (requires that the make was just run in the same directory so the catalog is available)
  1. a catalog extracted from the source ReducedScienceFrame using the astrometric solution parameters stored in the AstrometricParameters object
  2. a catalog extracted from the source ReducedScienceFrame using the original parameters stored in the frame header with the astrometric solution parameters stored in the AstrometricParameters object applied by LDAC

The selection of the type of the derived catalog used in the comparison is done with the ‘derived_type’ parameter and is one of ‘solution’, ‘sextractor’, or ‘ldac’ and are related to the above methods in the following way:

solution: use catalog from method 1.
sextractor: use catalog from method 2.
ldac: use catalog from method 3.
copy_attributes()
creation_date

Date this object was created [None]

derive_and_set_seeing(astcat_file)
derive_astrometry()

Derive astrometric solution with LDAC.

Steps: Sextractor.sex - creates original catalog from source
frame

LDAC.ldacconv - converts SExtractor catalog to cat_name LDAC.preastrom - determines linear affine parameters and

creates USNO catalog to be associated
LDAC.aplastrom - applies affine prameters from AFFINE
table created by preastrom
LDAC.filter - filters out most non-stellar-like
sources from OBJECTS table
LDAC.associate - associates modified catalog from
aplastrom after preatrom to the USNO catlog output from preatrom
LDAC.make_ssc - makes a pairs catalog from individual
catalogs output from associate
LDAC.astrom - runs the astrometric solution on the
unmodified catalog output from preastrom using the pairs catalog output from make_ssc
LDAC.aplastrom - applies the OBJECTS table of the
astrom output catalog with the values from the ASTROM table added by astrom
LDAC.make_distort - adds the DISTORTIONS table, converting
back to world coordinates
Files: cat_name - input LDAC catalog to preastrom as
converted from the SExtractor catalog by ldacconv (contains first OBJECTS table)
refcat - environmental pointer to USNO input
reference catalog (input to preastrom)
*.cat1 - output catalog of preastrom (contains
unaltered OBJECTS table and the addition of the AFFINE table containing the linear solution from preastrom) and input catalog to aplastrom and astrom
*.cat2 - output reference catalog from preastrom
(contains a copy of the applicable portion of the USNO catalog) and input catalog to associate

distances_file - output distances catalog from preastrom *.cat3 - output catalog of aplastrom (has had

OBJECTS table modified by values in AFFINE table) and input catalog to filter
*.cat3a - output catalog of filter (OBJECTS table
filtered to retain only most stellar-like sources, i.e., most circular sources) input catalog to associate
*.cat4 - output catalog of associate (contains
pairing information from extracted sources) and input catalog to make_ssc
*.cat5 - output catalog of associate (contains
pairing information from reference sources) and input catalog to make_ssc
*.cat6 - output catalog of make_ssc (contains
contents of associated catalogs filtered to single occurance of sources) and input pairs catalog to astrom
*.cat7 - output catalog of astrom (contains
unmodified OBJECTS table and AFFINE table from preastrom, and ASTROM table from astrom) and input to aplastrom

residuals_file - output residuals catalog from astrom self.residuals - name of final residuals catalog (derived

from residuals_file separately)
*.cat8 - output of aplastrom (has had OBJECTS table
modified by values in ASTROM table) and input to make_distort
astcat_file - output catalog of make_distort (has had
DISTORTIONS table added) containing the final solution information
derive_astrometry_with_scamp()
derive_timestamp()
field_err

Global position error [arcsec]

filter

Information about the filter [None]

gastrom

The Global Astrometric solution [None]

get_canonical_name_for_residuals()

Generate the unique filename for the associated residuals file.

get_canonical_name_for_scamp_residuals()

Generate the unique filename for the associated residuals file.

get_default_config()

Return the default configuration parameters.

get_fixed_config()

Return the fixed sextractor configuration parameters.

get_fixed_params_list()

Return the fixed sextractor parameters.

get_pixelarea()

Calculate area of a pixel from the CDm_n matrix

Given the CD matrix, which defines the scale and rotation from grid coordinates to physical coordinates:

Then the area of a pixel in physical coordinates is roughly

PIXELAREA = ABS(CD11*CD22 - CD21*CD12)

The units of “pixelarea” are CTYPE1*CTYPE2, which should be deg-squared for most, if not all, widefield imaging instruments.

get_pixelscale()

Returns the pixelscale in arcsec per pixel

get_previous_version()

Return previous version of this object. If it does not exist, return None.

get_rotation_angle()

Returns angle, in degrees, of detector pixel coordinate system with respect to the world coordinate system.

has_inspect_figures = True
inspect(kappa=3.0, range=None, domain=None, verbose=2, extension='png', interactive=True)

Inspect method for AstrometricParameters

kappa: clipping factor for plot data (iterative clipping at
kappa*sigma of DRA/DDEC level)
range: a tuple defining (xmin, xmax) of DRA, overriding automatic
width determination (does not affect RA, DEC, Xpos, Ypos)
domain: a tuple defining (ymin, ymax) of DDEC, overriding automatic
height determination (does not affect RA, DEC, Xpos, Ypos)
verbose: set the verbosity of the plotting routines
extension: extension of the filetype to save inspection
figures to
interactive: when False, creates inspection plot(s) to be
stored on the dataserver for later retrieval

Plots DRA (delta RA) versus DDEC (delta DEC) residuals; DRA versus RA and XPOS (x position); and DDEC versus DEC and YPOS (y position). By default, all plots are saved as PNG (.png) for later inspection. To change this behavior, set plot_params.EXTENSION to another format (.ps, .eps, etc.) or to None to save nothing.

See the AstromResidualsPlot class for more detailed information:

awe> from astro.plot.AstrometryPlot import AstromResidualsPlot awe> help(AstromResidualsPlot)

To retrieve and inspect the residuals file, use:

awe> DataObject(pathname=aps.residuals).retrieve() awe> aps.inspect()

where ‘aps’ is an AstrometricParameters object.

instrument

Information about the instrument [None]

is_global()

Tests if this object was derived from a global solution.

Can eventually use a dedicated persistent property (e.g., IS_GLOBAL)

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

load()
make()
make_from_header_values()
make_inspect_figures(extension='png')

Create inspection figures for these astrometric parameters.

extension: extension of the filetype to save inspection
figures to
make_residuals_catalog()

make_residual_catalog creates a (Transient) DataObject containing the residuals from the catalog generated by the astrometry routines.

make_scamp_residuals_catalog()
make_with_scamp()
mandatory_dependencies = (('reduced', 1),)
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]

onthefly_after_make(config)

This method is run after making the object (OnTheFly). This is without OnTheFly processing done in the Recipe. After the (OnTheFly) make of an AstrometricParameters object a SourceList should be made, which will/can be used for the GAstrometric and GPhotometric solutuions.

onthefly_before_make(config)

Before making an AstrometricParameters object check for GAS Global AstrometricParameters are not supported in the Target Processor

plot_residuals_to_regrid(derived_type='sextractor', detect_thresh=10.0, filter_stellar=True, inter_color_tol=1.0, filter_closest=True, range=None, domain=None, verbose=2)

Plot the derived astrometric solution made or stored in this object to the solution as applied to a RegriddedFrame.

derived_type: type of method to use for creating catalog

detect_thresh: SExtractor DETECT_THRESH value

filter_stellar: filter out most non-stellar sources from input
catalogs prior to association
inter_color_tol: LDAC.associate INTER_COLOR_TOL value
filter_closest: toggle filtering of closest pairs when creating
residuals catalog (does not affect existing catalogs)
range: a tuple defining (xmin, xmax) of DRA,
overriding automatic width determination (does not affect RA, DEC, Xpos, Ypos)
domain: a tuple defining (ymin, ymax) of DDEC,
overriding automatic height determination (does not affect RA, DEC, Xpos, Ypos)

verbose: set the verbosity of the plotting routines

The applied solution is represented by a catalog extracted from a RegriddedFrame created by applying the astrometric solution to the source ReducedScienceFrame. The derived (predicted) solution can be represented in one of two ways: 1. the catalog that the solution parameters are derived from as

created by LDAC during the AstrometricParameters make (requires that the make was just run in the same directory so the catalog is available)
  1. a catalog extracted from the source ReducedScienceFrame using the astrometric solution parameters stored in the AstrometricParameters object

The selection of the type of the derived catalog used in the comparison is done with the ‘derived_type’ parameter and is one of ‘solution’ or ‘sextractor’ and are related to the above methods in the following way:

solution: use catalog from method 1.

sextractor: use catalog from method 2.

plot_residuals_to_usno(source='applied', range=None, domain=None, verbose=2)

Plot residuals of a catalog with respect to USNO-A2.0.

source: which catalog to use (solution for astcat_file, applied
for RegriddedFrame catalog)
range: a tuple defining (xmin, xmax) of DRA, overriding automatic
width determination (does not affect RA, DEC, Xpos, Ypos)
domain: a tuple defining (ymin, ymax) of DDEC, overriding automatic
height determination (does not affect RA, DEC, Xpos, Ypos)

verbose: set the verbosity of the plotting routines

Find residuals with respect to either the astcat_file of this AstrometricParameters object (requires that the solution be run first) or a catalog extracted from a RegriddedFrame that this solution has been applied to create.

preastromconf

The preastrom configuration [None]

process_params

Processing parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

reduced

The input reduced science frame [None]

residuals

Filename of residuals catalog [None]

save()
scampconf

The SCAMP configuration [None]

classmethod select(**searchterms)

Polymorphs the standard select() found in ProcessTarget (it is extended by adding a filter to remove older AstrometricParameters derived from the same RawScienceFrame).

set_astrometric_parameters(distortion_data, astrom_data, statistics_data)
set_astrometric_parameters_with_scamp()
set_config(ldac=False, scamp=False)

Set configuration objects

set_refcat(filetype='ldac')

Return the name of the reference catalog created from the SourceList.name == self.process_params.REFCAT, or the USNO-A2.0 directory or URL if the reference SourceList does not exist.

sexconf

The SExtractor configuration [None]

template

Information about the template [None]

update_default_config()

Update the sexconf with the default configuration parameters.

update_fixed_config()

Update the sexconf with the fixed configuration parameters.

update_header(hdr)
update_sex_params()

Update the sexparams with the fixed parameters.

verify()

Verify method for AstrometricParameters

Checks limits defined under AstrometricParametersParameters and sets flags if they are out of tolerence.

write_headerfile(headerfile_name='astrom.head')
x_err

Error in polynomial x coefficient [arcsec]

xx_err

Error in polynomial xx coefficient [arcsec]

xy_err

Error in polynomial xy coefficient [arcsec]

y_err

Error in polynomial y coefficient [arcsec]

yy_err

Error in polynomial yy coefficient [arcsec]

exception astro.main.AstrometricParameters.AstrometricParametersError

Bases: Exception

class astro.main.AstrometricParameters.AstrometricParametersParameters

Bases: common.database.DBMain.DBObject

Processing parameters for AstrometricParameters

Processing parameters determine how the object is to be created and the quality control (QC) limits for the newly created object.

MAX_NREF

QC: Maximum number of reference star pairs [None]

MAX_N_OVERLAP

QC: Maximum number of reference star pairs [None]

MAX_RMS

QC: Maximum internal RMS of residuals [arcsec]

MAX_RMS_OVERLAP

QC: Maximum internal RMS of overlap residuals [arcsec]

MAX_SIGMA

QC: Maximum value of SIG_DRA or SIG_DDEC [arcsec]

MAX_SIGMA_OVERLAP

QC: Maximum value of SIG_DRA or SIG_DDEC for overlaps [arcsec]

MIN_NREF

QC: Minimum number of reference star pairs [None]

MIN_N_OVERLAP

QC: Minimum number of overlap star pairs [None]

REFCAT

Name of astrometric reference catalog (filename, URL, or SourceList.name) [None]

SOURCE_CODE_VERSION

The version of the source code [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

astro.main.AstrometricParameters.collect_parameters(astrom_params)
astro.main.AstrometricParameters.create_catalog(frame, filename=None, astrom=None, type='sextractor', detect_thresh=10.0, filter_stellar=True, config=None, params=None, tmpbase=None)

Create a catalog from the file associated with the given frame, optionally applying the astrometric solution parameters from this instance using method type (‘sextractor’ or ‘usno’).

frame: mandatory frame object from which the catalog will be
extracted
filename: optional filename to write catalog to (default is
based on frame.filename)
astrom: optional AstrometricParameters object
type: type of method to use for creating catalog
detect_thresh: SExtractor DETECT_THRESH value (used only if no config
given)
filter_stellar: filter out most non-stellar sources from input
catalogs prior to association
config: optional SextractorConfig object (overwrites
detect_thresh value)

params: optional SextractorParams object

tmpbase: optional temprorary base filename

NOTE: Method type ‘usno’ returns a catalog extracted from USNO-A2.0
catalog covering the area of the input frame. It covers the same area the reference catalog would cover for a local AstrometricParameters run.
astro.main.AstrometricParameters.fractional_difference(a, b)

Utility to find the difference between two values as a fraction of the difference of the values divided by the second value of the pair.

astro.main.AstrometricParameters.get_canonical_name(astrom_params)
astro.main.AstrometricParameters.get_cd_matrix(scale=0.2, rho=0.0)

Return a CD matrix tuple (CD1_1, CD1_2, CD2_1, CD2_2) given a pixel scale (in arcsec) and rotation angle (in degrees) of pixel coordinate system to world coordinate system.

astro.main.AstrometricParameters.get_regrid_residuals_data(residuals_catalog, input_catalogs=[], inter_color_tol=1.0, filter_closest=True, filter_thresh=None, tmpbase=None)

Create a residuals catalog from input_catalogs, write it to disk as residuals_catalog, and return a data dictionary with the contents of residuals_catalog. If residuals catalog exists, simply load the data and return the dictionary.

residuals_catalog: mandatory name of output residuals
input_catalogs: optional list of input catalogs
inter_color_tol: LDAC.associate INTER_COLOR_TOL value
filter_closest: toggle filtering of closest pairs when creating
residuals catalog (does not affect existing catalogs)
filter_thresh: lower limit or tuple range of DETECT_THRESH to
filter (UNIMPLEMENTED!)

tmpbase: optional temprorary base filename

astro.main.AstrometricParameters.load_from_LDAC_fits(astrom_params)

This routine constructs the original AstrometricParameters object from the LDAC fits file.

astro.main.AstrometricParameters.save_to_LDAC_fits(astrom_params)

This routine “pickles” the AstrometricParameters object to an LDAC fits file. The LDAC file only contains a STDTAB table. The data-structure of the table is defined in ASTROMPARAMS_CONF.

astro.main.AstrometricParametersFactory module

astro.main.AstrometricParametersFactory.create_AP()

Instantiate AstrometricParameters object.

astro.main.AtmosphericExtinction module

class astro.main.AtmosphericExtinction.AtmosphericExtinction

Bases: astro.main.AtmosphericExtinction.BaseAtmosphericExtinction

This class represents the atmospheric extinction in magnitudes per unit airmass as derived from at least one set of frames. The class is abstract.

ERROR_TOO_LARGE
EXTINCTION_TOO_HIGH
EXTINCTION_TOO_LOW
check_preconditions()
copy_attributes()
create_dictionary_from_list(objectlist)
creation_date

Date this object was created [None]

derive_airmass()
derive_average_extinction(sig_list)
derive_separate_extinctions()
do_sigmaclipping(ext_dict)
echo_results()
error

Error on atmospheric extinction [mag / airmass]

extcurve

Photometric extinction curve [None]

filter

Information about the Filter [None]

inspect()
instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

iterate_over_stars(raw_pol_list, compare_tpl)
mag_id

Identifier for the photometric band [None]

make()
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

polar

Input source catalogs [None]

process_params

Processing parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

value

Atmospheric extinction [mag / airmass]

verify()
class astro.main.AtmosphericExtinction.AtmosphericExtinctionCoefficient

Bases: astro.main.AtmosphericExtinction.BaseAtmosphericExtinction

chip

Information about the chip [None]

creation_date

Date this object was created [None]

error

Error on atmospheric extinction [mag / airmass]

extcurve

Photometric extinction curve [None]

filter

Information about the Filter [None]

static get(filter_name, chip_name)

This static method is used to retrieve an extinction coefficient from the database for the given filter and chip combination. The input parameters “filter_name” and “chip_name” are both strings.

instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

mag_id

Identifier for the photometric band [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

timestamp_end

End of valid period [None]

timestamp_start

Start of valid period [None]

value

Atmospheric extinction [mag / airmass]

exception astro.main.AtmosphericExtinction.AtmosphericExtinctionError

Bases: Exception

class astro.main.AtmosphericExtinction.AtmosphericExtinctionParameters

Bases: common.database.DBMain.DBObject

MAX_ERROR

QC: Maximum relative (fractional) error [None]

SIGCLIP_LEVEL

QC: Sigma clipping threshold factor [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

class astro.main.AtmosphericExtinction.BaseAtmosphericExtinction

Bases: common.database.DBMain.DBObject, astro.main.ProcessTarget.ProcessTarget

This is the root of all the classes that represent an atmospheric extinction. The class is abstract.

creation_date

Date this object was created [None]

error

Error on atmospheric extinction [mag / airmass]

extcurve

Photometric extinction curve [None]

filter

Information about the Filter [None]

get_extinction()
instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

mag_id

Identifier for the photometric band [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

set_extinction(value, error)
value

Atmospheric extinction [mag / airmass]

class astro.main.AtmosphericExtinction.Extinction

Bases: object

This class represents a single measurement of the extinction. The class is only used internally as an easy mechanism for tracking numbers.

error = 0.0
value = 0.0
astro.main.AtmosphericExtinction.check_chip_attributes_of_inputs(object_list_1, object_list_2)

This little routine checks the properties of the chip attributes of the objects contained in the input lists. It checks whether every chip is included only once in a list, and that both lists contain exactly the same chips.

astro.main.AtmosphericExtinctionCurve module

class astro.main.AtmosphericExtinctionCurve.AtmosphericExtinctionCurve

Bases: astro.main.AtmosphericExtinction.BaseAtmosphericExtinction

This class represents the atmospheric extinction as determined from a standard extinction curve and the shift of this curve as supplied by the input extinction report. The class is concrete.

PROCESS_TIME = 15
check_preconditions()
copy_attributes()
creation_date

Date this object was created [None]

derive_timestamp()
error

Error on atmospheric extinction [mag / airmass]

extcurve

Photometric extinction curve [None]

filter

Information about the Filter [None]

instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

mag_id

Identifier for the photometric band [None]

make()

The atmospheric extinction is derived from an extinction curve evaluated at the central wavelength of the input filter, and the shift of this curve as supplied by the input extinction report. The extinction is per unit airmass.

Required inputs :
filter – the filter for which the extinction is to be
determined

extcurve – a standard extinction curve report – an extinction/monitoring report

Process result :
– a value for the atmospheric extinction and its error
object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

report

Photometric extinction report defining the extinction parameters [None]

value

Atmospheric extinction [mag / airmass]

astro.main.AtmosphericExtinctionFrames module

class astro.main.AtmosphericExtinctionFrames.AtmosphericExtinctionFrames

Bases: astro.main.AtmosphericExtinction.AtmosphericExtinction

This class represents the atmospheric extinction at a particular moment in magnitudes per unit airmass. The extinction is derived from observations of standard fields at two different airmasses. The class is concrete.

check_preconditions()
creation_date

Date this object was created [None]

derive_airmass()
derive_separate_extinctions()

This method returns a dictionary of ((M-m’)_eqt - (M-m’)_pol) for every combination of (M-m’)_pol and (M-m’)_eqt.

equat

Input source catalogs [None]

error

Error on atmospheric extinction [mag / airmass]

extcurve

Photometric extinction curve [None]

filter

Information about the Filter [None]

instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

mag_id

Identifier for the photometric band [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

polar

Input source catalogs [None]

process_params

Processing parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

value

Atmospheric extinction [mag / airmass]

astro.main.AtmosphericExtinctionZeropoint module

class astro.main.AtmosphericExtinctionZeropoint.AtmosphericExtinctionZeropoint

Bases: astro.main.AtmosphericExtinction.AtmosphericExtinction

This class represents the atmospheric extinction at a particular moment in magnitudes per unit airmass. The extinction is derived by combining the measurements of one standard field with a known zeropoint. The class is concrete.

check_preconditions()
creation_date

Date this object was created [None]

derive_airmass()
derive_separate_extinctions()

This method returns a dictionary of (ZP - (M-m’)_pol).

error

Error on atmospheric extinction [mag / airmass]

extcurve

Photometric extinction curve [None]

filter

Information about the Filter [None]

instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

mag_id

Identifier for the photometric band [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

photoms

Photometric zeropoints [mag] and extinctions [mag / airmass]

polar

Input source catalogs [None]

process_params

Processing parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

value

Atmospheric extinction [mag / airmass]

astro.main.AutomaticBitMask module

defines a class for automatic bitmasks (currently only for CoaddedRegriddedFrames from the OmegaCAM instrument)

class astro.main.AutomaticBitMask.AutomaticBitMask(pathname='')

Bases: astro.main.BitMask.BitMask

F_BPIX = 64
F_CORE = 2
F_HALO1 = 8
F_HALO2 = 16
F_HALO3 = 32
F_MAN1 = 128
F_SPKD = 4
F_SPKR = 1
PROCESS_TIME = 600
check_preconditions()

Check preconditions are satisfied.

copy_attributes()

Copy attributes from input.

filter = None
frame = None
get_canonical_name()

Generate the unique filename for this HotPixelMap.

get_default_config()

Return the sextractor parameters that differ from the defaults

get_fixed_config()

Return the fixed sextractor parameters.

get_fixed_params_list()

Return the fixed sextractor parameters.

get_saturation()

Extract saturation level from coadd header HISTORY keywords.

FIXME: add saturation to coadd persistent properties?

initialize_filter_attribute()
initialize_instrument_attribute()
initialize_observingblock_attribute()
initialize_template_attribute()
instrument = None
make()

Make the object.

make_badpixel_mask()

Run maskpix to identify saturated and other bad pixels and create the bad pixel mask image.

make_catalog_and_segmentation_image()

Create an ASCII catalog and segmentation image.

make_flag_thumbnail()

Create a “flag” thumbnail for this BitMask with “color bar”.

make_inspect_figures()

Create inspection figures for this bitmask.

extension: extension of the filetype to save inspection
figures to
make_mask_thumbnail()

Create a basic thumbnail for this BitMask

make_masks()

Create intermediate masks.

make_overlay_thumbnail()

Overlay the frame thumbnail with information from this BitMask.

make_starhalo_mask()

Run corryc, regstar, and maskstar to correct core centers, identify star/halo regions, and create star/halo mask image.

mandatory_dependencies = (('frame', 1),)
manmask = None
merge_masks()

Run maskmerge to combine the created mask images into the final mask image.

observing_block = None
process_params = None
read_header()

Read all-caps attributes from header values.

regstarconf = None
saturate = -1.0
classmethod select(frame, latest=True)

Select AutomaticBitMasks covering the area of the bounding box of frame.

frame: a BaseFrame object with a bounding box

latest: return only the most recent mask

sexconf = None
sexparam = []
template = None
update_header()

Update the existing header with object-specific values.

update_sexparams()

Update the sexparams with the fixed parameters.

exception astro.main.AutomaticBitMask.AutomaticBitMaskError(message)

Bases: common.log.Error.Error

class astro.main.AutomaticBitMask.AutomaticBitMaskParameters

Bases: object

The parameters used in AutomaticBitMask processing.

BPIX_FLAG = 64
COLOR = 'green'
MAN_FLAG = 128
SEXFLAG_MAX = 16
SOURCE_CODE_VERSION = 1
SREG_MARGIN = 0.0
THRESH_FACTOR = 0.5

astro.main.BDSM_Gaussian module

classes for handling gaussians

class astro.main.BDSM_Gaussian.BDSM_Gaussian

Bases: common.database.DBMain.DBObject

Class for storing a gaussian. BDSM defines sources by gaussians, a source consists of one or more guassians.

The residuals of

GLID

The GaussianList IDentifier [None]

HALF_HEIGHT = 50
HALF_WIDTH = 50
SID

The Source IDentifier [None]

SLID

The SourceList IDentifier [None]

bmaj_fw

FWHM of the major axis [arcsec]

bmin_fw

FWHM of the minor axis [arcsec]

bpa

Position angle [deg]

check_preconditions()

check the pre conditions for the gaussian

dec

Declination of the gaussian [deg]

deconv_bmaj_fw

Deconvolved FWHM of the major axis [arcsec]

deconv_bmin

Deconvolved FWHM of the minor axis [arcsec]

deconv_bpa

Deconvolved position angle [deg]

err_bmaj

Error in FWHM of the major axis [arcsec]

err_bmin

Error in FWHM of the minor axis [arcsec]

err_bpa

Error in position angle [deg]

err_dec

Error in the declination of the gaussian [deg]

err_decon_bmaj

Error in deconvolved FWHM of the major axis [arcsec]

err_decon_bmin

Error in deconvolved FWHM of the minor axis [arcsec]

err_decon_bpa

Error in deconvolved position angle [deg]

err_peak_flux

Error in the peak flux density [Jy / beam]

err_ra

Error in the right ascension of the gaussian [deg]

err_total_flux

Error in the total flux [Jy]

err_xpos

Error in the y position of the gaussian [pixels]

flag

Gaussian flag [None]

gaul_id

Gaussian ID from BDSM [None]

get_gaussian_list()

return all gaussian as an array (list of lists)

get_gaussian_residual()

generate a residual image for the (current) gaussian

get_list_residual()

retrieve the residual image of the whole sourcelist

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

isl_av

Residual mean of the island [Jy / beam]

isl_rms

Residual rms of the island [Jy / beam]

island_id

Island ID from BDSM [None]

make()

make a gaussian

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

peak_flux

Peak flux density [Jy / beam]

ra

Right ascension of the gaussian [deg]

src_av

Residual mean of the gaussian [Jy / beam]

src_rms

Residual rms of the gaussian [Jy / beam]

srcnum

Source number from BDSM [None]

total_flux

Total flux [Jy]

use_fits_rec(rec, columns, invalid_cols=None)

use a pyfits record (and columns) to set attributes

xpos

X position of the gaussian [pixels]

ypos

Y position of the gaussian [pixels]

class astro.main.BDSM_Gaussian.BDSM_GaussianList

Bases: common.database.DBMain.DBObject

‘ class for storing a Gaussian List, the gaussians self are individually stored in the class BDSM_Gaussian

GLID

The GaussianList IDentifier [None]

SLID

The SourceList IDentifier [None]

check_preconditions()

check if the pre condisitons are met

commit()

commit the BDSM_GaussianList and the BDSM_Gaussians

creation_date

Date this object was created [None]

filename

The filename of the input file [None]

frame

A BaseFrame object [None]

get_new_GLID()

determine new GLID, GaussianList IDentifier

image_filename

The filename of the gaussian generated image [None]

inspect()

inspect the gaussian list plot the frame and overplot all gaussians

instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make(bdsm_result)

make the gaussian list

make_gaussians()

Read the gaussians from the binary FITS table produced by BDSM - produce a BDSM_Gaussian for every row - check for nan values in numerical columns - set SLID/SID from SourceList

number_of_gaussians

Number of gaussians [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

process_params

Processing parameters [None]

residual_filename

The filename of the residuals [None]

set_gaussians()

fill the gaussians list

sourcelist

The SourceList [None]

stat

Statistics of the frame[None]

class astro.main.BDSM_Gaussian.BDSM_GaussianParameters(filename='')

Bases: common.database.DBMain.DBObject

gaussians process parameters

bmpersrc_th

beams per source, 0 => calculate in prog [None]

boxsize_th

boxsize for rms image, 0 => calculate in prog [None]

fdr_alpha

alpha value for FDR; 0 => set to 0.05 inside prog [None]

maxsize_beam

maximum size of fitted gaussian in beam area, 0 => set to 10 inside prog [None]

minpix_isl

minimum num of pixels per island, 0 => set to 4 inside prog [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

rms_map

take constant rms or rms map, default => calculate in prog [None]

stepsize_th

stepsize for rms image, 0 => calculate in prog [None]

takemeanclip

take calculated mean_clip or 0, not true/false => calculate in prog [None]

thresh

hard or fdr pixel threshold, default => calculate from prog [None]

thresh_isl

island threshold in sigma, 0 => set to 3 inside prog [None]

thresh_pix

pixel threshold in sigma, 0 => set to 5 inside prog [None]

astro.main.BDSM_Gaussian.calculate_hash(filename)

calculate the hash value for the given file

astro.main.BDSM_Gaussian.dict_from_bdsm_file(filename)

create a dictionary from a output file of BDSM

astro.main.BDSM_Gaussian.generate_filename(base_name, filename, instrument, ext='fits')

generates filename for the guassian residual file

astro.main.BDSM_Shapelet module

class astro.main.BDSM_Shapelet.BDSM_Shapelet

Bases: common.database.DBMain.DBObject

Class for storing a shapelets. BDSM fits shapelets to sources, a source can consists of one or more shapelets.

The residual image of each shapelet is generated on the fly.

HALF_HEIGHT = 50
HALF_WIDTH = 50
SHLID

The SHapeList IDentifier [None]

SID

The Source IDentifier [None]

SLID

The SourceList IDentifier [None]

av_res

Average in residual image of island after subtracting shapelets [None]

beta

Beta [None]

check_preconditions()

check if the input parameters are ok ; - the input_array must ‘square’

data

List representation of the array content [None]

get_array()

return the shapelet array as list of lists

get_residual()

get (generate) the residual image for the shapelet

island_id

Island ID from BDSM [None]

make()

make an instance of BDSM_Shapelet

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

std_res

Rms in residual image of island after subtracting shapelets [None]

use_fits_rec(rec, columns, invalid_cols=None)

use a pyfits record (and columns) to set attributes

use_input_array()

use input array to make data

x_dim

Dimension in the x direction [pixel]

xcentre

X position [pixel]

y_dim

Dimension in the y direction [pixel]

ycentre

Y position [pixel]

class astro.main.BDSM_Shapelet.BDSM_ShapeletList

Bases: common.database.DBMain.DBObject

class for a list of Shapelets

SHLID

The SHapeletList IDentifier [None]

SLID

The SourceList IDentifier [None]

check_preconditions()
commit()

commit the BDSM_ShapeletList and the BDSM_Shapelets

creation_date

Date when this object was created [None]

filename

The filename of the input file [None]

frame

A BaseFrame object [None]

get_new_SHLID()

determine new SHLID, SHapeletList IDentifier

image_filename

The filename of the generated shapelet image [None]

inspect()

inspect the shapelet list plot the frame and overplot all shapelets

instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make(bdsm_result)

make the gaussian list

make_shapelets()

make the shapelets using the filenames : - fn_shapelets the shapelet parameters, except the coefficients - fn_coeffs the shapelet coefficients

number_of_shapelets

Number of shapelets [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

process_params

Processing parameters [None]

residual_filename

The filename of the residuals [None]

set_shapelets()

fill the shapelets list

sourcelist

The SourceList [None]

class astro.main.BDSM_Shapelet.BDSM_ShapeletParameters(filename='')

Bases: common.database.DBMain.DBObject

shapelet process parameters

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

astro.main.BPZAttributeCalculator module

Bayesian Photometric Redshift Attribute Calculator

Runs the Bayesian Photometric Redshifts code (Benitez, 2000) and stores results as a SourceCollection. See:

http://www.stsci.edu/~dcoe/BPZ/

Benitez 2000, ApJ, 536, p.571: http://adsabs.harvard.edu/abs/2000ApJ…536..571B

Note that BPZ is run twice, the second time with a changed prior, see section 5.1 of this article:

Hildebrandt, H., 2001, CFHTLenS: Improving the quality of photometric redshifts with precision photometry http://arxiv.org/abs/1111.4434

SED templates

CWWSB_capak.list = list of galaxy template SEDs???

CWW =(???) Coleman, Wu, & Weedman (1980) templates (E/S0, Sbc, Scd, and Irr) plus the spectra of two starbursting galaxies from Kinney et al. (1996); Sawicki et al. 1997 used two very blue SEDs from GISSEL)

class astro.main.BPZAttributeCalculator.AttributeCalculator(sourcelist_data=None)

Bases: astro.main.sourcecollection.AttributeCalculator.AttributeCalculator

Photometric Redshifts.

SCID

SourceCollection identifier [None]

acd_attributes = [{'null': None, 'length': 1, 'format': 'float32', 'name': 'Z_B', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'Z_B_MIN', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'Z_B_MAX', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'T_B', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'ODDS', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'Z_ML', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'T_ML', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'CHI_SQUARED', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'M_0', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAG_GAAP_HOM_u', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAG_GAAP_HOM_g', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAG_GAAP_HOM_r', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAG_GAAP_HOM_i', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAGERR_GAAP_u', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAGERR_GAAP_g', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAGERR_GAAP_r', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAGERR_GAAP_i', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAGLIM_1SIG_u', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAGLIM_1SIG_g', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAGLIM_1SIG_r', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'MAGLIM_1SIG_i', 'ucd': ''}]
acd_input_attribute_names = ['MAG_AUTO_r', 'FLUX_GAAP_u', 'FLUX_GAAP_g', 'FLUX_GAAP_r', 'FLUX_GAAP_i', 'FLUXERR_GAAP_u', 'FLUXERR_GAAP_g', 'FLUXERR_GAAP_r', 'FLUXERR_GAAP_i', 'EXTINCTION_u', 'EXTINCTION_g', 'EXTINCTION_r', 'EXTINCTION_i']
acd_name = 'CVS based BPZAttributeCalculatorDefinition'
acd_parameters = [{'value': 'CWWSB4.list', 'format': 'str', 'name': 'SPECTRA', 'description': 'template list'}, {'value': 'hdfn_ground', 'format': 'str', 'name': 'PRIOR', 'description': 'prior name'}, {'value': 0.01, 'format': 'float', 'name': 'DZ', 'description': 'Resolution of the redshift grid. The intervals are logarithmic, (1+z)*dz'}, {'value': 0.0, 'format': 'float', 'name': 'ZMIN', 'description': 'minimum redshift'}, {'value': 3.5, 'format': 'float', 'name': 'ZMAX', 'description': 'maximum redshift'}, {'value': 'yes', 'format': 'str', 'name': 'MAG', 'description': 'The data in the photometric catalogs are interpreted as magnitudes by default. If not, they are treated as fluxes.'}, {'value': 0.95, 'format': 'float', 'name': 'ODDS', 'description': 'Odds threshold: affects confidence limits definition'}, {'value': 10, 'format': 'int', 'name': 'INTERP', 'description': 'Number of interpolated templates between each of the original ones'}, {'value': 'none', 'format': 'str', 'name': 'EXCLUDE', 'description': 'Filters to be excluded from the estimation'}, {'value': 'no', 'format': 'str', 'name': 'NEW_AB', 'description': 'If yes, generate new AB files even if they already exist'}, {'value': 'yes', 'format': 'str', 'name': 'CHECK', 'description': 'Perform some checks, compare observed colors with templates, etc.'}, {'value': 'no', 'format': 'str', 'name': 'VERBOSE', 'description': 'Print estimated redshifts to the standard output'}, {'value': 'no', 'format': 'str', 'name': 'PROBS', 'description': 'Save all the galaxy probability distributions (it will create a very large file)'}, {'value': 'probs_lite.txt', 'format': 'str', 'name': 'PROBS_LITE', 'description': 'Save only the final probability distribution'}, {'value': 'yes', 'format': 'str', 'name': 'GET_Z', 'description': 'Actually obtain photo-z'}, {'value': 'no', 'format': 'str', 'name': 'ONLY_TYPE', 'description': 'Use spectroscopic redshifts instead of photo-z'}, {'value': 'yes', 'format': 'str', 'name': 'MADAU', 'description': 'Apply Madau correction to spectra'}, {'value': 'no', 'format': 'str', 'name': 'COLOR', 'description': 'Use colors instead of fluxes'}, {'value': 'no', 'format': 'str', 'name': 'PLOTS', 'description': "Don't produce plots"}, {'value': 'no', 'format': 'str', 'name': 'INTERACTIVE', 'description': "Don't query the user"}, {'value': 0.0, 'format': 'float', 'name': 'DMAG_u', 'description': 'Magnitude offset for u magnitdues'}, {'value': 0.0, 'format': 'float', 'name': 'DMAG_g', 'description': 'Magnitude offset for g magnitdues'}, {'value': 0.0, 'format': 'float', 'name': 'DMAG_r', 'description': 'Magnitude offset for r magnitdues'}, {'value': 0.0, 'format': 'float', 'name': 'DMAG_i', 'description': 'Magnitude offset for i magnitdues'}]
all_data_stored

Flag to indicate whether all data has been stored in sourcelist_data, 0 means no (or unknown), 1 means yes

attribute_columns

Column names of the attributes in the sourcelist_data

attribute_names

Names of the attributes corresponding to the attribute_columns

calculate_attributes_vector(SPECTRA, PRIOR, DZ, ZMIN, ZMAX, MAG, ODDS, INTERP, EXCLUDE, NEW_AB, CHECK, VERBOSE, PROBS, PROBS_LITE, GET_Z, ONLY_TYPE, MADAU, COLOR, PLOTS, INTERACTIVE, DMAG_u, DMAG_g, DMAG_r, DMAG_i, MAG_AUTO_r, FLUX_GAAP_u, FLUX_GAAP_g, FLUX_GAAP_r, FLUX_GAAP_i, FLUXERR_GAAP_u, FLUXERR_GAAP_g, FLUXERR_GAAP_r, FLUXERR_GAAP_i, EXTINCTION_u, EXTINCTION_g, EXTINCTION_r, EXTINCTION_i)
creation_date

Date this object was created [None]

definition

The Definition of this AttributeCalculator instance.

get_attribute_names(cache=False)
get_attribute_names_nc(cache=False)

Returns the names of the attributes.

get_attributes(cache=False)
get_attributes_full(cache=False)
get_attributes_full_nc(cache=False)

Returns a TableConverter like attribute list with extra keys.

Should only be used by SourceCollection functions. Other classes and awe-prompt users should use get_attributes().

This function should be overloaded by the derived classes. The version in this base class is essentially the variant of the External.

get_attributes_nc(cache=False)

Returns a list of dictionaries with meta data about the attributes.

Keys of the dictionaries:
  • name: The name (and identifier) of the attribute.
  • format: A format string that can be used by numpy.dtype()
  • ucd: Unified Content Descriptor (not always filled properly)
  • null: A null value, usually numpy.nan (not always present)
  • length: The length for multi length cells, only used for strings.

The dictionaries have the same structure as those used in the TableConverter class.

TODO LT L: [NOCAT] Use ‘ucd’ and ‘null’ properly.

get_probs_data()
get_probvectors()
is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make(optimize=True)

New make() function that works with old ACDs for which the original make() function does not accept the optimize keyword.

E.g. ACD 100031 for calculating comoving distances.

make_nc(optimize=True)

This is a virtual make() method for an AttributeCalculator instance.

The AttributeCalculatorDefinition should provide either: - an entire make() function - a calculate_attributes() or calculate_attributes_vector() function.

The default make() of the AttributeCalculator is a wrapper around the calculate_attributes_vector() function.

name

Name of the SourceCollection [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

parent_collection

Parent SourceCollections [None].

process_parameters

Process parameters

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

sourcelist_data

Optional SourceList containing the data described by this SourceCollection

sourcelist_sources

Optional SourceList containing the sources described by this SourceCollection

astro.main.BPZAttributeCalculator.BPZAttributeCalculator

alias of astro.main.BPZAttributeCalculator.AttributeCalculator

astro.main.BPZAttributeCalculator.clean_up_bpz_tmpfiles(tmpbase)

Clean up temporary files.

astro.main.BPZAttributeCalculator.get_bpz_probs_attributes(acd_parameters)

The number and nature of BPZ probability distribution functions outputs depend on input parameters (minimum, maximum redshifts and redshift resolution), so the output attribute list needs to be generated based on the input parameters. I.e. generates parameters (=columns) for zmin=0, zmax=3.5, dz=0.05: PZ_B_0_00 PZ_B_0_05 … PZ_B_3_50

astro.main.BPZAttributeCalculator.main_test_acd(fn=None, acd=None)

Test the AttributeCalculator[Definition].

astro.main.BackgroundFrame module

background images

This module contains class definitions for BackgroundFrameParameters and BackgroundFrame.

BackgroundFrameParameters is a class with parameters that are used, e.g., in trend analysis.

BackgroundFrame is the class that defines background maps.

class astro.main.BackgroundFrame.BackgroundFrame(pathname='')

Bases: astro.main.BaseFrame.BaseFrame

Class for background frames.

NAXIS1

Length of data in axis 1 [pixel]

NAXIS2

Length of data in axis 2 [pixel]

PROCESS_TIME = 20
bias

A BiasFrame object [None]

check_preconditions()
chip

Information about the chip [None]

clean_up()

This methods deletes intermediate products from memory (like trimmed versions of raw frames) that may cause problems when the image is made a second time.

compare()

Compare the results with a previous version. TBD.

copy_attributes()
creation_date

Date this object was created [None]

derive_timestamp()

Assign the default period for which this calibration frame is valid.

filename

The name of the associated file [None]

filter

Information about the filter [None]

get_canonical_name()

Generate the unique filename for this BackgroundFrame.

get_median_raw(raw)

Calculate the median in the central region of the raw frame for which this is the background. To be used to scale the other images to the same value.

get_mode_raw(raw)
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]

make()

Make a background frame

Requires:
raw_science_frames – A list of RawScienceFrame objects bias – A BiasFrame object
Optional:
hot – A HotPixelMap object cold – A ColdPixelMap object
make_image()

Make a background image by taking a set of science images, trim, and debias them, normalize and stack the images. The background image is then the median image of the stack.

Requires:
raw_science_frames – A list of RawScienceFrame objects bias – A BiasFrame object
mandatory_dependencies = (('raw', 1), ('raw_science_frames', 3), ('bias', 1))
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]

classmethod onthefly_processable(attributes, config)

BackgroundFrame is not (yet) OnTheFly processable

prev = None
process_params

Processing Parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

raw

The RawScienceFrame for which this BackgroundFrame is the background [None]

raw_science_frames

The list of RawScienceFrame objects out of which this background frame is created [None]

template

Information about the template [None]

timestamp_end

End of valid period [None]

timestamp_start

Start of valid period [None]

update_header()

Update a header with values from descriptors.

verify()

Verify the results. TBD.

class astro.main.BackgroundFrame.BackgroundFrameParameters

Bases: common.database.DBMain.DBObject

BACKGROUND_METHOD

Method that was used to create this BackgroundFrame [None]

EDGE_X

The edge in X of the image to exclude when calculating the median to which to scale the other images

EDGE_Y

The edge in Y of the image to exclude when calculating the median to which to scale the other images

LEADING_FRAMES

Number of frames before central frame

OVERSCAN_CORRECTION

Overscan correction method index [None]

PRECEDING_TIME

Maximum time difference before central time to search for leading frame [s]

SOURCE_CODE_VERSION

The version of the source code [None]

SUCCEEDING_TIME

Maximum time difference after central time to search for trailing frame [s]

TRAILING_FRAMES

Number of frames after central frame

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

astro.main.BaseCatalog module

defines the base class for all catalogs

class astro.main.BaseCatalog.BaseCatalog(**kw)

Bases: common.database.DataObject.DataObject

This is the abstract base class for Catalog objects.

build_header()

Fill a default header with values from descriptors

empty_header()

Initalize to a default (empty) header

filename

The name of the associated file [None]

globalname

The name used to store and retrieve file to and from Storage [None]

initialize_astrom_attribute()
initialize_chip_attribute()
initialize_filter_attribute()
initialize_instrument_attribute()
initialize_observingblock_attribute()
initialize_template_attribute()
load_header(loader=<module 'astro.util.darma' from '/builds/omegacen/astro/util/darma/__init__.py'>)

Initialize self.header

loader: package used to load the image (eclipse or darma)
NOTE: DARMA and Eclipse headers are incompatible and require
some kind of conversion before saving with Eclipse or DARMA images, respectively.
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

read_header()

Read a header into descriptors.

The descriptor is assumed to include a number of all caps attributes that map directly to FITS header keywords. In addition, if any of the following attributes are present, this routine will initialize those attributes.

Initialized attributes: instrument, chip, filter, astrom, observing_block, template

save(filename='', overwrite=1)
update_header()

Update a header with values from descriptors

update_history()

Update a header with history

History is maintained in the instance attribute history. History is written by appending string to the history list.

astro.main.BaseCatalog.derive_psf_radius(catalog_file, pixelscale, region=())

Identical to derive_seeing

astro.main.BaseCatalog.derive_seeing(catalog_file, pixelscale, region=())

Calculate the seeing in arcsec.

This function computes the seeing in arcsec. The following parameters have to be present in the OBJECTS table of the catalog:

ALPHA_SKY, DELTA_SKY, MAG_ISO, FLUX_RADIUS, FWHM_IMAGE, Flag

The algorithm includes the following selections on sources:

  1. Flag == 0
  2. FLUX_RADIUS > 0.25 arcsec
  3. (If region specified) ALPHA_SKY, DELTA_SKY within region
astro.main.BaseCatalog.make_mag_fwhm_plot(fwhms, mags, stellar_fwhm, catalog_file, fwhms_sel=None, mags_sel=None)
astro.main.BaseCatalog.make_skycat(points)

astro.main.BaseFlatFrame module

defines the base class for all flat-fields

class astro.main.BaseFlatFrame.BaseFlatFrame(**kw)

Bases: astro.main.BaseFrame.BaseFrame

Abstract base class for Flat Frames

NAXIS1

Length of data in axis 1 [pixel]

NAXIS2

Length of data in axis 2 [pixel]

chip

Information about the chip [None]

creation_date

Date this object was created [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

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

timestamp_end

End of valid period [None]

timestamp_start

Start of valid period [None]

astro.main.BaseFrame module

defines the base class for all frames (images)

BaseFrame makes no assumption about contents of descriptor and links. However, BaseFrame provides a number of services that check if links are present. See especially BaseFrame.sex()

BaseFrames now incorporate CCD chip geometries directly. For a complete description of how these are dealt with, see the docstrings for the Chip class.

class astro.main.BaseFrame.BaseFrame(**kw)

Bases: common.database.DataObject.DataObject, astro.main.ProcessTarget.ProcessTarget

A base class for persistent FITS file objects

BaseFrame inherits from the persistent DataObject class and the ProcessTarget mixin. DataObject provides data retrieval and storage facilities for the FITS files. All BaseFrame objects are ProcessTargets (have a make method).

BaseFrame itself is intended to be an abstract baseclass.

A BaseFrame instance defines a number of attributes,

image – An eclipse.image object (default None), read if needed,
or by load_image()
header – An darma.header object (default None), read if needed,
or by load_header(), or created by build_header()
history – A list of strings containing the history of the object.
currently not read from the header, but used by build_header()
AxisNumber = 2
ImgNumber = -1
NAXIS1

Length of data in axis 1 [pixel]

NAXIS2

Length of data in axis 2 [pixel]

build_header()

Fill a default header with values from descriptors

commit_boundingbox()

Conditionally commit boundingbox

commit_subwinstat()

Conditionally commit subwindow statistics

creation_date

Date this object was created [None]

display(viewer='skycat', filename=None)

Independent display method for all frames.

empty_header()

Initialize to a default (empty) header

estimate_statistics(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
filename

The name of the associated file [None]

get_inspect_figures(subtype='', newest=False)

Query for InspectFigures associated with this object and return the resulting list.

subtype: query for only a specific subtype
newest: choose only the most recent (unique) figures
get_previous_version(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)
get_thumbnail()
globalname

The name used to store and retrieve file to and from Storage [None]

has_boundingbox = False
has_inspect_figures = True
imstat

Image statistics for the frame [None]

initialize_astrom_attribute()
initialize_chip_attribute()
initialize_filter_attribute()
initialize_imstat_attribute()
initialize_instrument_attribute()
initialize_lamp_attribute()
initialize_observingblock_attribute()
initialize_template_attribute()
inspect(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

w - displays a wireframe 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.

inspect_mosaic()

Create thumbnail for all CCDs

is_compressed()

Find out if a FITS file is compressed

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

load_header(loader=<module 'astro.util.darma' from '/builds/omegacen/astro/util/darma/__init__.py'>)

Initialize self.header using either a DARMA or an Eclipse header.header instance.

N.B., DARMA and Eclipse headers are incompatible and require some kind of conversion before saving with Eclipse or DARMA images, respectively.

loader : module
package used to load the image (eclipse or darma)
load_image(readonly=False, loader=<module 'eclipse' from '/opt/awehome/Linux-centos-7.4-x86_64/master/astro/lib/python3.5/site-packages/eclipse/__init__.py'>)

Initialize self.image using either an Eclipse or a DARMA image.image instance.

N.B., DARMA and Eclipse images are incompatible and thus cannot be operated between.

readonly : bool
prevent modifying the image
loader : module
package used to load the image (eclipse or darma)
make_background()

Make a background image,

Returns a new BaseFrame object. The name of the new file is “name.back.fits”

make_background_fringe(filename)

Make a background image for the purpose of fringe scaling and FringeFrame creation.

make_background_satellite(BACK_SIZE=40)

Make a background image for the purpose of satellite detection. Goal is to remove very large objects by treating this as background.

make_boundingbox()

Compute (sky) BoundingBox for this frame if not already given

make_inspect_figures(extension='')

Create inspection figures for this frame.

extension: extension of the filetype to save inspection
figures to
make_mosaic_image(frames=[], overwrite=True)

Create a mosaic FITS image for the multiple CCDs of the detector together

frames : Use the specified frames rather than query the
database for the other CCDs
make_mosaic_thumbnail(frames=[], remove_thumbs=True, overwrite=False)

Create a thumbnail for the multiple CCDs of the detector together frames : Use the specified frames rather than query the

database for the other CCDs
remove_thumbs: Remove the individual CCD thumbnails after
making the mosaic thumbnail

overwrite : Check if mosaic thumbnail already exists

make_segmentation(DETECT_THRESH=1.1, satellite_image=None, weight_image=None)

Return background pixels from segmenation image,

make_subwinstat()

Compute statistics on subwindows

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

onthefly_after_make(config)

This method is run after making the object (OnTheFly) and stores the checkimage, this is without OnTheFly processing done in the Recipe

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

read_header()

Read a header into descriptors.

The descriptor is assumed to include a number of all caps attributes that map directly to FITS header keywords. In addition, if any of the following attributes are present, this routine will initialize those attributes.

Initialized attributes: instrument, chip, filter, lamp, imstat, astrom, observing_block, template

retrieve()

Retrieve this frame from the data server and uncompress it if it has been compressed with FITSIO.

retrieve_cutout(xmin=None, ymin=None, xmax=None, ymax=None, ra=None, dec=None, size=None)

Retrieve a cutout of this frame from the dataserver

Usage:
frame.retrieve_cutout(xmin=500, ymin=500, xmax=600, ymax=600) frame.retrieve_cutout(ra=160.0, dec=-10.0 size=200)
retrieve_weight_cutout(xmin=None, ymin=None, xmax=None, ymax=None, ra=None, dec=None, size=None)

Provide the ra, dec, size interface for weights by using the astrom information of the associated frame.

save(filename='', overwrite=1)
statistics(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)
unload_header()

Formally remove the data assigned to self.header to avoid a memory leak.

unload_image()

Formally remove the data assignedn to self.image to avoid a memory leak.

update_header()

Update a header with values from descriptors

update_history()

Update a header with history

History is maintained in the instance attribute history. History is written by appending string to the history list.

astro.main.BiasFrame module

bias (req541)

This module contains class definitions for BiasFrameParameters and BiasFrame.

BiasFrame is the class that defines a master bias object.

BiasFrameParameters is a class with parameters that are used, e.g., in trend analysis.

class astro.main.BiasFrame.BiasFrame(pathname='')

Bases: astro.main.BaseFrame.BaseFrame

Class for the master bias.

This class defines the master bias frame and provides the ability to reduce a list of raw bias input frames. The reduction consists of averaging the trimmed and overscan-corrected raw bias frames and calculating the statistics of the derived frame. Instances of this class have links to:

raw_bias_frames - List of raw bias objects. process_params - Bias frame parameters object. prev - Previous master bias object. imstat - The Imstat object containing image statistics for the

reduced bias frame object.
instrument - The Instrument object describing which instrument the raw
bias frame was observed with.
chip - The Chip object for the CCD with which the raw bias frame
was observed.
observing_block - The ObservingBlock object to which this bias
observation belongs.
BIAS_ABS_MEAN_TOO_LARGE
BIAS_STDEV_DIFFERENCE_TOO_LARGE
BIAS_STDEV_TOO_LARGE
BIAS_SUBWIN_FLATNESS_TOO_LARGE
BIAS_SUBWIN_STDEV_TOO_LARGE
DataSize = '-32'
EXPTIME = 0
ImgType = <astro.util.xsdsupport.ImgType object>
NAXIS1

Length of data in axis 1 [pixel]

NAXIS2

Length of data in axis 2 [pixel]

PROCESS_TIME = 10
build_header()

Extends BaseFrame build_header method

check_identical_chips()
check_preconditions()
chip

Information about the chip [None]

clean_up()

This methods deletes intermediate products (like trimmed versions of raw frames that may cause problems when the BiasFrame is made a second time) from memory.

compare()

Compare the results with a previous version.

Requires:
prev – A BiasFrame object for the previous Bias measurement
The folowing flags may be set in the status attribute:
MEAN_DIFFER – (mean of bias-mean of previous) > MAXIMUM_BIAS_DIFFERENCE
copy_attributes()
creation_date

Date this object was created [None]

derive_timestamp()

Assign the period for which this calibration frame is valid.

filename

The name of the associated file [None]

get_canonical_name()

Generate the unique filename for this BiasFrame.

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]

make()

Make a master bias frame.

Requires:
raw_bias_frames – A list of raw bias exposures.

Trims and applies overscan correction to the raw input bias frames. Averages these frames to derive the master bias frame. Calculates the image statistics on the resulting frame. Creates the FITS header and saves it together with the FITS image.

make_image()

Make a master bias image.

Requires:
raw_bias_frames – A list of raw bias frames read_noise – A ReadNoise object

Do a trim and overscan correction on the input frames, compute a first estimate of the mean using a median of all trimmed and overscan-corrected raw biases. For each input bias reject pixels which deviate more than SIGMA_CLIP * read_noise from the median, and use the remaining pixels to compute a mean.

mandatory_dependencies = (('raw_bias_frames', 3), ('read_noise', 1))
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]

prev = None
process_params

Processing parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

raw_bias_frames

The RawBiasFrames used to construct this frame [None]

read_header()

Extends the read_header method of BaseFrame

read_noise

Information about the read noise estimate [None]

set_overscan_parameter()

Sets the OVERSCAN_CORRECTION attribute of the BiasFrameParameters object associated with the BiasFrame based on OVSC_COR header keyword

Necessary for checking of inconsistencies between overscan correction methods of (input) BiasFrame and (target) frame (e.g. a RawScienceFrame) that uses the BiasFrame.

template

Information about the template [None]

timestamp_end

End of valid period [None]

timestamp_start

Start of valid period [None]

verify()

Verify the results.

The following flags may be set in the status attribute:
BIAS_ABS_MEAN_TOO_LARGE : if the mean is significantly different from zero BIAS_STDEV_TOO_LARGE : if the stdev is too large
exception astro.main.BiasFrame.BiasFrameError(message)

Bases: common.log.Error.Error

class astro.main.BiasFrame.BiasFrameParameters

Bases: common.database.DBMain.DBObject

The parameters used in BiasFrame processing.

MAXIMUM_ABS_MEAN

QC: maximum absolute mean value of the bias levels [None]

MAXIMUM_STDEV

QC: maximum sample standard deviation value of the bias levels [None]

MAXIMUM_STDEV_DIFFERENCE

QC: maximum sample standard deviation difference of the current bias levels compared to previous bias levels [None]

MAXIMUM_SUBWIN_FLATNESS

QC: maximum difference between median values of any two subwindows [None]

MAXIMUM_SUBWIN_STDEV

QC: maximum sample standard deviation value of any subwindow [None]

OVERSCAN_CORRECTION

Overscan correction method index [None]

SIGMA_CLIP

Sigma clipping threshold factor [None]

SOURCE_CODE_VERSION

The version of the source code [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

astro.main.BitMask module

defines a class for bitmasks

class astro.main.BitMask.BitMask(**kw)

Bases: object

A bitmask records pixels with a particular property.

Bitmasks record flagged pixels. For example, AutomaticBitMasks are images whose pixel values are 0 (good) or 1, 2, 4, etc. (2**0, 2**1, 2**2, etc.) depending on the type of flagged defect (e.g., readout spike, diffraction spike, reflection halo. Up to 32 flags can be stored in one (compressed) bitmask (FITS BITPIX=32) attaining high storage efficiency.

The BitMask class assumes that bitmasks are saved as cfitsio compressed FITS data.

The BitMask class uses the DARMA object bitmask internally.

BIT0 = ''
BIT1 = ''
BIT10 = ''
BIT11 = ''
BIT12 = ''
BIT13 = ''
BIT14 = ''
BIT15 = ''
BIT16 = ''
BIT17 = ''
BIT18 = ''
BIT19 = ''
BIT2 = ''
BIT20 = ''
BIT21 = ''
BIT22 = ''
BIT23 = ''
BIT24 = ''
BIT25 = ''
BIT26 = ''
BIT27 = ''
BIT28 = ''
BIT29 = ''
BIT3 = ''
BIT30 = ''
BIT31 = ''
BIT4 = ''
BIT5 = ''
BIT6 = ''
BIT7 = ''
BIT8 = ''
BIT9 = ''
NAXIS1 = -1
NAXIS2 = -1
as_pixelmap(mask=None)

Return a PixelMap object based on a mask.

mask: bitmask value (default is None: all bits)
check_mandatory_dependencies()

check if all the mandatory dependencies are set

check_preconditions_for_loading()
count = 0
creation_date = datetime.datetime(1990, 1, 1, 0, 0)
derive_timestamp()

Set the creation_date attribute

display(viewer='skycat', filename=None)

Independent display method for all bitmasks.

exists()

Test is the file existsts localy. See the is_on_dataserver and locate functions below to check whether files exist on the storage.

get_canonical_name(processlevel='')

Returns the canonical name of a DataObject. This function is used by the set_filename function and should be overloaded in derived classes.

has_inspect_figures = True
inspect(extension='png', interactive=True)

A simple inspect for pixel maps. Displays the inpsect figure created by make_inspect_figures if interactive is True, only creates it if not.

is_compressed()

Find out if a FITS file is compressed

is_valid = 1
load_header()

Load header from BitMask FITS file

load_mask()

Load the bitmask from a compressed file.

make_inspect_figures(extension='png')

Create inspection figure for this bitmask.

extension: extension of the filetype to save inspection
figures to
name_insert_suffix(suffix)
name_replace_suffix(suffix)
name_with_new_suffix(suffix)
object_id = <common.database.oraclesupport.oracleoidtype object>
pathname
quality_flags = 0
read_data()
read_header()

Read a header into descriptors.

The descriptor is assumed to include a number of all caps attributes that map directly to FITS header keywords.

retrieve()

Retrieve this frame from the data server and uncompress it if it has been compressed with FITSIO.

save_mask()

This method saves the bitmask (meta)data to a FITS file.

NOTE: This method assumes the appropriate persistent bit
descriptions (BIT1, BIT2, etc.) have been fully filled out. This is vital as it determines with what datatype the bitmask data is saved.
set_filename(filename='', filepath='', 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_process_parameters_from_dict(pars={})

pars is a dictionary of the type e.g.: {‘BiasFrame.process_params.SIGMA_CLIP’:8}

set_user_config(pars={})
store()

Custom store for bitmasks (using cfitsio/PLIO compression).

uncompress_bitmask_data()
update_count()

Get the count of bad pixels.

exception astro.main.BitMask.BitMaskError(message)

Bases: common.log.Error.Error

astro.main.BitMask.get_bit(flag)

astro.main.BoundingBox module

The bounding box of a frame in sky coordinates

class astro.main.BoundingBox.BoundingBox

Bases: common.database.DBMain.DBObject

centerDEC

Declination of the center bounding box [deg]

centerRA

Right Ascension of the center bounding box [deg]

check_preconditions()

is all input ok ?

creation_date

The date the object was created [None]

derive_timestamp()

Set the creation_date attribute

frame

The object this bounding box belongs to [None]

get_corners()

Return a list of 4 tuples specifying the bounding box corners:

[(llRA, llDEC), (lrRA, lrDEC), (urRA, urDEC), (ulRA, ulDEC)]

Can be used as Area input to various SourceList and AssociateList methods.

get_decs()

Return all 4 Dec values in the standard order:

(llDEC, lrDEC, urDEC, ulDEC)
get_max_dec()

Return the maximum Dec value

get_max_ra()

Return the maximum RA value

get_min_dec()

Return the minimum Dec value

get_min_ra()

Return the minimum RA value

get_ras()

Return all 4 RA values in the standard order:

(llRA, lrRA, urRA, ulRA)
get_values()

Return the tuple of 8 values specifying the bounding box in the standard order: (llRA, llDEC, lrRA, lrDEC, urRA, urDEC, ulRA, ulDEC)

has_overlap(other)

Use the largest ‘boxes’ subtended by both self and other to find any possible overlap.

Approach: if any condition where there is NO overlap is true, then return False

heightDEC

Declination height of the bounding box [deg]

is_valid

User flag to disqualify bad data [None]

llDEC

Declination of lower left bounding box [deg]

llRA

Right Ascension of lower left bounding box [deg]

lrDEC

Declination of lower right bounding box [deg]

lrRA

Right Ascension of lower right bounding box [deg]

make()

derive the bounding box using the projection

make_boundingbox()

Convert the values of corners of the pixel coordinate system into WCS values.

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

classmethod query_frameclass(query, frameclass)

Limit the given query to the given frame class

classmethod sql_missing_boundingbox(update=False)

generate sql to insert missing BoundingBox’s

ulDEC

Declination of upperer left bounding box [deg]

ulRA

Right Ascension of upper left bounding box [deg]

urDEC

Declination of upper right bounding box [deg]

urRA

Right Ascension of upper right bounding box [deg]

widthRA

Right Ascension width of the bounding box [deg]

astro.main.Catalog module

defines a class for (SExtractor) catalogs

class astro.main.Catalog.Catalog(pathname='')

Bases: astro.main.BaseCatalog.BaseCatalog

This class represents a catalog made by sextractor.

check_preconditions()
copy_attributes_from_frame()

Copy catalog attributes from the frame object

Requires:
frame – the BaseFrame object
Updates:
weight – from frame.weight zeropoint – from frame.get_zeropoint()

The OBJECT and filter attributes are not propagated. Use the get_object() and get_filter() functions to get the OBJECT and the filter.

filename

The name of the associated file [None]

frame

Pixel data from which the catalog will be derived [None]

get_filter()

Return the filter of the corresponding frame. Such a function is necessary because the filter is not propagated in copy_attributes_from_frame(). None is used as a default. This function is called by the External SourceCollection for SourceCollections made from Catalog objects.

get_mag_id()
get_object()

Return the OBJECT of the corresponding frame. Such a function is necessary because the OBJECT is not propagated in copy_attributes_from_frame(). ‘None’ is used as a default. This function is called by the External SourceCollection for SourceCollections made from Catalog objects.

get_records(table, keyword_list)

Return a list of records from the given table.

Records will be dictionaries of key value pairs, with the keys from the keyword_list.

get_sex_config()

calculate and return the fixed sextractor parameters

get_source_progenitors(identifier)
This function should yield
(self.frame, (xpos, ypos))

where (xpos, ypos) are the x and y positions of the source identified by identifier.

Obtaining this information is difficult, because * The data is in a file that would have to be retrieved first,

while this function might be called exactly to prevent retrieving large amounts of data.
  • There is no standard way to get the X and Y position from the catalog file, unlike with standard SExtractor SourceLists.
  • There is not necessary a good way to identify a specific row in the catalog file.

This function will most likely be called recursively from an External SourceCollection created from this Catalog. In that case it is easier to simply get the information from the database instead.

Therefore, this function is currently not implemented.

getlist(table, keyword_list)
globalname

The name used to store and retrieve file to and from Storage [None]

make()

Run sextractor to make the catalog.

Requires:
frame – the input frame over which to run the catalog sexconf – the sextractor configuration (optional) sexparam – additional sextractor parameters (optional)

This procedure first runs sextractor and then runs ldacconv to transform the sextractor catalog into an LDAC catalog. If the sexconf is not given then a default sextractor configuration, obtained from set_sextractor_config (q.v.) is used.

make_asciitable(tabname='OBJECTS', colnames=[])
make_skycat()

This method creates a “dump” of the Catalog object that can be used to overplot a frame in ESO skycat.

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

run_sextractor()
seeing

Seeing estimate for SExtractor configuration [pixel]

set_number_of_sources(number_of_sources)
set_sextractor_config()

Configure sextractor

Requires:
frame – the detection frame threshold – The sextractor detection threshold seeing – used to determine SEEING_FWHM and FILTER (optional) weight – used to determine WEIGHT_TYPE and WEIGHT_IMAGE (optional) zeropoint – used to detemine MAG_ZEROPOINT (optional)
Updates:
sexconf – The SextractorConfig object

Based on the catalog attributes a sextractor configuration object is created.

set_weightscale(weightscale)
sexconf

The SExtractor configuration [None]

sexparam

Additional extraction parameters [None]

sourcecount

Number of detected objects [None]

threshold

SExtractor detection threshold [None]

weight

The weights associated with the frame [None]

weightscale

The weight scale [None]

zeropoint

Photometric zeropoint [mag]

astro.main.CheckImage module

Classes for Sextractor check (segmentation) images.

This module contains the classes that represent the “check” images (in particular the segmentation image) produced by Sextractor. Since gzip compressed segmentation images are small (~320K for a 32M FITS image) these images are always created and stored with SourceLists. This is not true for all check images however (e.g. background check image).

class astro.main.CheckImage.CheckImage(**kw)

Bases: astro.main.BaseFrame.BaseFrame

NAXIS1

Length of data in axis 1 [pixel]

NAXIS2

Length of data in axis 2 [pixel]

check_preconditions()
creation_date

Date this object was created [None]

filename

The name of the associated file [None]

get_canonical_name()
globalname

The name used to store and retrieve file to and from Storage [None]

imstat

Image statistics for the frame [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

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

rename_checkimage()
set_filename()
sourcelist

A SourceList object [None]

exception astro.main.CheckImage.CheckImageError

Bases: Exception

class astro.main.CheckImage.SegmentationImage(**kw)

Bases: astro.main.CheckImage.CheckImage

This image should be stored in compressed form

NAXIS1

Length of data in axis 1 [pixel]

NAXIS2

Length of data in axis 2 [pixel]

compress()
creation_date

Date this object was created [None]

filename

The name of the associated file [None]

get_canonical_name()

Generate the unique filename for this SegmentationImage.

globalname

The name used to store and retrieve file to and from Storage [None]

imstat

Image statistics for the frame [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make()
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

pad_to_frame(frame, xmin, xmax, ymin, ymax)

In Sextractor double image mode a cutout is made of the overlapping region of the detection and measurement images. The pixel positions in the SourceList are shifted back to the positions in the original frame. Likewise, the SegmentationImage be adjusted by padding the removed pixels. xmin, xmax, ymin, ymax is the cutout made in the original image.

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

sourcelist

A SourceList object [None]

store()
astro.main.CheckImage.create_checkimage(sourcelist)

astro.main.Chip module

class used to identify a single chip

class astro.main.Chip.Chip

Bases: common.database.DBMain.DBObject

An object that describes a single chip

NOTE: The presistent attributes NAXIS1 and NAXIS2 have been moved to

BaseFrame; the persistent attributes PRSCX, OVSCX, PRSCY, OVSCY have been moved to RawFrame; the persistent attribute orientation has been moved to RawFrame and has become a transient attribute read from the image header. The purpose for these moves was to accommodate necessary variation in geometries of the same (or effectively the same) physical CCD. This allows proper characterization of instruments whose CCDs change logical geometries over time due to software or hardware changes.

The persistent properties PRSCXPRE, OVSCXPRE, PRSCYPRE, OVSCYPRE, PRSCXPST, OVSCXPST, PRSCYPST, OVSCYPST, have been added directly to RawFrame to support a more flexible representation of the scan regions. Their description has been integrated into this documentation.

The chip description deals mainly with the definition of prescan and overscan regions. The prescan (PRSCX, PRSCY) and overscan (OVSCX, OVSCY) attributes divide a chip in 9 regions. The definition of ‘pre’ and ‘over’ is with respect to the readout direction.

| +
| | OVSCY
—+——–//—–+— +
—+——-//——+— +
| | PRSCY
| +

+–+ +–+

PRSCX OVSCX

To allow exclusion of bad columns/rows within a scan region, a pre- and post-skip area is defined such that the pre-skip area is adjacent to the edge of the chip and the post-skip area is adjacent to the data region. The relation of these areas to the scan region is described in the following schematic of one corner of a CCD chip:

. . . . . . . . . . . . | | | | | PRE | | POST | | BAD | SCAN REGION USED FOR CORRECTION | BAD | DATA REGION | | | | |______|_________________________________|______|____________…

For instance, for the prescan region in X, the appropriate attributes would describe the regions below:

Note that the sense of direction as defined by the read-out port, may not be the same as the one defined by the pixel coordinate system. Consider these four examples

    1. ====== FIERA
(NAXIS1, NAXIS2) (NAXIS1, NAXIS2)

+—–o overy +—–o prey | | | | | | | | | | | | | | | | o—–+ prey o—–+ overy

(1,1) (1,1)
======= FIERA prex overx

prex overx

    1. ====== FIERA
(NAXIS1, NAXIS2) (NAXIS1, NAXIS2)

+—–o overy +—–o prey | | | | | | | | | | | | | | | | o—–+ prey o—–+ overy

(1,1) (1,1)
======= FIERA overx prex

overx prex

Note how in these examples the coordinates of prescan and overscan regions have changed.

Several regions are of particular interest. In the default case (1), these regions have the following coordinate definition (llc_x, llc_y, urc_x, urc_y) or similarly (x0, y0, x1, y1)

TX = NAXIS1-OVSCX TY = NAXIS2-OVSCY

trim: PRSCX+1, PRSCY+1, TX, TY

prescan_x: PRSCXPRE+1, PRSCY+1, PRSCX-PRSCXPST, TY prescan_y: PRSCX+1, PRSCYPRE+1, TX, PRSCY-PRSCYPST

overscan_x: TX+OVSCXPST+1, PRSCY+1, NAXIS1-OVSCXPRE, TY overscan_y: PRSCX+1, TY+OVSCYPST+1, TX, NAXIS2-OVSCYPRE

For case 2 (OVSCY<–>PRSCY) we have:

TX = NAXIS1-OVSCX TY = NAXIS2-PRSCY

trim: PRSCX+1, OVSCY+1, TX, TY

prescan_x: PRSCXPRE+1, OVSCY+1, PRSCX-PRSCXPST, TY prescan_y: PRSCX+1, TY+OVSCYPST+1, TX, NAXIS2-OVSCYPRE

overscan_x: TX+OVSCXPST+1, OVSCY+1, NAXIS1-OVSCXPRE, TY overscan_y: PRSCX+1, OVSCYPRE+1, TX, OVSCY-OVSCYPST

For case 3 (PRSCX<–>OVSCX) we have:

TX = NAXIS1-PRSCX TY = NAXIS2-OVSCY

trim: OVSCX+1, PRSCY+1, TX, TY

prescan_x: TX+PRSCXPST+1, PRSCY+1, NAXIS1-PRSCXPRE, TY prescan_y: OVSCX+1, PRSCYPRE+1, TX, PRSCY-PRSCYPST

overscan_x: OVSCXPRE+1, PRSCY+1, OVSCX-OVSCXPST, TY overscan_y: OVSCX+1, TY+OVSCYPST+1, TX, NAXIS2-OVSCYPRE

For case 4 (PRSCX<–>OVSCX, PRSCY<–>OVSCY) we have:

TX = NAXIS1-PRSCX TY = NAXIS2-PRSCY

trim: OVSCX+1, OVSCY+1, TX, TY

prescan_x: TX+PRSCXPST+1, OVSCY+1, NAXIS1-PRSCXPRE, TY prescan_y: OVSCX+1, TY+OVSCYPST+1, TX, NAXIS2-OVSCYPRE

overscan_x: OVSCXPRE+1, OVSCY+1, OVSCX-OVSCXPST, TY overscan_y: OVSCX+1, OVSCYPRE+1, TX, OVSCY-OVSCYPST

The attribute orientation (header keyword CHIPORNT) is used to distinguish between these cases

Note that (in all cases) the sizes of the regions are given by

xsize ysize

trim NAXIS1-OVSCX-PRSCX NAXIS2-OVSCY-PRSCY prescan_x PRSCX-PRSCXPRE-PRSCXPST NAXIS2-OVSCY-PRSCY prescan_y NAXIS1-OVSCX-PRSCX PRSCY-PRSCYPRE-PRSCYPST overscan_x OVSCX-OVSCXPRE-OVSCXPST NAXIS2-OVSCY-PRSCY overscan_y NAXIS1-OVSCX-PRSCX OVSCY-OVSCYPRE-OVSCYPST

name

Name of the CCD chip [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

pixelsize = 15
update_header(header)

astro.main.ColdPixelMap module

cold pixel maps (req535)

Bad pixels should be ignored in co-addition and source extraction. They are therefore recorded in pixelmaps and used when constructing weight maps. The map of cold pixels (req535) is defined here.

class astro.main.ColdPixelMap.ColdPixelMap(pathname='')

Bases: astro.main.PixelMap.PixelMap

The map of cold pixels.

The cold pixels are the (local) outliers in flat field, found by dividing a flat field with a smoothed version of itself. A standard ColdPixelMap is created as follows:

>>> hp = ColdPixelMap()
>>> hp.flat = DomeFlatFrame(pathname='mydome.fits')
>>> hp.make()
COLDPIXELCOUNT_DIFFERENCE_TOO_LARGE
COLDPIXELCOUNT_TOO_LARGE
PROCESS_TIME = 120
check_preconditions()
chip

Information about the chip [None]

compare()

Compare the results with a previous version.

Requires:
prev – A ColdPixelMap object with the previous measurement
The folowing flags may be set in the process_flag attribute:
COLDPIXELCOUNT_DIFFERENCE_TOO_LARGE
copy_attributes()
count

The number of bad pixels [None]

creation_date

Date this object was created [None]

derive_timestamp()

The valid date is the same as for the flat field

determine_coldpixel_count(normalized_frame)
filename

The name of the associated file [None]

filter

Information about the filter [None]

flat

The FlatFrame used to derive the PixelMap [None]

get_canonical_name()

Generate the unique filename for this ColdPixelMap.

get_default_config()

return the sextractor parameters that differ from the defaults

get_fixed_config()

return the fixed sextractor parameters

get_normalized_flatframe()
globalname

The name used to store and retrieve file to and from Storage [None]

instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make()

Create a cold pixel map and count the number of cold pixels.

Requires:
flat – BaseFlatFrame objects.

The cold pixel map is derived from a flat field. This flat field is normalized and smoothed by dividing by the estimated backgroud. Pixels outside the range process_params.THRESHOLD_LOW, process_params.THRESHOLD_HIGH are ‘cold’ pixels.

make_background_frame()

This method runs SExtractor on the input flat field to create a background frame.

mandatory_dependencies = (('flat', 1),)
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]

prev = None
process_params

Processing parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

sexconf

The SExtractor configuration [None]

template

Information about the template [None]

timestamp_end

End of valid period [None]

timestamp_start

Start of valid period [None]

verify()

Verify the cold pixel count.

The folowing flags may be set in the process_flag attribute:

COLDPIXELCOUNT_TOO_LARGE
class astro.main.ColdPixelMap.ColdPixelMapParameters

Bases: common.database.DBMain.DBObject

Parameters for processing ColdPixelMap objects.

MAXIMUM_COLDPIXELCOUNT

QC: Maximum number of cold pixels allowed [None]

MAXIMUM_COLDPIXELCOUNT_DIFFERENCE

QC: Maximum number of new cold pixels allowed [None]

SOURCE_CODE_VERSION

The version of the source code [None]

THRESHOLD_HIGH

The higher level of the flagging threshold [None]

THRESHOLD_LOW

The lower level of the flagging threshold [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

astro.main.CombinedList module

class astro.main.CombinedList.CombinedList(inp_a)

Bases: object

This class represents the newly created SourceList from the AssociateList The input is AssociateList, output is a SourceList with SID=AID.

OBJECT = ''
aid_list = []
assoc_list = []
associatelist = []
attr_words = {}
average(columns_av=[], columns_err=[])
columns = []
columns_out = []
combined_method = 2
commit()
creation_date = datetime.datetime(1990, 1, 1, 0, 0)
data = []
data_result = []
debug = False
get_SourceList(sl_name)
insert_data_into_fits(out_fits, extname)
is_valid = 1
llDEC = 0.0
llRA = 0.0
lrDEC = 0.0
lrRA = 0.0
made_type = 0
mag_flags = {}
make(tablename='SOURCELIST*SOURCES**04')

make creates a SourceList from AssociateList with a limited number of sources (200,000)

make_SourceList(attr_words={}, user_mags={}, user_attributes=[], combined_method=1, debug=False)
make_SourceListBIG(attr_words={}, user_mags={}, user_attributes=[], combined_method=2, mag_flags={}, user_defined=[], debug=False, tablename='SOURCELIST*SOURCES**04', associate_size=200000, sourcelist_name=None)

make_SourceListBIG creates a SourceList from AssociateList with an unlimited number of sources Input:

attr_words: a dictionary for aggregate functions used to make a new attribute from old one
Example: attr_words={‘MAG_ISO’:’MAX’} - select maximum of MAG_ISO as a new magnitude The function must be an Oracle aggregate function (MAX,MIN,AVG,STDDEV and so on)
user_mags: a dictionary of attributes which will be treated as magnitudes. The key is a
name of attribute and the value is the name of the filter. Example: user_mags={‘MAG_ISO’:’#849’}
user_attributes: a list of attributes the user would like to see in a new SourceList. RA, DEC, HTM
will always present in a SourceList. Example: user_attributes=[‘MAG_FLAG’,’B’]
combined_method: by definition combined_method=2
combined_method=1 - all sources, assotiated in AssociateList and non-associated (non- presented in AssociateList) are combined. SID=AID for associated sources, SID>MAX(AID) for non-associated combined_method=2 - sources in AssociateList are taken only combined_method=3 - non-associated sources (not in an input AssociateList) are taken only
mag_flags: a dictionary for attributes with flags for magnitudes. The user must fill this dictionary in to
have a flag in MAGFLAG_n attributes Example: mag_flags={‘MAG_ISO’:’MAG_FLAG’}
user_defined: a list of dictionaries with the user-defined newly created attributes. Each element of list is

a dictionary with the name of attribute and list of SLIDs which must be used to combine a new attribute. The aggregate function can be specified in attr_words Example: user_defined=[{‘RA’:1}] - copy RA as it is from SourceList SLID=1, the new attribute

will appear in RA_1
user_defined=[{‘RA’:1},{‘RA’:[1,2]},{‘RA’:[1,2,3]}] - copy RA from SLID=1 (RA_1), combine
RA from SLIDs 1 and 2 (RA_2, RAERR_2,RAN_2), combine RA from SLIDs 1,2 and 3 (RA_3, RAERR_3, RAN_3)
user_defined=[{‘B’:[1,2,3]}], attr_words={‘B’:’MAX’} - create an attribute B_1 as a maximum
value of B from SourceLists with SLID=1,2 and 3

debug : show an SQL statements and debug information if debug=True, debug=False by definition sourcelist_name : rename a created SourceList

make_aid()
make_attribute_list()
make_columns()
make_fits_file(extname)
name = ''
retrieve_data()
set_aggregate_functions(attributes)
set a dictionary for aggregate functions to make a new attribute from old one
Example: attr_words={‘MAG_ISO’:’MAX’} - select maximum of MAG_ISO as a new magnitude The function must be an Oracle aggregate function (MAX,MIN,AVG,STDDEV and so on)
set_combined_method(attributes)
by definition combined_method=2
combined_method=1 - all sources, assotiated in AssociateList and non-associated (non-
presented in AssociateList) are combined. SID=AID for associated sources, SID>MAX(AID) for non-associated

combined_method=2 - sources in AssociateList are taken only combined_method=3 - non-associated sources (not in an input AssociateList) are taken only

set_debug()

debug : show an SQL statements and debug information if debug=True, debug=False by definition

set_magnitude_flags(attributes)
a dictionary for attributes with flags for magnitudes. The user must fill this dictionary in to
have a flag in MAGFLAG_n attributes Example: mag_flags={‘MAG_ISO’:’MAG_FLAG’}
set_user_defined_attributes(attributes)

a list of attributes the user would like to see in a new SourceList. RA, DEC, HTM will always present in a SourceList. Example: user_attributes=[‘MAG_FLAG’,’B’]

set_user_defined_magnitudes(attributes)

set a dictionary of attributes which will be treated as magnitudes. The key is a name of attribute and the value is the name of the filter. Example: user_mags={‘MAG_ISO’:’#849’}

slid_sid = []
slid_un = []
sourcelist = None
sum_rows(inp_r, c_i, ce_i)
ulDEC = 0.0
ulRA = 0.0
urDEC = 0.0
urRA = 0.0
user_attributes = []
user_defined = []
user_mags = {}
exception astro.main.CombinedList.CombinedListError

Bases: Exception

astro.main.CombinedList.avg(inp_list)
astro.main.CombinedList.convert_type_topython(inp)
astro.main.CombinedList.make_range(inp_list)

astro.main.Config module

An interface to the canonical configurations and parameters of external programs

class astro.main.Config.AddImageCalibsConfig(filename=None, tmpbase='')

Bases: common.main.Config.NonPersistentConfig

VERBOSE = 'NORMAL'
program_name = 'LDAC.add_image_calibs'
class astro.main.Config.AplastromConfig(filename=None, tmpbase='')

Bases: common.main.Config.NonPersistentConfig

program_name = 'LDAC.aplastrom'
class astro.main.Config.AssociateConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

INTER_COLOR_TOL

The factor with which the object dimensions (second order moments) are multiplied to search for overlap between objects of different input catalogs [None]

ISO_COLOR_TOL

The factor with which the object dimensions (second order moments) are multiplied to search for overlap between objects within the same input catalog [None]

MASK

The SExtractor mask to select objects for astrometric pairing: Flag & FLAG_MASK [None]

PAIR_COLS

Enable the output of the PAIRS association column [None]

VERBOSE

Verbosity level (NONE, NORMAL, VERBOSE, DEBUG) [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

program_name = 'LDAC.associate'
class astro.main.Config.AstromConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

FDEG

Degrees of freedom of Chebychev polynomials [None]

NITER

The number of iterations during solving [None]

PDEG

Degrees of freedom for plate polynomials [None]

THRESHFRAC

The fraction of the maximum threshold below which the iteration is allowed to threshold [None]

VERBOSE

Verbosity level (NONE, NORMAL, VERBOSE, DEBUG) [None]

XMAX

Maximum X-coordinate of useful pixel plane [pixel]

XMIN

Minimum X-coordinate of useful pixel plane [pixel]

XPIXSIZE

The scaling of pixels with which CDELT1 is multiplied [None]

YMAX

Maximum Y-coordinate of useful pixel plane [pixel]

YMIN

Minimum Y-coordinate of useful pixel plane [pixel]

YPIXSIZE

The scaling of pixels with which CDELT2 is multiplied [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

program_name = 'LDAC.astrom'
class astro.main.Config.BPZConfig(filename=None, tmpbase='')

Bases: common.main.Config.NonPersistentConfig

ADD_CONTINUOUS_PROB = None
ADD_SPEC_PROB = None
CHECK = 'yes'
COLOR = 'no'
CONVOLVE_P = 'yes'
DELTA_M_0 = 0.0
DZ = 0.01
EXCLUDE = 'none'
FC = None
GET_Z = 'yes'
INTERACTIVE = 'yes'
INTERP = 0
MADAU = 'yes'
MAG = 'yes'
MERGE_PEAKS = 'no'
MIN_MAGERR = 0.001
MIN_RMS = 0.05
NEW_AB = 'no'
NMAX = None
NTYPES = None
N_PEAKS = 1
ODDS = 0.95
ONLY_TYPE = 'no'
PHOTO_ERRORS = 'no'
PLOTS = 'no'
PRIOR = 'hdfn_gen'
PROBS = 'no'
PROBS2 = 'no'
PROBS_LITE = 'yes'
P_MIN = 0.01
SPECTRA = 'CWWSB4.list'
VERBOSE = 'no'
ZC = None
ZMAX = 10.0
ZMIN = 0.01
program_name = 'bpz.py'
class astro.main.Config.CosmicConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

ANALYSIS_THRESH

Threshold at which CLASS_STAR and FWHM_ operate [mag / arcsec^2]

BACKPHOTO_THICK

Thickness of the background LOCAL annulus [pixel]

BACKPHOTO_TYPE

Background used to compute magnitudes (GLOBAL, LOCAL) [None]

BACK_FILTERSIZE

Size of background-filtering mask [background mesh]

BACK_SIZE

Size of a background mesh [pixel]

BACK_TYPE

The type of background subtracted from the images (AUTO, MANUAL) [None]

BACK_VALUE

The constant value to be subtracted from the images if BACK_TYPE is MANUAL [None]

CATALOG_NAME

Name of the output catalog [None]

CATALOG_TYPE

Format of the output catalog (ASCII, ASCII_HEAD, ASCII_SKYCAT, ASCII_VOTABLE, FITS_1.0, FITS_LDAC) [None]

CHECKIMAGE_NAME

Filename for the check-image [None]

CHECKIMAGE_TYPE

Type of information to put in the check-image (NONE, IDENTICAL, BACKGROUND, BACKGROUND_RMS, MINIBACKGROUND, MINIBACK_RMS, -BACKGROUND, FILTERED, OBJECTS, -OBJECTS, APERTURES, SEGMENTATION) [None]

CLEAN

Clean the catalog before writing to disk (Y, N) [None]

CLEAN_PARAM

Efficiency of cleaning [None]

DEBLEND_MINCONT

Minimum contrast parameter for deblending [None]

DEBLEND_NTHRESH

Number of deblending sub-thresholds [None]

DETECT_MINAREA

Minimum number of pixels above threshold triggering detection [pixel]

DETECT_THRESH

Detection threshold relative to background RMS (when THRESH_TYPE is RELATIVE) [None]

DETECT_TYPE

Type of device that produced the image (CCD, PHOTO) [None]

FILTER

Apply filtering to the data before extraction (Y, N) [None]

FILTER_NAME

Name of file contianing the filter definition [None]

FILTER_THRESH

Lower and higher thresholds (in background standard deviations) for a pixel to be considered in filtering [None]

FLAG_IMAGE

filename of the flag-image [None]

FLAG_TYPE

Combination method for flags on the same object (OR, AND, MIN, MAX, MOST) [None]

GAIN

Conversion factor used for error estimates of CCD magnitudes [e^- / ADU]

MAG_GAMMA

Gamma of the emulsion (when DETECT_TYPE is PHOTO) [None]

MAG_ZEROPOINT

Zero-point offset to be applied to magnitudes [mag]

MASK_TYPE

Method of masking of neighbors for photometry (NONE, BLANK, CORRECT) [None]

MEMORY_BUFSIZE

Number of scan-lines in the image buffer [None]

MEMORY_OBJSTACK

Maximum number of objects that the object-stack can contain [None]

MEMORY_PIXSTACK

Maximum number of pixels that the pixel-stack can contain [None]

PARAMETERS_NAME

Name of the file containing the list of parameters that will be computed and put into the catalog for each object [None]

PHOT_APERTURES

MAG_APER aperture diameter [pixel]

PHOT_AUTOAPERS

MAG_AUTO minimum circular aperture diameters (estimation disk, measurement disk) [None]

PHOT_AUTOPARAMS

MAG_AUTO controls (scaling parameter k of the first order moment and minimum R_min in units of A and B) [None]

PIXEL_SCALE

Pixel size [arcsec / pixel]

SATUR_LEVEL

Pixel value above which it is considered saturated (in applicable units) [None]

SEEING_FWHM

FWHM of stellar sources (for star/galaxy separation only) [arcsec]

STARNNW_NAME

Name of the file containing the neural-network weights for star/galaxy separation [None]

THRESH_TYPE

Meaning of DETECT_THRESH and ANALYSIS_THRESH parameters (RELATIVE, ABSOLUTE) [None]

VERBOSE_TYPE

Verbosity level (QUIET, NORMAL, EXTRA_WARNINGS, FULL) [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

program_name = 'Cosmic'
class astro.main.Config.CosmicParams(filename=None)

Bases: astro.main.Config.SextractorParams

program_name = 'Cosmic'
class astro.main.Config.MakeDistortConfig(filename=None, tmpbase='')

Bases: common.main.Config.NonPersistentConfig

VERBOSE = 'NORMAL'
program_name = 'LDAC.make_distort'
class astro.main.Config.MakeSscConfig(filename=None, tmpbase='')

Bases: common.main.Config.NonPersistentConfig

COL_CHAN = ['ALL', 'ALL', 'ALL', 'ALL', 'ALL', 'ALL', 'ALL', 'ALL', 'ALL']
COL_INPUT = ['FIELD_POS', 'SeqNr', 'Ra', 'Dec', 'Xpos', 'Ypos', 'PosErr', 'ERRA_IMAGE', 'Flag']
COL_MERGE = ['AVERAGE', 'AVERAGE', 'AVERAGE', 'AVERAGE', 'AVERAGE', 'AVERAGE', 'AVE_ERR', 'AVE_ERR', 'AVE_FLAG']
COL_NAME = ['Field', 'SeqNr', 'Ra', 'Dec', 'Xpos', 'Ypos', 'PosErr', 'ERRA_IMAGE', 'Flag']
MAKE_PAIRS = 'YES'
VERBOSE = 'NORMAL'
program_name = 'LDAC.make_ssc'
class astro.main.Config.PreastromConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

AFFINE_PARS

List of Parameters for the affine transformation (a0, a1, a2, b0, b1, b2) [None]

FLAG_MASK

The SExtractor mask to select objects for astrometric pairing: Flag & FLAG_MASK [None]

MAX_OFFSET

Maximum allowed offset between extracted and reference objects [pixel]

MIN_OBJ

The minimum number of reference objects required to determine affine transformation [None]

MIN_PHOTS

List of photometric parameter limits for pairing with reference objects [None]

PHOT

Name of the table column containing object flux measures [None]

POS_ERROR

Positional error between extracted and reference objects [pixel]

RMS_TOL

RMS tolerenace for triangulation matching [pixel]

SEL_MIN

Minumim number of objects used in triangulation method [None]

VERBOSE

Verbosity level (NONE, NORMAL, VERBOSE, DEBUG) [None]

XMAX

Maximum X-coordinate allowed in pairing [pixel]

XMIN

Minimum X-coordinate allowed in pairing [pixel]

XPIXSIZE

The scaling of pixels with which CDELT1 is multiplied [None]

YMAX

Maximum Y-coordinate allowed in pairing [pixel]

YMIN

Minimum Y-coordinate allowed in pairing [pixel]

YPIXSIZE

The scaling of pixels with which CDELT2 is multiplied [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

program_name = 'LDAC.preastrom'
class astro.main.Config.PrephotomConfig(filename=None, tmpbase='')

Bases: common.main.Config.NonPersistentConfig

DEC = 'DELTA_SKY'
EPOCH = 2000.0
FLAG = 'Flag'
MULTIPLE = 'NO'
PHOT = 'FLUX_ISO'
PHOTERR = 'FLUXERR_ISO'
RA = 'ALPHA_SKY'
STDMAG = ['JohnsonU', 'JohnsonB', 'CousinsI']
TOL = 5.0
VERBOSE = 'NORMAL'
program_name = 'LDAC.prephotom'
class astro.main.Config.PsfexConfig(filename=None, tmpbase='')

Bases: common.main.Config.NonPersistentConfig

BADPIXEL_FILTER = 'N'
BADPIXEL_NMAX = 0
BASIS_NAME = 'basis.fits'
BASIS_NUMBER = 20
BASIS_SCALE = 1.0
BASIS_TYPE = 'PIXEL_AUTO'
CENTER_KEYS = ('X_IMAGE', 'Y_IMAGE')
CHECKIMAGE_CUBE = 'N'
CHECKIMAGE_NAME = ('chi.fits', 'proto.fits', 'samp.fits', 'resi.fits', 'snap.fits')
CHECKIMAGE_TYPE = ('CHI', 'PROTOTYPES', 'SAMPLES', 'RESIDUALS', 'SNAPSHOTS')
CHECKPLOT_ANTIALIAS = 'Y'
CHECKPLOT_DEV = 'PNG'
CHECKPLOT_NAME = ('fwhm', 'ellipticity', 'counts', 'countfrac', 'chi2', 'resi')
CHECKPLOT_RES = 0
CHECKPLOT_TYPE = ('FWHM', 'ELLIPTICITY', 'COUNTS', 'COUNT_FRACTION', 'CHI2', 'RESIDUALS')
HIDDENMEF_TYPE = 'COMMON'
HOMOBASIS_NUMBER = 10
HOMOBASIS_SCALE = 1.0
HOMOBASIS_TYPE = 'NONE'
HOMOKERNEL_DIR = ''
HOMOKERNEL_SUFFIX = '.homo.fits'
HOMOPSF_PARAMS = (2.0, 3.0)
MEF_TYPE = 'INDEPENDENT'
NEWBASIS_NUMBER = 8
NEWBASIS_TYPE = 'NONE'
NTHREADS = 0
OUTCAT_NAME = 'psfex_out.cat'
OUTCAT_TYPE = 'NONE'
PHOTFLUXERR_KEY = 'FLUXERR_APER(1)'
PHOTFLUX_KEY = 'FLUX_APER(1)'
PSFVAR_DEGREES = 2
PSFVAR_GROUPS = (1, 1)
PSFVAR_KEYS = ('X_IMAGE', 'Y_IMAGE')
PSFVAR_NSNAP = 9
PSF_ACCURACY = 0.01
PSF_DIR = ''
PSF_PIXELSIZE = 1.0
PSF_RECENTER = 'N'
PSF_SAMPLING = 0.0
PSF_SIZE = (25, 25)
PSF_SUFFIX = '.psf'
SAMPLEVAR_TYPE = 'SEEING'
SAMPLE_AUTOSELECT = 'Y'
SAMPLE_FLAGMASK = '0x00fe'
SAMPLE_FWHMRANGE = (2.0, 10.0)
SAMPLE_IMAFLAGMASK = '0x0'
SAMPLE_MAXELLIP = 0.3
SAMPLE_MINSN = 20
SAMPLE_VARIABILITY = 0.2
SAMPLE_WFLAGMASK = '0x0000'
STABILITY_TYPE = 'EXPOSURE'
VERBOSE_TYPE = 'NORMAL'
WRITE_XML = 'N'
XML_NAME = 'psfex.xml'
XSL_URL = 'file:///usr/share/psfex/psfex.xsl'
program_name = 'Psfex'
class astro.main.Config.PsfexParams(filename=None)

Bases: astro.main.Config.SextractorParams

program_name = 'Psfex'
class astro.main.Config.RegstarConfig(filename=None, tmpbase='')

Bases: common.main.Config.NonPersistentConfig

CORE_AREA_MIN = 1
CORE_RAD_MIN = -1.0
CORE_RAD_SCL = -1.0
HALO1_AREA_MIN = -1
HALO1_OFF_SCL = 1.087
HALO1_OFF_XC = 9597.478
HALO1_OFF_YC = 10074.533
HALO1_RAD = -1
HALO2_AREA_MIN = -1
HALO2_OFF_SCL = -1.0
HALO2_OFF_XC = 8481.165
HALO2_OFF_YC = 10036.078
HALO2_RAD = 450
HALO3_AREA_MIN = -1
HALO3_OFF_SCL = 1.08
HALO3_OFF_XC = 9232.897
HALO3_OFF_YC = 9883.317
HALO3_RAD = 300
SPKD_ABS_ROT = -1.0
SPKD_PROFILE = []
SPKD_RAD_MOD = -1.0
SPKR_LEN_SCL = 1.2
SPKR_RATIO_MIN = 3.0
SPKR_WID_SCL = 0.75
program_name = 'Regstar'
class astro.main.Config.ScampConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

AIRMASS_KEY

FITS header keyword containing the airmass [None]

ASTRCLIP_NSIGMA

Clipping boundry for the second astrometric pass in standard deviations [None]

ASTREFCAT_NAME

Filenames of local astrometric reference catalogs, used when ASTREF_CATALOG is set to FILE [None]

ASTREFCENT_KEYS

Column names containing the coordinates in degrees of the centroids of each source for the reference catalog(s), used when ASTREF_CATALOG is set to FILE [None]

ASTREFERR_KEYS

Column names containing the major axis, minor axis, and position angle in pixels, respectively, of the error ellipses for the reference catalog(s), used when ASTREF_CATALOG is set to FILE [None]

ASTREFMAG_KEY

Column name containing the astrometric reference magnitudes, used when ASTREF_CATALOG is set to FILE [None]

ASTREF_BAND

Column name of photometric band used for astrometric reference magnitudes or one of: DEFAULT, BLUEST, REDDEST [None]

ASTREF_CATALOG

Name of reference catalog for astrometry, one of: NONE, FILE, USNO-A1, USNO-A2, USNO-B1, GSC-1.3, GSC-2.2, UCAC-1, UCAC-2, NOMAD-1, 2MASS, DENIS-3, SDSS-R3, SDSS-R5, SDSS-R6 [None]

ASTREF_WEIGHT

Relative weight of the astrometric reference catalog [None]

ASTRINSTRU_KEY

FITS header keyword(s) defining the astrometric context/instrument [None]

CENTROIDERR_KEYS

Column names containing the major axis, minor axis, and position angle in pixels, respectively, of the error ellipses for the input catalog(s) [None]

CENTROID_KEYS

Column names containing the coordinates in degrees of the centroids of each source for the input ctalog(s) [None]

CORRECT_COLOURSHIFTS

Correct for colour shifts [None]

CROSSID_RADIUS

Search radius used for all cross-identifications [arcsec]

DISTORT_DEGREES

Polynomial degree of each group [None]

DISTORT_GROUPS

Polynomial group that each DISTORT_KEY belongs to [None]

DISTORT_KEYS

Column names or FITS keywords (indicated by a colon prefix) containing measurements used to map astrometric distortions for the input catalog(s) [None]

EXPOTIME_KEY

FITS header keyword containing the exposure time [None]

FGROUP_RADIUS

Maximum angular distance allowed between field centers to include them in the same group of fields [deg]

FIXFOCALPLANE_NMIN

Minimum number of detections per focal plane array required to be part of MOSAIC_TYPE FIX_FOCALPLANE statistics [None]

FLAGS_MASK

Binary mask applied to FLAGS column to reject flagged detections [None]

FWHM_THRESHOLDS

Range of Full-Width at Half-Maximum allowed for input detections [pixel]

HEADER_SUFFIX

Filename extension of output header files [None]

HEADER_TYPE

Type of WCS information in output header files, one of: NORMAL, FOCAL_PLANE [None]

IMAFLAGS_MASK

Binary mask applied to IMAFLAGS column to reject flagged detections [None]

MAGZERO_INTERR

Internal zero-point accuracy [mag]

MAGZERO_KEY

FITS header keyword containing the zero-point [None]

MAGZERO_OUT

Arbitrary magnitude zero-point for output flux scale [mag]

MAGZERO_REFERR

Photometric field zero-point accuracy [mag]

MATCH

Do pattern-matching of input detections with sources from the astrometric reference catalog (i.e., preastrom) [None]

MATCH_FLIPPED

Consider a possible flipping of input frames during MATCHing [None]

MATCH_NMAX

Maximum number of detections used to compute the position angle and pixel scale while MATCHing (0=auto) [None]

MATCH_RESOL

MATCHing resolution (0.0=auto) [arcsec]

MERGEDOUTCAT_NAME

Filename of merged output catalog (i.e., astrometrically corrected input catalog) [None]

MERGEDOUTCAT_TYPE

Type of the merged output catalog, one of: NONE, ASCII_HEAD, ASCII, FITS, FITS_LDAC [None]

MOSAIC_TYPE

Type of pre-processing for mosaics of focal plane arays, one of: UNCHANGED, SAME_CRVAL, SHARE_PROJAXIS, FIX_FOCALPLANE, LOOSE [None]

PHOTCLIP_NSIGMA

Clipping boundary for the second photometric pass in standard deviations [None]

PHOTFLUXERR_KEY

Column name containing the flux error estimate for the input catalog(s) [None]

PHOTFLUX_KEY

Column name containing the flux measurement for the input catalog(s) [None]

PHOTINSTRU_KEY

FITS header keyword(s) defining the photometric context/instrument [None]

PIXSCALE_MAXERR

Search range of the pixel scale factor used in astrometric MATCHing (e.g., 1.2 is equivalent to +/- 20% of the original pixel scale) [None]

POSANGLE_MAXERR

Search range for the position angle in astrometric MATCHing [deg]

POSITION_MAXERR

Search range for the position in astrometric MATCHing [arcmin]

REFOUT_CATPATH

Directory name where downloaded reference catalogs will be saved [None]

SAVE_REFCATALOG

Save a copy of the downloaded astrometric reference catalogs in FITS_LDAC format to REFOUT_CATPATH [None]

SN_THRESHOLDS

The pair of signal-to-noise ratio (S/N) thresholds (in standard deviations) indicating the minumum threshold for the sample of all sources and of high-S/N sources, respectively [None]

SOLVE_ASTROM

Compute astrometric solution in 2 passes, or just compute statistics [None]

SOLVE_PHOTOM

Compute photometric solution in 2 passes, or just compute statistics [None]

STABILITY_TYPE

Type of stability of the astrometric instrument, one of: EXPOSURE, INSTRUMENT [None]

VERBOSE_TYPE

Degree of verbosity output, one of: QUIET, NORMAL, LOG or FULL [None]

WEIGHTFLAGS_MASK

Binary mask applied to FLAGS_WEIGHT column to reject flagged detections [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

program_name = 'Scamp'
class astro.main.Config.SextractorConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

ANALYSIS_THRESH

Threshold at which CLASS_STAR and FWHM_ operate [mag / arcsec^2]

BACKPHOTO_THICK

Thickness of the background LOCAL annulus [pixel]

BACKPHOTO_TYPE

Background used to compute magnitudes (GLOBAL, LOCAL) [None]

BACK_FILTERSIZE

Size of background-filtering mask [background mesh]

BACK_SIZE

Size of a background mesh [pixel]

BACK_TYPE

The type of background subtracted from the images (AUTO, MANUAL) [None]

BACK_VALUE

The constant value to be subtracted from the images if BACK_TYPE is MANUAL [None]

CATALOG_NAME

Name of the output catalog [None]

CATALOG_TYPE

Format of the output catalog (ASCII, ASCII_HEAD, ASCII_SKYCAT, ASCII_VOTABLE, FITS_1.0, FITS_LDAC) [None]

CHECKIMAGE_NAME

Filename for the check-image [None]

CHECKIMAGE_TYPE

Type of information to put in the check-image (NONE, IDENTICAL, BACKGROUND, BACKGROUND_RMS, MINIBACKGROUND, MINIBACK_RMS, -BACKGROUND, FILTERED, OBJECTS, -OBJECTS, APERTURES, SEGMENTATION) [None]

CLEAN

Clean the catalog before writing to disk (Y, N) [None]

CLEAN_PARAM

Efficiency of cleaning [None]

DEBLEND_MINCONT

Minimum contrast parameter for deblending [None]

DEBLEND_NTHRESH

Number of deblending sub-thresholds [None]

DETECT_MINAREA

Minimum number of pixels above threshold triggering detection [pixel]

DETECT_THRESH

Detection threshold relative to background RMS (when THRESH_TYPE is RELATIVE) [None]

DETECT_TYPE

Type of device that produced the image (CCD, PHOTO) [None]

FILTER

Apply filtering to the data before extraction (Y, N) [None]

FILTER_NAME

Name of file contianing the filter definition [None]

FLAG_IMAGE

filename of the flag-image [None]

FLAG_TYPE

Combination method for flags on the same object (OR, AND, MIN, MAX, MOST) [None]

GAIN

Conversion factor used for error estimates of CCD magnitudes [e^- / ADU]

MAG_GAMMA

Gamma of the emulsion (when DETECT_TYPE is PHOTO) [None]

MAG_ZEROPOINT

Zero-point offset to be applied to magnitudes [mag]

MASK_TYPE

Method of masking of neighbors for photometry (NONE, BLANK, CORRECT) [None]

MEMORY_BUFSIZE

Number of scan-lines in the image buffer [None]

MEMORY_OBJSTACK

Maximum number of objects that the object-stack can contain [None]

MEMORY_PIXSTACK

Maximum number of pixels that the pixel-stack can contain [None]

PARAMETERS_NAME

Name of the file containing the list of parameters that will be computed and put into the catalog for each object [None]

PHOT_APERTURES

MAG_APER aperture diameter [pixel]

PHOT_AUTOAPERS

MAG_AUTO minimum circular aperture diameters (estimation disk, measurement disk) [None]

PHOT_AUTOPARAMS

MAG_AUTO controls (scaling parameter k of the first order moment and minimum R_min in units of A and B) [None]

PIXEL_SCALE

Pixel size [arcsec / pixel]

REAL_PHOT_APERTURES = None
SATUR_LEVEL

Pixel value above which it is considered saturated (in applicable units) [None]

SEEING_FWHM

FWHM of stellar sources (for star/galaxy separation only) [arcsec]

STARNNW_NAME

Name of the file containing the neural-network weights for star/galaxy separation [None]

THRESH_TYPE

Meaning of DETECT_THRESH and ANALYSIS_THRESH parameters (RELATIVE, ABSOLUTE) [None]

VERBOSE_TYPE

Verbosity level (QUIET, NORMAL, EXTRA_WARNINGS, FULL) [None]

WEIGHT_IMAGE

Filename of the detection and measurement weight-image [None]

WEIGHT_TYPE

Weighting scheme for weight-image (NONE, BACKGROUND, MAP_RMS, MAP_VAR, MAP_WEIGHT) [None]

get_kw_list()
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

program_name = 'SExtractor'
class astro.main.Config.SextractorParams(filename=None)

Bases: common.main.Config.Params

program_name = 'SExtractor'
class astro.main.Config.SwarpConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

BACK_DEFAULT

Default background to be subtracted in BACK_TYPE MANUAL mode [None]

BACK_FILTERSIZE

Size of background filtering mask in factors of BACK_SIZE [None]

BACK_SIZE

Size of a background mesh [pixel]

BACK_TYPE

The type of background to subtract (AUTO, MANUAL) [None]

CELESTIAL_TYPE

Celestial coordinate system in output (NATIVE, PIXEL, EQUATORIAL, GALACTIC, ECLIPTIC) [None]

CENTER

Position of center in CENTER_TYPE MANUAL mode [deg]

CENTER_TYPE

The way the output frame is centered (ALL, MOST, MANUAL) [None]

COMBINE

Combine resampled images (Y, N) [None]

COMBINE_BUFSIZE

Amount of megabytes of buffer memory used for coaddition [None]

COMBINE_TYPE

The image combination method (MEDIAN, AVERAGE, MIN, MAX, WEIGHTED, CHI2, SUM) [None]

COPY_KEYWORDS

String containing comma-separated FITS keywords to copy to output images [None]

DELETE_TMPFILES

Delete temporary image files [None]

FSCALASTRO_TYPE

How to compute the astrometric part of the flux scaling (NONE, FIXED) [None]

FSCALE_DEFAULT

Default flux scale to adopt if FSCALE_KEYWORD nonexistent [None]

FSCALE_KEYWORD

FITS keyword containing flux scale in input images [None]

GAIN_DEFAULT

Default gain to adopt if GAIN_KEYWORD nonexistent [e^- / ADU]

GAIN_KEYWORD

FITS keyword containing the gain in input images [None]

HEADER_ONLY

Only create the header in the combined image (Y, N) [None]

HEADER_SUFFIX

Extension of the replacement header files [None]

IMAGEOUT_NAME

Filename of output image [None]

IMAGE_SIZE

Dimensions of the output image [pixel]

INTERPOLATE

Interpolate upon resampling (Y, N) [None]

MEM_MAX

Maximum amount of megabytes allowed for RAM storage [None]

NTHREADS

Number of threads to run simultaneously during resampling (0 is automatic) [None]

OVERSAMPLING

Amount of oversampling in each dimension [None]

PIXELSCALE_TYPE

How the output pixel size is set (MEDIAN, MIN, MAX, MANUAL, FIT) [None]

PIXEL_SCALE

Step between pixels in each dimension [arcsec / pixel]

PROJECTION_TYPE

Projection system used in output in standard WCS notation (AZP, TAN, STG, SIN, ARC, ZPN, ZEA, AIR, CYP, CEA, CAR, MER, COP, COE, COD, COO, BON, PCO, GLS, PAR, MOL, AIT, TCS, CSC, QSC) [None]

RESAMPLE

Resample the input images (Y, N) [None]

RESAMPLE_DIR

Path of the directory where the resampled images are written [None]

RESAMPLE_SUFFIX

Extension of the resampled images [None]

RESAMPLING_TYPE

Resampling method (NEAREST, BILINEAR, LANCZOS2, LANCZOS3, LANCZOS4) [None]

SUBTRACT_BACK

Background-subtract images prior to resampling [None]

VERBOSE_TYPE

Verbosity level (QUIET, NORMAL, FULL) [None]

VMEM_DIR

Path of the directory where virtual-memory and other temporary files are written [None]

VMEM_MAX

Maximum amount of megabytes allowed for virtual-memory storage [None]

WEIGHTOUT_NAME

Filename of the output weight-map [None]

WEIGHT_IMAGE

List of filenames of input weight-maps [None]

WEIGHT_SUFFIX

Extension of the input weight-maps [None]

WEIGHT_TYPE

Type of input weight-map (NONE, MAP_WEIGHT, MAP_VARIANCE, MAP_RMS) [None]

WRITE_FILEINFO

Write extended information from input images to output images [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

program_name = 'SWarp'

astro.main.ConvolvedFrame module

defines class ConvolvedFrame

A ConvolvedFrame is an image that is ‘seeing-aligned’ to an analytical Gauss- or Moffat PSF via kernel-convolution.

class astro.main.ConvolvedFrame.ConvolvedFrame(pathname='')

Bases: astro.main.RegriddedFrame.RegriddedBaseFrame

This class is intended to convolve one frame to an analytical Gauss- or Moffat-Seeing.

All pixel data needs to be available on a single node/machine.

NAXIS1

Length of data in axis 1 [pixel]

NAXIS2

Length of data in axis 2 [pixel]

OBJECT

OBJECT name [None]

ZEROPNT

Zeropoint of this image [mag]

ZPNTERR

Zeropoint error [mag]

all_sources

list of all sources [None]

astrom

Information about the astrometry [None]

check_preconditions()
chip

chip name [None]

copy_attributes()
creation_date

Date this object was created [None]

derive_chipname()

derive the chip names from the regridded frames

derive_objectname()

derive the object (names) from the regridded frames

filename

The name of the associated file [None]

filter

Information about the filter [None]

get_canonical_name()

Generate the unique filename for this ReferenceFrame.

get_canonical_name_for_weight()

Generate the unique filename for the associated WeightFrame produced by ConvolvedFrame.

get_previous_version(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)
globalname

The name used to store and retrieve file to and from Storage [None]

grid_target

The GridTarget object for the regridding operation [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]

logfile

logfile [None]

make()

Make a ConvolvedFrame.

Dependencies: regridded_frame – input frame: RegriddedFrame or CoaddedRegriddedFrame

mandatory_dependencies = (('regridded_frame', 1),)
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

prepare_sourcelists()
process_params

process parameters [None]

process_status

A flag indicating the processing status [None]

psf_radius

Seeing FWHM [arcsec]

quality_flags

Automatic/internal quality flag [None]

ref_stars

list of PSF-reference stars [None]

regridded_frame

input RegriddedFrame/CoaddedRegriddedFrame [None]

residual_stamps

cut-outs [None]

residuals

residuals of PSF reference stars [%]

residuals_flux

fluxes of PSF reference stars [pixel]

residuals_x

x-positions of PSF reference stars [pixel]

residuals_y

x-positions of PSF reference stars [pixel]

run_convolution()
run_prepare()
set_logfile_attribute()
set_weight_attribute()
store()
swarpconf

The Swarp configuration file [None]

verify()
weight

The regridded WeightFrame object [None]

class astro.main.ConvolvedFrame.ConvolvedFrameParams

Bases: common.database.DBMain.DBObject

ALL_SOURCES_NUMBER

number of stars in frame [None]

ALL_SOURCES_THRESH

SExtractor detection threshold for all stars [None]

ANGLE

angle of reference PSF [deg]

BETA

moffat beta value of reference PSF [None]

BOX_SIZE

PSF box radius [pixel]

CLASS_STAR_LIMIT

minimum class_star value for PSF reference stars [None]

FWHM

FWHM of reference PSF [pixel]

KERNEL_MODEL

convolution kernel model [None]

KERNEL_SIZE

convolution kernel radius [pixel]

MAXIMUM_RESIDUAL

maximum allowed residual [%]

MAX_THRESH

maximum threshold for autoselect reference stars [None]

MIN_THRESH

minimum threshold for autoselect reference stars [None]

NUMBER_REF_STARS

number of reference stars [None]

SOURCE_CODE_VERSION

version of the source code [None]

VERBOSE

verbosity level [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

astro.main.ConvolvedFrame.get_best_thresh(frame, min_number=0, max_number=1e+99, thresh_start=10, verbose=0)

Function to find a certain sextractor DETECTION_THRESH for which the number of sources is between min_number and max_number.

Syntax examples: get_best_thresh( my_frame, min_number = 300, max_number = 350, thresh_start = 100 )

min_number - minimum number of stars max_number - maximum number of stars thresh_start - initial threshold verbose - verbose level

astro.main.ConvolvedFrame.int2str(value, digits)

This small routine converts an integer value in a string with fixed number of digits by inserting a number of leading zeros.

astro.main.ConvolvedFrame.make_table_on_sources(sl=None, filename=None, verbose=0)

creates a simple ASCII table which contains only x, y, RA, DEC, flux and flag sl is of type SourceList. the default filename is the filename of the SourceList with extension .ascii

astro.main.CosmicMap module

defines classes used in detecting cosmic ray impacts

class astro.main.CosmicMap.CosmicMap(pathname='')

Bases: astro.main.PixelMap.PixelMap

The map of bad pixels due to cosmic ray events

There are two methods to produce cosmic ray maps. The first method uses sextractor with a cosmic retina (q.v.) to produce an image of pixels where cosmic rays were detected. The second method used the program CosmicFITS to detect the cosmics and produce an image

Depending on which type CosmicmapParameters are chosen, one or the other method is selected. For example, this produces a cosmic map with sextractor:

>>> cosmic = CosmicMap()
>>> cosmic.frame = ReducedScienceFrame(pathname='myframe.fits')
>>> cosmic.flat = MsterFlatFrame(pathname='myflat.fits')
>>> cosmic.process_params = CosmicMapSexParameters()
>>> cosmic.make()

while the following example produces a cosmic map using CosmicFITS

>>> cosmic = CosmicMap()
>>> cosmic.frame = ReducedScienceFrame(pathname='myframe.fits')
>>> cosmic.gain = GainLinearity()
>>> cosmic.gain.gain = 4.0
>>> cosmic.process_params = CosmicMapCosmicFITSParameters()
>>> cosmic.make()
check_preconditions()
chip

Information about the chip [None]

cold

A ColdPixelMap object [None]

copy_attributes()
cosmic_count

The number of cosmic rays [None]

count

The number of bad pixels [None]

creation_date

Date this object was created [None]

filename

The name of the associated file [None]

filter

Information about the filter [None]

flat

A MasterFlatFrame object [None]

frame

A BaseFrame object [None]

gain

A GainLinearity object [None]

get_canonical_name()

Generate the unique filename for this CosmicMap.

globalname

The name used to store and retrieve file to and from Storage [None]

hot

A HotPixelMap object [None]

illumination

The illumination correction [None]

instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make()
make_badpixelmap()
make_cosmicfits_cosmic()
make_sex_cosmic()

Detect cosmic rays using sextractor

Requires:
frame – The BaseFrame object on which the cosmics are detected flat – A MasterFlatFrame object saturated – A SaturatedPixelMap object (optional) cold – A ColdPixelMap object (optional) hot – A HotPixelMap object (optional)
Parameters (CosmicMapSexParameters)
process_params.DETECTION_THRESHOLD –
The sextractor DETECT_THRESH parameter
Updates:
count – The number of bad pixels due to cosmics cosmic_count – The number of cosmic ray events

The bad pixels due to cosmic rays are detected with the following procedure: 1. Produce weight = flat * (saturated & hot & cold) 2. Produce a SNR image = (frame-background) * sqrt(weight) 3. Run sextractor in cosmic-detection mode with threshold

DETECTION_THRESHOLD to produce a CHECKIMAGE_TYPE=’SEGMENTATION’ image of pixels affected by cosmics
  1. Produce a cosmic pixelmap from the check-image produced by Sextractor
  2. Count the number of cosmic ray events in the sextractor catalog
make_weight()
mandatory_dependencies = (('frame', 1), ('flat', 1))
mask_emc_patterns()

Detect EMC stripes by using the CosmicMap, since many of the affected pixels are detected as cosmics.

Collapse the CosmicMap in X-direction, and detect lines with sum of cosmics > MAX_COSMICS_PER_ROW

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

process_params

Processing parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

saturated

A SaturatedPixelMap object [None]

class astro.main.CosmicMap.CosmicMapCosmicFITSParameters

Bases: astro.main.CosmicMap.CosmicMapParameters

Parameters for processing CosmicMap objects, using CosmicFits

CIRC_FWHM

FWHM limit for circular refit [pixel]

CIRC_START

Start width value for circular refit [pixel]

CONFIDENCE_KAPPA

Apply confidence_kappa times error of fitparameters to fitparameters before evaluating cosmic criteria [None]

COSMIC_FWHM

Maximum FWHM for cosmic for smaller axis [pixel]

ISOLATION

Do not filter pixels with more than ISOLATION NaN neighbors [None]

KAPPA

Minimum amplitude for cosmic [None]

MEDIAN_KAPPA

KAPPA for median filter [None]

REPLACE_KAPPA

Replace pixels where (fit_function - fit_surface) > replace_kappa * SQRT(fit_surface / gain) [None]

SKY_OFFSET

Already subtracted constant sky surface [ADU]

SMOOTH_SCALE

Do not filter pixels with value - (smooth_scale * error) < minimum of fitbox, set to zero to turn off! [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

class astro.main.CosmicMap.CosmicMapParameters

Bases: common.database.DBMain.DBObject

Base class for processing parameters for CosmicMap objects

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

class astro.main.CosmicMap.CosmicMapSexParameters

Bases: astro.main.CosmicMap.CosmicMapParameters

Parameters for processing CosmicMap using sextractor

DETECTION_THRESHOLD

Sextractor DETECT_THRESH [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

astro.main.CrossTalk module

CrossTalk

Classes:

CrossTalkParameters CrossTalkCoefficient CrossTalk

class astro.main.CrossTalk.CrossTalk

Bases: common.database.DBMain.DBObject, astro.main.ProcessTarget.ProcessTarget

Main class used to measure crosstalk and create CrossTalkCoefficients, but also to apply existing CrossTalkCoefficients to correct RawFrames for the effects of crosstalk.

PROCESS_TIME = 30
coefficients

Crosstalk coefficients [None]

copy_attributes()
create_coefficients_from_matrices()

Read the transient matrices that store the results of the 1st order and 2nd order polynomial fits to create the appropriate CrossTalkCoefficients.

Not all fit results are made persistent (!).

creation_date

Date this object was created [None]

derive_timestamp()

Assign the default period for which the CrossTalk is valid.

The CrossTalk object is assumed to be valid for the night the observations were taken.

frames

RawFrames used to determine this crosstalk [None]

get_background_subtracted_data(frame)
initialize_matrices()
inspect()
instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

load_frames()
make()
make_segmentation_image(frame)

Make SExtractor segmentation images to avoid using pixels that are part of sources in the target CCD

make_segmentation_images()

Make SExtractor segmentation images to avoid using pixels that are part of sources in the target CCD

measure_crosstalk()

Measure the crosstalk

measure_crosstalk_pair(i, j)

The meat and potatoes

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

process_params

Crosstalk parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

rawfitsdata

RawFitsData used to determine this crosstalk [None]

set_singleton_coefficients()
timestamp_end

End of valid period [None]

timestamp_start

Start of valid period [None]

class astro.main.CrossTalk.CrossTalkCoefficient

Bases: common.database.DBMain.DBObject

get_singleton()

Private method. Query the database for an existing object, having the same values as the local one.

max_order

Maximum order of polynomial fit this coefficient is a part of [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

order

Order of polynomial coefficient

residual

Mean absolute residual of fit

saturated

Concerns coefficient for saturated pixels only

source

Chip where crosstalk originates

source_amplifier

Amplifier/detector half of source chip

target

Chip affected by crosstalk

target_amplifier

Amplifier/detector half of target chip

threshold

Threshold pixel value in source CCD between linear and non-linear regime

value

Value of polynomial coefficient

class astro.main.CrossTalk.CrossTalkParameters

Bases: common.database.DBMain.DBObject

MAX_SOURCE_1

Maximum pixel value in first order fit [ADU]

MAX_SOURCE_2

Maximum pixel value in second order fit [ADU]

MAX_TARGET

Upper clipping level of the offset of the affected pixel [ADU]

MIN_CROSSTALK_0

Minimum scale (0th order) for CrossTalkCoefficients, lower than this and it will be set to 0.

MIN_CROSSTALK_1

Minimum scale (1st order) for CrossTalkCoefficients, lower than this and it will be set to 0.

MIN_CROSSTALK_2

Minimum scale (2nd order) for CrossTalkCoefficients, lower than this and it will be set to 0.

MIN_SOURCE

Minimum pixel value in plots (not fit) [ADU]

MIN_SOURCE_1

Minimum pixel value in first order fit [ADU]

MIN_SOURCE_2

Minimum pixel value in second order fit [ADU]

MIN_TARGET

Lower clipping level of the offset of the affected pixel [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

astro.main.CrossTalk.main()
astro.main.CrossTalk.make_crosstalk(basename_measurement, extensions=[29, 30, 31, 32])

Measure the crosstalk for <extensions> of rawfitsdata with filename <filename>

astro.main.CrossTalk.make_crosstalk_from_DECAM_file(filename='xtalk_20130606.txt')
astro.main.CrossTalk.make_crosstalkcorrectedframes(basename_correction, crosstalk)

astro.main.CrossTalkCorrectedFrame module

CrossTalkCorrectedFrames and CrossTalkCorrector, the latter creating all relevant CrossTalkCorrectedFrames simultaneously.

class astro.main.CrossTalkCorrectedFrame.CrossTalkCorrectedRawDomeFlatFrame(pathname='')

Bases: astro.main.RawFrame.RawDomeFlatFrame

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]

crosstalk

CrossTalk object

extension

The extension to extract [None]

filename

The name of the associated file [None]

filter

Information about the filter [None]

get_canonical_name()

Generate the unique filename for this frame.

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

RawDomeFlatFrame

raw_fits_data

The multi-extension raw image [None]

template

Information about the template [None]

class astro.main.CrossTalkCorrectedFrame.CrossTalkCorrectedRawScienceFrame(**kw)

Bases: astro.main.RawFrame.RawScienceFrame

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]

PROCESS_TIME = 40
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]

crosstalk

CrossTalk object

extension

The extension to extract [None]

filename

The name of the associated file [None]

filter

Information about the filter [None]

get_canonical_name()

Generate the unique filename for this frame.

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_crosstalk_corrected()

Return whether the current RawScienceFrame has been crosstalk- corrected

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

RawScienceFrame

raw_fits_data

The multi-extension raw image [None]

template

Information about the template [None]

class astro.main.CrossTalkCorrectedFrame.CrossTalkCorrectedRawTwilightFlatFrame(pathname='')

Bases: astro.main.RawFrame.RawTwilightFlatFrame

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]

crosstalk

CrossTalk object

extension

The extension to extract [None]

filename

The name of the associated file [None]

filter

Information about the filter [None]

get_canonical_name()

Generate the unique filename for this frame.

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

RawTwilightFlatFrame

raw_fits_data

The multi-extension raw image [None]

template

Information about the template [None]

class astro.main.CrossTalkCorrectedFrame.CrossTalkCorrector(frames, crosstalk=None, coefficients=[])

Bases: object

This Corrector calculates the crosstalk-corrected frames in a single matrix multiplication. This is efficient, because each CCD needs only be read once, even if it’s suffering from crosstalk from multiple CCDs. However total memory use is large if many CCDs suffer from crosstalk.

load_frames()
make()
make_animated_gifs()

Create animated GIF images for all CCDs involved, before and after correction.

make_crosstalk_corrected_frame(idx)
make_crosstalk_corrected_frames()
represent_coefficients_as_matrix(order=0)
represent_matrix_as_coefficients(matrix, order=0, max_order=0, saturated=1)
set_coefficient_matrices()
set_coefficients_from_matrices()
update_images()

Calculate the matrix

C = P - B1*U - B0*Um - A0*Sm
afterwards:
  • set pixels that were 0 before correction back to 0
  • set pixels that were saturated before correction back to 65535.
here:
P is column vector of e.g. CCD93-96 images (all pixels) Z is column vector of e.g. CCD93-96 images (zero pixel mask) U is column vector of e.g. CCD93-96 images (unsaturated pixels) Um is column vector of e.g. CCD93-96 images (unsaturated pixels mask) Sm is column vector of e.g. CCD93-96 images (saturated pixels mask) S is column vector of e.g. CCD93-96 images (saturated pixels) B1 are the b1 coefficients in the y=b1*x + b0 fits B0 are the b0 coefficients in the y=b1*x + b0 fits A0 are the fitted offsets for saturated pixels
class astro.main.CrossTalkCorrectedFrame.CrossTalkCorrectorDECAM(frames, crosstalk)

Bases: object

Simplified corrector using straight looping, because of memory issues otherwise

load_frames()
make()
make_animated_gifs()

Create animated GIF images for all CCDs involved, before and after correction.

make_corrected_frame(frame)
make_corrected_frames()
make_corrected_image(source, source_amplifier, target, target_amplifier, a1, threshold, b1, b2, b3)
if src <= src_nl:
crosstalk = src * x
else:
crosstalk = src_nl * x + p1 * (src - src_nl) + p2 * (src - src_nl)**2 + p3 * (src - src_nl)**3
make_corrected_images()
organize_coefficients_in_pairs()
astro.main.CrossTalkCorrectedFrame.create_crosstalk_corrected_frame(frame)
astro.main.CrossTalkCorrectedFrame.get_canonical_name_for_crosstalk_corrected_frame(raw)

Generate the unique filename for this frame.

astro.main.CrossTalkCorrectedFrame.get_crosstalk_for_dateobs(dateobs)

Hardcoded crosstalk values determined from trend plots from August 2011 through September 2012.

XXX Note the thresholding at the end!!! XXX This works only when frames are sorted in the same order as these

matrices are built!!!!
astro.main.CrossTalkCorrectedFrame.read_DECam_crosstalk_file(filename='xtalk_20130606.txt')

astro.main.DarkCurrent module

dark current (req531) and particle event rate (req532)

class astro.main.DarkCurrent.DarkCurrent

Bases: common.database.DBMain.DBObject, astro.main.ProcessTarget.ProcessTarget

CalFile for the dark current and the particle event rate

The dark current is the mean of three median-averaged dark exposures. The particle event rate is the mean of the cosmic ray count of the three dark exposures. The dark current object can be created using:

>>> dc = DarkCurrent()
>>> dc.raw_dark_frames = [RawDarkFrame(pathname='dark1.fits'),
...                       RawDarkFrame(pathname='dark2.fits'),
...                       RawDarkFrame(pathname='dark3.fits')]
>>> dc.make()
>>> print dc.dark_current, dc.particle_event_rate
3.0 21.7
>>> dc.verify()
>>> dc.compare(dc2)
DARK_CURRENT_DIFFERENCE_TOO_HIGH
DARK_CURRENT_TOO_HIGH
INCONSISTENT_EVENT_COUNTS
PROCESS_TIME = 25
bias

The BiasFrame used to bias-correct the RawDarkFrames [None]

check_preconditions()
chip

Information about the chip [None]

compare(other)

Compare the dark current and particle event_rate measurements with a previous measurement.

The following flag may be set:
DARK_CURRENT_DIFFERENCE_TOO_HIGH –

dark_current-prev.dark_current > MAXIMUM_DARK_CURRENT_DIFFERENCE

copy_attributes()
cosmicconf

A CosmicConfig [None]

creation_date

Date this object was created [None]

dark_current

The dark current [ADU / pixel / hour]

derive_timestamp()

Assign the default period for which the DarkCurrent object is valid.

The DarkCurrent object is assumed to be valid for the night following the day the observations were taken.

event_counts

The number of cosmic ray events in each exposure [None]

free_memory()
hot

A HotPixelMask [None]

instrument

Information about the instrument [None]

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make()

Determine the dark current and calculate the particle event rate

Requires:
raw_dark_frames – Three RawDarkFrame objects bias – A BiasFrame object
Updates:
dark_current event_counts particle_event_rate
make_dark_current()

Determine the dark current

Requires:
raw_dark_frames – Three RawDarkFrame objects bias – A BiasFrame object
Updates:
dark_current – The dark current in ADU/pixel/hour
Parameters:
OVERSCAN_CORRECTION MAXIMUM_ITERATIONS REJECTION_THRESHOLD

The raw dark frames are trimmed, overscan-corrected and debiased. The dark current is calculated by median averaging three reduced dark frames and iteratively rejecting outliers from the result, and computing the mean of the remaining pixels.

make_particle_event_rate()

Calculate the particle event rate

Requires:
raw_dark_frames – Three RawDarkFrame objects bias – A BiasFrame object
Optional:
hot – A HotPixelMap object
Updates:
event_counts – The number of events detected in each dark frame particle_event_rate – The event rate in particles/cm^2/hour
Parameters:
OVERSCAN_CORRECTION DETECTION_THRESHOLD

The raw dark frames are trimmed, overscan-corrected and debiased. The particle event rate is determined by using the cosmic ray detection mechanism in Sextractor. The data used for this is the same data as for the dark current. Optionally a hot pixel map can be given.

mandatory_dependencies = (('raw_dark_frames', 3), ('bias', 1))
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]

particle_event_rate

The event rate [particles / cm**2 / hour]

prev = None
process_params

Process parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

raw_dark_frames

A list of RawDarkFrame objects [None]

template

Information about the template [None]

timestamp_end

End of valid period [None]

timestamp_start

Start of valid period [None]

verify()

Verify the dark current and particle event rate measurements.

The following flag may be set:
DARK_CURRENT_TOO_HIGH – dark_current > MAXIMUM_DARK_CURRENT INCONSISTENT_EVENT_COUNTS – event_counts[i]-event_counts[j] too large

The difference in event counts is too large if they exceed 5 sigma .i.e.: abs(counts[i]-counts[j]) > 5 * sqrt(counts[i]+counts[j])

exception astro.main.DarkCurrent.DarkCurrentError(message)

Bases: common.log.Error.Error

class astro.main.DarkCurrent.DarkCurrentParameters

Bases: common.database.DBMain.DBObject

Processing parameters for DarkCurrent objects

DETECTION_THRESHOLD

The detection threshold for cosmic ray events [None]

EVENT_COUNTS_THRESHOLD

QC: The maximum deviation of event counts in units of standard deviations [None]

MAXIMUM_DARK_CURRENT

QC: The maximum dark current [ADU / pixel / hour]

MAXIMUM_DARK_CURRENT_DIFFERENCE

QC: Maximum difference of dark_current w.r.t previous DarkCurrent object [None]

MAXIMUM_ITERATIONS

The maximum number of iterations [None]

OVERSCAN_CORRECTION

Overscan correction method index [None]

REJECTION_THRESHOLD

The threshold rejecting outlying pixels [None]

SOURCE_CODE_VERSION

The version of the source code [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

astro.main.DiaConfig module

class astro.main.DiaConfig.DiaAgaConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

BAD_GROWRAD1

[None]

BAD_GROWRAD2

[None]

BAD_VALUE

[None]

BKG_DEG

[None]

DEG_1

[None]

DEG_INC

[None]

DOMAIN_MODE

[None]

DOM_HW

[None]

DOM_THRESH

[None]

GAIN

[None]

KER_HW

[None]

MAX_CHI2

[None]

MAX_NITER

[None]

MIN_AREA

[None]

MIN_AREA_DOM

[None]

MIN_LEVEL

[None]

MIN_NKEEP

[None]

MOHW

[None]

NDOM_X

[None]

NDOM_Y

[None]

NX

[None]

NX_0

[None]

NY

[None]

NY_0

[None]

N_COMP

[None]

N_ITER_DOM

[None]

N_SIG

[None]

N_SIG_DOM

[None]

SAT_LEVEL

[None]

SIG_GAUSS_1

[None]

SIG_GAUSS_INC

[None]

VERBOSE

[None]

WDEG_SPATIAL

[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

program_name = 'DIA.AGA'
class astro.main.DiaConfig.DiaGetpsfConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

ANRAD1

[None]

ANRAD2

[None]

APRAD

[None]

BKG_FRAC

[None]

CONTRAST

[None]

FITRAD

[None]

GAIN

[None]

ISOHW

[None]

ISO_OFF

[None]

ISO_SLO

[None]

MAXHW

[None]

MAX_THRESH

[None]

MIN_FLUX

[None]

MIN_LEVEL

[None]

MIN_NBOX

[None]

NBOX_X

[None]

NBOX_Y

[None]

NDEG_LOCAL

[None]

NDEG_SPAT

[None]

NGAUSS

[None]

NITER

[None]

NITER_INIT

[None]

NOBJ_INIT

[None]

NPSF_MAX

[None]

NSIG_CLIP

[None]

NSIG_DETECT

[None]

NSIG_RAT

[None]

PEAKHW

[None]

PSFHW

[None]

PSF_AX

[None]

PSF_AY

[None]

PSF_COS

[None]

PSF_SIN

[None]

RAT_THRESH

[None]

RECENTER

[None]

SAT_LEVEL

[None]

SIGMA_INC

[None]

SIGMA_MSCALE

[None]

VERBOSE

[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

program_name = 'DIA.GetPSF'
class astro.main.DiaConfig.DiaGetvarConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

ANRAD1

[None]

ANRAD2

[None]

APRAD

[None]

BAD_MARGIN

[None]

BAD_VALUE

[None]

BKG_MODE

[None]

CENTER_HW

[None]

C_MIN

[None]

ERR_CODE

[None]

EXPTIME

[None]

FILTER_HW

[None]

FITRAD

[None]

FWHM_FRAC

[None]

GAIN

[None]

ID_RAD

[None]

ISOHW

[None]

ISO_OFF

[None]

ISO_SLO

[None]

LIM_RATIO

[None]

MIN_LEVEL

[None]

MOHW

[None]

NCONS_VAR1

[None]

NOBJ_INIT

[None]

NORMRAD

[None]

NPTS_VAR2

[None]

NSIG_BKG

[None]

NSIG_VAR1

[None]

NSIG_VAR2

[None]

SAT_LEVEL

[None]

SMHW

[None]

TMP_FILE

[None]

VERBOSE

[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

program_name = 'DIA.GetVar'
class astro.main.DiaConfig.DiaMstackConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

BAD_VALUE

[None]

HIST_HIGH

[None]

HIST_LOW

[None]

HIST_NBIN

[None]

MAX_SCALE

[None]

MEDIAN

[None]

MIN_LEVEL

[None]

MIN_NGOOD

[None]

MIN_SCALE

[None]

NBIN_SMOOTH

[None]

NSIG

[None]

NX0

[None]

NY

[None]

NY0

[None]

SAT_LEVEL

[None]

THRESHOLD

[None]

VERBOSE

[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

program_name = 'DIA.MStack'
class astro.main.DiaConfig.DiaPhotConfig(filename=None, tmpbase='')

Bases: common.main.Config.Config

ANRAD1

[None]

ANRAD2

[None]

APRAD

[None]

BAD_VALUE

[None]

BKG_MODE

[None]

ERR_CODE

[None]

EXPTIME

[None]

FITRAD

[None]

GAIN

[None]

MIN_LEVEL

[None]

NORMRAD

[None]

NSIG_BKG

[None]

READ_NOISE

[None]

SAT_LEVEL

[None]

VERBOSE

[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

program_name = 'DIA.Phot'
astro.main.DiaConfig.create_config(config_key, filename=None, class_defaults={})

Factory function for configurations.

All configurations should be created from here.

config_key: key corresponding to a particular Config class (see
config_dict)

filename: optional filename the configuration can be written to

class_defaults: dictionary of {parameter_name: parameter_value, …}

astro.main.DomeFlatFrame module

dome flat (req542), master dome flats

class astro.main.DomeFlatFrame.DomeFlatFrame(pathname='')

Bases: astro.main.BaseFlatFrame.BaseFlatFrame

Class for master domeflat images.

DOME_SUBWIN_DIFF_TOO_LARGE
DOME_SUBWIN_FLATNESS_TOO_LARGE
DataSize = '-32'
EXPTIME = 1
ImgType = <astro.util.xsdsupport.ImgType object>
NAXIS1

Length of data in axis 1 [pixel]

NAXIS2

Length of data in axis 2 [pixel]

PROCESS_TIME = 35
bias

The BiasFrame used to bias-correct the raw frames [None]

check_preconditions()
chip

Information about the chip [None]

cold

A ColdPixelMap object [None]

compare()

Compare the dome flat with a previous version.

copy_attributes()
creation_date

Date this object was created [None]

derive_timestamp()

Assign the default period for which this calibration frame is valid.

For a DomeFlatFrame the this period start three days before a night of observing until three days after. Note that the default period for which a DomeFlatFrame is valid is linked to observing frequency, which is described in the OmegaCAM URD and Calibration Plan.

filename

The name of the associated file [None]

filter

Information about the filter [None]

gain

A GainLinearity object [None]

get_canonical_name()

Generate the unique filename for this DomeFlatFrame.

globalname

The name used to store and retrieve file to and from Storage [None]

hot

A HotPixelMap object [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]

make()

Make a master domeflat frame.

Requires:
raw_domeflat_frames – A list of RawDomeFlat objects bias – A BiasFrame object gain – A GainLinearity object
Optional:
hot – A HotPixelMap object cold – A ColdPixelMap object

The raw dome flats are trimmed and overscan corrected. The data are then normalized, averaged, and the result is normalized again. Image statisics are computed for the resulting frame.

make_image()

Make a master domeflat image.

Requires:
raw_domeflat_frames – A list of RawDomeFlat objects bias – A BiasFrame object gain – A GainLinearity object
Optional:
hot – A HotPixelMap object cold – A ColdPixelMap object

This procedure will trim and debias the raw dome flat frames, normalize these frames, and average them.

mandatory_dependencies = (('raw_domeflat_frames', 3), ('gain', 1))
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]

prev = None
process_params

Processing parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

raw_domeflat_frames

The list RawDomeFlatFrame objects [None]

template

Information about the template [None]

timestamp_end

End of valid period [None]

timestamp_start

Start of valid period [None]

update_header()

Update a header with values from descriptors.

verify()

Verify the dome.

exception astro.main.DomeFlatFrame.DomeFlatFrameError(message)

Bases: common.log.Error.Error

class astro.main.DomeFlatFrame.DomeFlatFrameParameters

Bases: common.database.DBMain.DBObject

The parameters used in DomeFlatFrame processing.

MAXIMUM_SUBWIN_DIFF

QC: Maximum difference with respect to the previous threshold [None]

MAXIMUM_SUBWIN_FLATNESS

QC: Flatness threshold (maximum difference between subwindows) [None]

OVERSCAN_CORRECTION

Overscan correction method index [None]

SIGMA_CLIP

Sigma clipping threshold factor [None]

SOURCE_CODE_VERSION

The version of the source code [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

astro.main.EMCMap module

maps of rows affected by ElectroMagnetic Compatibility (EMC) noise

class astro.main.EMCMap.EMCMap(pathname='')

Bases: object

check_preconditions()
check_preconditions_for_loading()
chip = None
compare()
copy_attributes()
cosmic = None
count = 0
exists()

Test is the file existsts

filter = None
get_canonical_name()

Generate the unique filename for this SaturatedPixelMap.

instrument = None
load_map()

Load the pixelmap from a compressed file.

make()
make_pixelmap()

The central algorithm

mandatory_dependencies = (('cosmic', 1),)
process_params = None
raw = None
read_data_and_remove_uncompressed_file()
save_map()

This method saves the pixelmap data and compresses the file.

uncompress_pixelmap_data()
update_count()

Get the count of bad pixels.

verify()
class astro.main.EMCMap.EMCMapParameters

Bases: object

Parameters for processing EMCMap objects

MAX_COSMICS_PER_ROW = 50
astro.main.EMCMap.main()

astro.main.ESOIDAttributeCalculator module

ESO_ID Calculator

class astro.main.ESOIDAttributeCalculator.AttributeCalculator(sourcelist_data=None)

Bases: astro.main.sourcecollection.AttributeCalculator.AttributeCalculator

The ESO_ID AttributeCalculator derives a unique identifier for a source based on its RA and DEC in hms/dms. These are used for the ESO deliveries of KIDS.

The ‘precision’ parameter determines the number of decimals after the floating point of the (arc)seconds. Values can be 1 or 2.

The ESO-DR2 IDs had a precision of 2, but with the last 0 stripped. These IDs can be emulated by setting precision > 100.

The followings ESO_IDs are generated for

(RA, DEC) = (138.53459936889399, 0.0299497513295548):

precision ESO_ID 1 ‘KIDS J091408.3+000147.8’ 2 ‘KIDS J091408.30+000147.82’ 9000 ‘KIDS J091408.3+000147.82’

SCID

SourceCollection identifier [None]

acd_attributes = [{'null': '', 'length': 25, 'format': 'str', 'name': 'ESO_ID', 'ucd': ''}]
acd_input_attribute_names = ['RA', 'DEC']
acd_name = 'ESOIDAttributeCalculatorDefinition'
acd_parameters = [{'value': 2, 'format': 'int', 'name': 'precision', 'description': 'Digits behind comma for (arc)seconds.'}]
all_data_stored

Flag to indicate whether all data has been stored in sourcelist_data, 0 means no (or unknown), 1 means yes

attribute_columns

Column names of the attributes in the sourcelist_data

attribute_names

Names of the attributes corresponding to the attribute_columns

calculate_attributes(RA, DEC, precision)
creation_date

Date this object was created [None]

definition

The Definition of this AttributeCalculator instance.

get_attribute_names(cache=False)
get_attribute_names_nc(cache=False)

Returns the names of the attributes.

get_attributes(cache=False)
get_attributes_full(cache=False)
get_attributes_full_nc(cache=False)

Returns a TableConverter like attribute list with extra keys.

Should only be used by SourceCollection functions. Other classes and awe-prompt users should use get_attributes().

This function should be overloaded by the derived classes. The version in this base class is essentially the variant of the External.

get_attributes_nc(cache=False)

Returns a list of dictionaries with meta data about the attributes.

Keys of the dictionaries:
  • name: The name (and identifier) of the attribute.
  • format: A format string that can be used by numpy.dtype()
  • ucd: Unified Content Descriptor (not always filled properly)
  • null: A null value, usually numpy.nan (not always present)
  • length: The length for multi length cells, only used for strings.

The dictionaries have the same structure as those used in the TableConverter class.

TODO LT L: [NOCAT] Use ‘ucd’ and ‘null’ properly.

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make(optimize=True)

New make() function that works with old ACDs for which the original make() function does not accept the optimize keyword.

E.g. ACD 100031 for calculating comoving distances.

make_nc(optimize=True)

This is a virtual make() method for an AttributeCalculator instance.

The AttributeCalculatorDefinition should provide either: - an entire make() function - a calculate_attributes() or calculate_attributes_vector() function.

The default make() of the AttributeCalculator is a wrapper around the calculate_attributes_vector() function.

name

Name of the SourceCollection [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

parent_collection

Parent SourceCollections [None].

process_parameters

Process parameters

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

sourcelist_data

Optional SourceList containing the data described by this SourceCollection

sourcelist_sources

Optional SourceList containing the sources described by this SourceCollection

astro.main.ESOIDAttributeCalculator.ESOIDAttributeCalculator

alias of astro.main.ESOIDAttributeCalculator.AttributeCalculator

astro.main.ESOIDAttributeCalculator.deg2arc_dec(dec)

Convert dec in degrees to degrees,minutes,seconds.

astro.main.ESOIDAttributeCalculator.deg2arc_ra(ra)

Convert ra in degrees to hour,minute,second.

astro.main.ExtinctionAttributeCalculator module

Calculates galactic extinction.

class astro.main.ExtinctionAttributeCalculator.AttributeCalculator(sourcelist_data=None)

Bases: astro.main.sourcecollection.AttributeCalculator.AttributeCalculator

Calculate galactic extinction.

SCID

SourceCollection identifier [None]

acd_attributes = [{'null': None, 'length': 1, 'format': 'float32', 'name': 'EXTINCTION_u', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'EXTINCTION_g', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'EXTINCTION_r', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'EXTINCTION_i', 'ucd': ''}]
acd_input_attribute_names = ['RA', 'DEC']
acd_name = 'Galactic Extinction'
acd_parameters = []
all_data_stored

Flag to indicate whether all data has been stored in sourcelist_data, 0 means no (or unknown), 1 means yes

attribute_columns

Column names of the attributes in the sourcelist_data

attribute_names

Names of the attributes corresponding to the attribute_columns

calculate_attributes_vector(RA, DEC)
creation_date

Date this object was created [None]

definition

The Definition of this AttributeCalculator instance.

get_attribute_names(cache=False)
get_attribute_names_nc(cache=False)

Returns the names of the attributes.

get_attributes(cache=False)
get_attributes_full(cache=False)
get_attributes_full_nc(cache=False)

Returns a TableConverter like attribute list with extra keys.

Should only be used by SourceCollection functions. Other classes and awe-prompt users should use get_attributes().

This function should be overloaded by the derived classes. The version in this base class is essentially the variant of the External.

get_attributes_nc(cache=False)

Returns a list of dictionaries with meta data about the attributes.

Keys of the dictionaries:
  • name: The name (and identifier) of the attribute.
  • format: A format string that can be used by numpy.dtype()
  • ucd: Unified Content Descriptor (not always filled properly)
  • null: A null value, usually numpy.nan (not always present)
  • length: The length for multi length cells, only used for strings.

The dictionaries have the same structure as those used in the TableConverter class.

TODO LT L: [NOCAT] Use ‘ucd’ and ‘null’ properly.

is_valid

Manual/external flag to disqualify bad data (SuperFlag) [None]

make(optimize=True)

New make() function that works with old ACDs for which the original make() function does not accept the optimize keyword.

E.g. ACD 100031 for calculating comoving distances.

make_nc(optimize=True)

This is a virtual make() method for an AttributeCalculator instance.

The AttributeCalculatorDefinition should provide either: - an entire make() function - a calculate_attributes() or calculate_attributes_vector() function.

The default make() of the AttributeCalculator is a wrapper around the calculate_attributes_vector() function.

name

Name of the SourceCollection [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

parent_collection

Parent SourceCollections [None].

process_parameters

Process parameters

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

sourcelist_data

Optional SourceList containing the data described by this SourceCollection

sourcelist_sources

Optional SourceList containing the sources described by this SourceCollection

astro.main.ExtinctionAttributeCalculator.ExtinctionAttributeCalculator

alias of astro.main.ExtinctionAttributeCalculator.AttributeCalculator

astro.main.Filter module

class used to identify the filter

class astro.main.Filter.Filter(name='', **kw)

Bases: common.database.DBMain.DBObject

This class is used to identify the filter.

Reference = 'NOT SUPPLIED'
central_wavelength

Center wavelength of the photometric band [angstrom]

get_central_wavelength()
has_fringes

Frames in this photometric band may contain fringes [None]

mag_id

Identifier for the photometric band [None]

name

Identifier for the filter [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

update_header(header)

astro.main.FringeFrame module

fringe images (req545)

This module contains class definitions for FringeFrameParameters and FringeFrame.

FringeFrameParameters is a class with parameters that are used, e.g., in trend analysis.

FringeFrame is the class that defines fringe maps (cal545).

class astro.main.FringeFrame.FringeFrame(pathname='')

Bases: astro.main.BaseFrame.BaseFrame

Class for fringe frames.

NAXIS1

Length of data in axis 1 [pixel]

NAXIS2

Length of data in axis 2 [pixel]

PROCESS_TIME = 20
bias

A BiasFrame object [None]

check_preconditions()
chip

Information about the chip [None]

clean_up()

This methods deletes intermediate products from memory (like trimmed versions of raw frames) that may cause problems when the image is made a second time.

cold

A ColdPixelMap object [None]

compare()

Compare the results with a previous version. TBD.

copy_attributes()
creation_date

Date this object was created [None]

derive_timestamp()

Assign the default period for which this calibration frame is valid.

filename

The name of the associated file [None]

filter

Information about the filter [None]

flat

A BaseFlatFrame object [None]

get_canonical_name()

Generate the unique filename for this FringeFrame.

globalname

The name used to store and retrieve file to and from Storage [None]

hot

A HotPixelMap object [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]

make()

Make a fringe frame

Requires:
raw_science_frames – A list of RawScienceFrame objects bias – A BiasFrame object flat – A BaseFlatFrame object
Optional:
hot – A HotPixelMap object cold – A ColdPixelMap object
make_image()

Make a fringe flat image by taking a set of science images, trim, debias and flat-field them, normalize and stack the images, then median average over the depth of the cube.

Requires:
raw_science_frames – A list of RawScienceFrame objects bias – A BiasFrame object flat – A BaseFlatFrame object
Optional:
hot – A HotPixelMap object cold – A ColdPixelMap object
mandatory_dependencies = (('raw_science_frames', 3), ('bias', 1), ('flat', 1))
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

classmethod onthefly_processable(attributes, config)

Whether FringeFrame is OnTheFly processable depends on the filter

prev = None
process_params

Processing Parameters [None]

process_status

A flag indicating the processing status [None]

quality_flags

Automatic/internal quality flag [None]

raw_science_frames

The list of RawScienceFrame objects [None]

timestamp_end

End of valid period [None]

timestamp_start

Start of valid period [None]

update_header()

Update a header with values from descriptors.

verify()

Verify the results. TBD.

exception astro.main.FringeFrame.FringeFrameError(message)

Bases: common.log.Error.Error

class astro.main.FringeFrame.FringeFrameParameters

Bases: common.database.DBMain.DBObject

OVERSCAN_CORRECTION

Overscan correction method index [None]

SOURCE_CODE_VERSION

The version of the source code [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

astro.main.GAstrometric module

defines the class for the Global Astrometric Solution

class astro.main.GAstrometric.GAstrometric(sourcelists=[], gasslist_name='', catprefix='ccd', pars={}, engine='scamp', globalphot=False)

Bases: common.database.DBMain.DBObject

This class will perform a global astrometric solution on a set of multiple exposures from a similar area of the sky, such as a dither pattern.

It is presumed that a series of source lists have been stored as persistent objects in the database.

For administrative purposes this class needs a list of these source list names and their associated logical dither pattern code and chip number. So a typical list would consist out of N dither x M chips tuples, where each tuple consists out of three elements: SourceList, Dither sequence number starting with 1 and chip sequence number starting with 1

To make a global astrometric solution one has to provide the class with a SourceList list and a unique association list name. So instantiation and creation would be:

GAS = GAstrometric(SourceLists, “Dither1”) GAS.make()

To later retrieve the global astrometric solution and build astrometrically corrected images one just has to provide the association list name and load the correct global astrometric parameters like:

GAS = GAstrometric(gasslist_name = “Dither1”) GAS.get_astrom(SourceListName)
MEAN_DDEC

Average residual w.r.t. reference catalog: DEC [arcsec]

MEAN_DDEC_OVERLAP

Average residual w.r.t. overlap positions: DEC [arcsec]

MEAN_DRA

Average residual w.r.t. reference catalog: RA [arcsec]

MEAN_DRA_OVERLAP

Average residual w.r.t. overlap positions: RA [arcsec]

NREF

Number of matched pairs of reference stars [None]

N_OVERLAP

Number of matched pairs of overlapping stars [None]

PROCESS_TIME = 20
RMS

Two-dimensional Root-Mean-Square (RMS) of the RA/DEC residuals [arcsec]

RMS_OVERLAP

Two-dimensional Root-Mean-Square (RMS) of the RA/DEC overlap residuals [arcsec]

SIG_DDEC

Standard deviation of DEC residuals [arcsec]

SIG_DDEC_OVERLAP

Standard deviation of DEC residuals [arcsec]

SIG_DRA

Standard deviation of RA residuals [arcsec]

SIG_DRA_OVERLAP

Standard deviation of RA residuals [arcsec]

astromconf

The astrom configuration [None]

check_preconditions()
commit()
compare()

The compare of the individual APs are used.

copy_attributes()
creation_date

Date this object was created [None]

derive_astrometric_parameters()
derive_global_statistics()

Derive and populate statistics properties from residuals catalog

derive_timestamp()
filter

Information about the filter [None]

gasslist

Global AStrometry AssociateList object [None]

get_astrometric_parameters()
get_canonical_name()

Generate the unique filename for this AssociateList.

get_canonical_name_for_residuals()

Generate the unique filename for the associated residuals file.

get_canonical_name_for_scamp_residuals()

Generate the unique filename for the associated residuals file.

get_default_config()

Return the fixed astrom configuration parameters.

get_local_solution(reduced)

This accessor is used to retrieve that part of the astrometric solution that belongs to the input ReducedScienceFrame object.

get_refcat_location()

Return the name of the reference catalog created from the SourceList self.refsl.

has_inspect_figures = True
inspect(kappa=3.0, range=None, domain=None, verbose=2, plot_all=False, extension='png', interactive=True)

Inspect method for GAstrometric

kappa: clipping factor for plot data (iterative clipping at
kappa*sigma of DRA/DDEC level)
range: a tuple defining (xmin, xmax) of DRA, overriding
automatic width determination (does not affect RA, DEC, Xpos, Ypos)
domain: a tuple defining (ymin, ymax) of DDEC, overriding
automatic height determination (does not affect RA, DEC, Xpos, Ypos)

verbose: set the verbosity of the plotting routines

plot_all: plot all individual chip plots in addition to the
summary plots
extension: extension of the filetype to save inspection
figures to
interactive: when False, creates inspection plot(s) to be
stored on the dataserver for later retrieval

Plots DRA (delta RA) versus DDEC (delta DEC) residuals; DRA versus RA and XPOS (x position); and DDEC versus DEC and YPOS (y position) for all reference residuals and all overlap residuals. By default, all plots are saved as PNG (.png) for later inspection. To change this behavior, set plot_params.EXTENSION to another format (.ps, .eps, etc.) or to None to save nothing.

See the AstromResidualsPlot, GAstromResidualsPlot, AllGAstromResidualsPlot, GAstromOverlapPlot, and AllGAstromOverlapPlot classes for more detailed information. For example:

awe> from astro.plot.AstrometryPlot import GAstromResidualsPlot awe> help(GAstromResidualsPlot)

instrument

Information about the instrument [None]

make()

Perform a global astrometric solution with SCAMP/LDAC using telscope/local solution inputs.

make_associate()

Perform the actual association of the lists

make_global_astrom()

Extract association information from the database (SourceLists combined by Chip, pairs catalog from association), write these to catalog files (LDAC FITS), run astrometry on these catalogs with LDAC, and apply distortion information to catalogs to bring the final result to proper WCS parameters.

make_global_scamp_model()
make_inspect_figures(extension='png')

Create inspection figures for this global astrometric solution.

extension: extension of the filetype to save inspection
figures to
make_residuals_catalog()

Create a FITS table containing the residuals from the catalog generated by the astrometry routines.

make_scamp_model()
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]

organize_sourcelists()
process_params

Processing parameters [None]

residuals

Filename of residuals catalog [None]

scampconf

The SCAMP configuration [None]

set_config()

Set configuration objects

set_gasslist_name()
set_local_solution_map()

A direct mapping is made between a given ReducedScienceFrame object and its own part of the astrometric solution. This map will have to evolve into the actual persistent content of the GAstrometric object itself.

set_process_parameters_from_dict(pars={})

pars is a dictionary of the type e.g.: {‘BiasFrame.process_params.SIGMA_CLIP’:8}

set_refcat()
template

Information about the template [None]

update_default_config()

Update the astromconf with the fixed configuration parameters.

verify()

The verify of the individual APs are used.

verify_residuals()

Verify whether the GAstrometric Solution is better than the individual solution (i.e. per ScienceFrame).

exception astro.main.GAstrometric.GAstrometricError(message)

Bases: common.log.Error.Error

class astro.main.GAstrometric.GAstrometricParameters

Bases: common.database.DBMain.DBObject

Processing parameters for GAstrometric

Procecessing parameters determine how the object is to be created and the quality control (QC) limits for the newly created object.

REFCAT

Name of astrometric reference catalog (filename, URL, or SourceList.name) [None]

SOURCE_CODE_VERSION

The version of the source code [None]

object_id

The object identifier

The object identifier is an attribute shared by all persistent instances. It is the prime key, by which object identity is established

astro.main.GaAPAttributeCalculator module

AttributeCalculator that runs the Gaussian aperture and PSF (GaaP) code.

See Konrad Kuijken, Astronomy and Astrophysics, Volume 482, Issue 3, 2008, pp.1053-1067

http://adsabs.harvard.edu/abs/2008A%26A…482.1053K http://arxiv.org/abs/astro-ph/0610606

class astro.main.GaAPAttributeCalculator.AttributeCalculator(sourcelist_data=None)

Bases: astro.main.sourcecollection.AttributeCalculator.AttributeCalculator

SCID

SourceCollection identifier [None]

acd_attributes = [{'null': None, 'length': 1, 'format': 'float32', 'name': 'A_GAAP', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'B_GAAP', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'PA_GAAP', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'int64', 'name': 'FLAG_GAAP', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'FLUX_GAAP', 'ucd': ''}, {'null': None, 'length': 1, 'format': 'float32', 'name': 'FLUXERR_GAAP', 'ucd': ''}]
acd_input_attribute_names = ['RA', 'DEC', 'A_WORLD', 'B_WORLD', 'THETA_WORLD']
acd_name = 'CVS based GAaPAttributeCalculatorDefinition'
acd_parameters = [{'value': None, 'format': 'GaussianizedFrame', 'name': 'gauss', 'description': 'A Gaussianized frame'}, {'value': None, 'format': 'WeightFrame', 'name': 'weight', 'description': 'A weight frame'}, {'value': None, 'format': 'GaussianizedFrameKernelMap', 'name': 'kermap', 'description': 'A kernelmap?'}, {'value': 0.7, 'format': 'float', 'name': 'MIN_APER', 'description': 'Minimum aperture size [arcsec] (added in quadrature to source size)'}, {'value': 2.0, 'format': 'float', 'name': 'MAX_APER', 'description': 'Maximum aperture size [arcsec]'}]
all_data_stored

Flag to indicate whether all data has been stored in sourcelist_data, 0 means no (or unknown), 1 means yes

attribute_columns

Column names of the attributes in the sourcelist_data

attribute_names

Names of the attributes corresponding to the attribute_columns

calculate_attributes_vector(gauss, weight, kermap, MIN_APER, MAX_APER, RA, DEC, A_WORLD, B_WORLD, THETA_WORLD)

Replicate the first part of the gaap.csh script, up to the creation of the kernel ACF map.

  1. Select columns X_WORLD Y_WORLD MAG_AUTO MAGERR_AUTO FLUX_RADIUS A_WORLD B_WORLD Theta SeqNr from the input catalog
  2. Convert RA, DEC to X,Y in the image we’re considering
  3. Convert A_WORLD, B_WORLD to different format
  4. Make input catalogue for Gaap photometry: needs X,Y,A”,B”,PAworld,ID
creation_date

Date this object was created [None]

definition

The Definition of this AttributeCalculator instance.

get_attribute_names(cache=False)
get_attribute_names_nc(cache=False)

Returns the names of the attributes.

get_attributes(cache=False)
get_attributes_full(cache=False)
get_attributes_full_nc(cache=False)

Returns a TableConverter like attribute list with extra keys.

Should only be used by SourceCollection functions. Other classes and awe-prompt users should use get_attributes().

This function should be overloaded by the derived classes. The version in this base class is essentially the variant of the External.

get_attributes_nc(cache=False)

Returns a list of dictionaries with meta data about the attributes.

Keys of the dictionaries:
  • name: The name (and identifier) of the attribute.
  • format: A format string that can be used by numpy.dtype()
  • ucd: Unified Content Descriptor (not always filled properly)
  • null: A null value, usually numpy.nan (not always present)
  • length: The length for multi length cells, only used for strings.

The dictionaries have the same structure as those used in the TableConverter class.

TODO LT L: [NOCAT] Use ‘ucd’ and ‘null’ properly.