The functions in this module manage alternate WCS’s in a header.
Copy the primary WCS to the header as an alternate WCS with wcskey and name WCSNAME. It loops over all extensions in ‘ext’
Parameters : | |
---|---|
fname: string or pyfits.HDUList :
ext: an int, a tuple, string, or list of integers or tuples (e.g.(‘sci’,1)) :
wcskey: string “A”-“Z” or ” “ :
wcsname: string :
reusekey: boolean :
|
See also
Examples
Copy the primary WCS of an in memory headrlet object to an alternate WCS with key ‘T’
>>> hlet=headerlet.createHeaderlet('junk.fits', 'hdr1.fits')
>>> altwcs.wcskeys(hlet[1].header)
['A']
>>> altwcs.archiveWCS(hlet, ext=[('SIPWCS',1),('SIPWCS',2)], wcskey='T')
>>> altwcs.wcskeys(hlet[1].header)
['A', 'T']
Copy a WCS with key “WCSKEY” to the primary WCS
Reads in a WCS defined with wcskey and saves it as the primary WCS. Goes sequentially through the list of extensions in ext. Alternatively uses ‘fromext’ and ‘toext’.
Parameters : | |
---|---|
f: string or pyfits.HDUList object :
ext: an int, a tuple, string, or list of integers or tuples (e.g.(‘sci’,1)) :
wcskey: a charater :
wcsname: string (optional) :
|
See also
archiveWCS, restore_from_to
Delete an alternate WCS defined with wcskey. If wcskey is ” ” try to get a key from WCSNAME.
Parameters : | |
---|---|
fname: sting or a pyfits.HDUList object : ext: an int, a tuple, string, or list of integers or tuples (e.g.(‘sci’,1)) :
wcskey: one of ‘A’-‘Z’ or ” “ : wcsname: string :
|
Returns a dictionary of wcskey: WCSNAME pairs
Parameters : | |
---|---|
fobj: string, pyfits.HDUList or pyfits.Header :
ext: int or None :
|
Returns a list of characters used in the header for alternate WCS description with WCSNAME keyword
Parameters : | |
---|---|
fobj: string, pyfits.HDUList or pyfits.Header :
ext: int or None :
|
Returns a list of characters which are not used in the header with WCSNAME keyword. Any of them can be used to save a new WCS.
Parameters : | |
---|---|
fobj: string, pyfits.HDUList or pyfits.Header :
ext: int or None :
|
Returns next available character to be used for an alternate WCS
Parameters : | |
---|---|
fobj: string, pyfits.HDUList or pyfits.Header :
ext: int or None :
|
If WCSNAME is found in header, return its key, else return None. This is used to update an alternate WCS repeatedly and not generate new keys every time.
Parameters : | |
---|---|
header: pyfits.Header : wcsname: str :
|