Updatenpol
updatenpol:
Update the header of ACS file(s) with the names of new
``NPOLFILE`` and ``D2IMFILE`` reference files for use with the
AstroDrizzle.
- Authors:
Warren Hack
- License:
- drizzlepac.updatenpol.find_d2ifile(flist, detector)[source]
Search a list of files for one that matches the detector specified.
- drizzlepac.updatenpol.find_npolfile(flist, detector, filters)[source]
Search a list of files for one that matches the configuration of detector and filters used.
- drizzlepac.updatenpol.main()[source]
This task can be run from the operating system command line with:
updatenpol [options] input [refdir]
- Parameters:
- inputstr
The specification of the files to be updated, either as a single filename, an ASN table name, or wild-card specification of a list of files.
- refdirstr
The name of the directory containing all the new reference files (
*_npl.fitsand*_d2i.fitsfiles). If no directory is given, it will look injref$by default.- ``-h``
Print the help (this text).
- ``-l``
If specified, copy NPOLFILEs and D2IMFILEs to local directory for use with the input files.
- ``-i``
If specified, the program will interactively request the exact names of the
NPOLFILEandD2IMFILEreference files to be used for updating the header of each file. The value of ‘refdir’ will be ignored in interactive mode.- .. warning::
It will ask for the names of the
NPOLFILEandD2IMFILEfor EACH separate INPUT file when the option-ihas been specified.
Notes
The new version of
MultiDrizzle(AstroDrizzle) andupdatewcsonly work with the newNPOLFILEreference file for theDGEOcorrection (to replace the use of DGEOFILE). In fact,AstroDrizzlehas been extensively modified to prompt the user with a very lengthy explanation on whether it should stop and allow the user to update the header or continue without applying theDGEOcorrection under circumstances when theNPOLFILEkeyword can not be found for ACS.Examples
1. This command will update all the FLT files in the current directory with the new
NPOLFILEandD2IMFILEreference files found in the ‘myjref’ directory as defined in the environment:updatenpol *flt.fits myjref$
- drizzlepac.updatenpol.run(configobj=None, editpars=False)[source]
Deprecated since version 3.12.0: The run function is deprecated and may be removed in a future version.
Teal interface for running this code.
- drizzlepac.updatenpol.update(input, refdir='jref$', local=None, interactive=False, wcsupdate=True)[source]
Updates headers of files given as input to point to the new reference files NPOLFILE and D2IMFILE required with the new C version of MultiDrizzle.
- Parameters:
- inputstring or list
- Name of input file or files acceptable forms:
single filename with or without directory
@-file
association table
python list of filenames
wildcard specification of filenames
- refdirstring
Path to directory containing new reference files, either environment variable or full path.
- localboolean
Specifies whether or not to copy new reference files to local directory for use with the input files.
- interactiveboolean
Specifies whether or not to interactively ask the user for the exact names of the new reference files instead of automatically searching a directory for them.
- wcsupdateboolean
Specifies whether or not to update the WCS information in this file to use the new reference files.
Notes
Warning
This program requires access to the
jref$directory in order to evaluate the DGEOFILE specified in the input image header. This evaluation allows the program to get the information it needs to identify the correct NPOLFILE.The use of this program now requires that a directory be set up with all the new NPOLFILE and D2IMFILE reference files for ACS (a single directory for all files for all ACS detectors will be fine, much like jref). Currently, all the files generated by the ACS team has initially been made available at:
/grp/hst/acs/lucas/new-npl/
The one known limitation to how this program works comes from confusion if more than 1 file could possibly be used as the new reference file. This would only happen when NPOLFILE reference files have been checked into CDBS multiple times, and there are several versions that apply to the same detector/filter combination. However, that can be sorted out later if we get into that situation at all.
Examples
A set of associated images specified by an ASN file can be updated to use the NPOLFILEs and D2IMFILE found in the local directory defined using the
myjref$environment variable in python using:>>> import updatenpol >>> updatenpol.update('j8bt06010_asn.fits', 'myref$')
Another use under Python would be to feed it a specific list of files to be updated using:
>>> updatenpol.update(['file1_flt.fits','file2_flt.fits'],'myjref$')
Files in another directory can also be processed using:
>>> updatenpol.update('data$*flt.fits','../new/ref/')
- drizzlepac.updatenpol.help(file=None)
Print out syntax help for running
updatenpol.- Parameters:
- filestr (Default = None)
If given, write out help to the filename specified by this parameter Any previously existing file with this name will be deleted before writing out the help.