| Home | Trees | Indices | Help |
|
|---|
|
|
buildasn.py - Module to generate an ACS-style association
table from all matching files from the current working directory.
This module will also recognize shiftfiles should they be specified
and add the offsets to the ASN table.
W.J. Hack 9 April 2001
*** INITIAL VERSION
W.J Hack 24 April 2001
Version 0.1b - Modified to support FITS version 0.4.2
W.J Hack, 1 May 2001
Version 0.2 - Computes delta from given shifts file and header info
WJH, 20 Nov 2001:
Version 0.3 - Added ROTATION column to default ASN table created.
WJH, 4 Dec 2001:
Added help() function and printing of Version number.
WJH, 21 Jan 2002:
Fixed bugs in writing out ASN table with default columns.
Also added check to insure that files are found to build ASN table.
WJH, 8 Mar 2002:
Added MEMPRSNT column and converted to use PyFITS v0.6.2 and numarray.
WJH, 12 June 2002 (0.5a):
Changed 'pyfits.version' to 'pyfits.__version__' to keep up with PyFITS.
WJH, 20 Aug 2002 (0.6):
Revised interface to accept wild-card specification and @files as well
as filename partial (such as 'crj' or '440w').
WJH, 3 Dec 2002 (0.6a):
Simplified interface to 'readShiftFile' for use with 'updateasn'; it now
returns a dictionary without requiring it be pre-defined.
WJH, 3 Dec 2002 (0.6b):
Blank lines in shiftfiles will now work.
WJH, 11 Apr 2003 (0.7):
Support new shiftfile convention, as well as optional SCALE column.
WJH, 3 Jun 2003 (0.7a):
Added logic to ignore blank lines in shift file.
WJH, 25 Aug 2003 (0.8)
Updated to support numarray 0.6 using the new format letter codes.
CJH, 13 Jul 2004 (0.9)
Updated to support input of simple python list as linename input.
CJH, 02 Aug 2004 (0.9a)
Added support to find files for having 2 columns of filenames in an @inputlist
file. This is used by Multidrizzle to implement the use of IVM files.
WJH/CJH, 28 Sept 2004 (0.9.2)
Added support to findFiles for comma separated string input. Also corrected
a bug in the processing of @files in which rstrip() was not being applied to
the filenames leaving a trailing newline character.
WJH, 15 Nov 2004 (0.9.3)
Moved 'readShiftFile' to 'fileutil.py' so it would not need to import
'buildasn'. Instead, we use 'from fileutil import readShiftFile' here
WJH, 20 Dec 2004 (0.9.4)
Added 'writeAsnDict' to output the ASN table dictionary read in using
'readAsnTable' to a file.
WJH, 11 May 2005 (0.9.5)
Modified to append reference WCS extension if given in shiftfile.
WJH, 28 June 2005 (0.9.5a)
New 'order' keyword in dictionary from reading the shift file now used
to index files.
Version: 0.9.5a (28-June-2005)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
EXTLIST = ['_crj.fits', '_flt.fits', '_sfl.fits', '_cal.fits',
|
|||
TABLE_DATA = {'units': None, 'frame': None, 'xsh': None, 'ysh'
|
|||
_prihdr = pyfits.Header([pyfits.Card('SIMPLE', pyfits.TRUE, 'F
|
|||
Imports: os, re, types, copy, time, pyfits, N, readShiftFile, buildRootname, wcsutil
|
|||
Create an association table from all specified files in
the current directory. By default, it will include all 'crj' files.
The user may also specify their own list of files in different ways:
as a file with a list of filenames using '@filename'
using wild card specification of filenames, e.g. '*02t?q_flt* or '*f440w*'
using part of a filename; such as 'f440w' or 'flt' or 'sfl'
using a simple python list.
It would also add the columns XOFFSET, YOFFSET and ROTATION
and populate them with values from a shiftfile if one was specified
and can be read.
This function returns the name of the DITHER PRODUCT that was
created, then inserted into the ASN table. It will be
the rootname of asnroot with '_drz' appended, following the
general ACS pipeline filename conventions.
|
Builds list of all files which contain suffix. If a simple python list is supplied it will already be the list of files needed to build the ASN table. |
Safely updates keyword key in outhdr from value in inhdr. Uses value given by 'default' if keyword is not found in input header. |
Function which identifies the image from an association which serves as the reference, zero-offset position. It simply returns the filename for the image with the smallest total shift. |
Function which subtracts commanded offsets from headers from total offsets found in sdict. Commanded offsets will always be relative to ref_file. <<OBSOLETE>> |
Build rootname for a new file. Use 'extn' for new filename if given, otherwise does NOT append a suffix at all. Search for suffix if given. Does NOT check to see if it exists already. Will ALWAYS return a new filename. |
Creates complete Primary header for ASN table based on template. 'fasn' is the file handle of the newly opened ASN table file. Uses keyword values from 'img1' to update ASN header keywords. |
writeAsnDict:
=============
Write out a new ASN table using a dictionary in memory.
The input dictionary should be read in using 'readAsnTable',
and can be modified as needed before writing out the new table.
SYNTAX:
buildasn.writeAsnDict(asndict,output=None)
PARAMETERS:
asndict: dictionary from 'readAsnTable
output: rootname or filename for output ASN file
if output == None (default), product name from asndict will be
used to define the output filename for the table.
|
|
|||
EXTLIST
|
TABLE_DATA
|
_prihdr
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Feb 18 14:40:40 2008 | http://epydoc.sourceforge.net |