These functions perform various small operations within Multidrizzle.
A library of utility functions
This class allows MultiDrizzle to keep track of the start and end times of each processing step that gets run as well as computing/reporting the elapsed time for each step.
The code for each processing step must call the ‘addStep()’ method to initialize the information for that step, then the ‘endStep()’ method to record the end and elapsed times.
The ‘reportTimes()’ method can then be used to provide a summary of all the elapsed times and total run time.
Add information about a new step to the dict of steps The value ‘ptime’ is the output from ‘_ptime()’ containing both the formatted and unformatted time for the start of the step.
Record the end time for the step.
If key==None, simply record ptime as end time for class to represent the overall runtime since the initialization of the class.
Print out a formatted summary of the elapsed times for all the performed steps.
Return the filename of the IVM file which is assumed to be the second word in the atfile the user gave.
Return the filename of the science image which is assumed to be the first word in the atfile the user gave.
Converts blank value (from configObj?) into a value of None.
Determine the range spanned by an array of pixel positions.
Add up the exposure time for all the members in the pattern, since ‘drizzle’ doesn’t have the necessary information to correctly set this itself.
Return the number of SCI extensions and the EXTNAME from a input MEF file.
Create a simple fits file for the given data array and header.
Displays a warning box for the ‘input’ parameter.
Displays a warning box for the ‘input’ parameter.
Displays a warning box for the ‘makewcs’ parameter.
Close log file and restore system defaults.
Return the rootname of the given file.
Return parameter value without having to specify which section holds the parameter.
Return default configObj instance for task updated with user-specified values from input_dict.
Parameters : | |
---|---|
taskname : string
configObj : string
input_dict : dict
loadOnly : bool
|
Return a single list of all parameter names included in the configObj regardless of which section the parameter was stored
Determine the size of a rotated (meta)image.
Return section label based on step number.
shouldn’t this just be defined in the instrument subclass of imageobject?
Examine the cpu_count to decide and return the right pool size to use. Also take into account the user’s wishes via the config object value, if specified. On top of that, don’t allow the pool size returned to be any higher than the number of parallel tasks, if specified. Only use what we need (mp.Pool starts pool_size processes, needed or not). If number of tasks is unknown, call this with “num_tasks” set to None. Consolidate all such logic here, not in the caller.
Set up logger for capturing stdout/stderr messages.
Must be called prior to writing any messages that you want to log.
Converts input bits value from string to a single integer value or None. If a comma-separated set of values are provided, they are summed.
Return TRUE if inputFilelist is a fits ASN file.
Return True if the input is a comma separated list of names.
Determines whether or not a value is considered ‘blank’.
Open up the ‘@ file’ and read in the science and possible ivm filenames from the first two columns.
Convert colnames input into list of column numbers.
Print nicely the parameters from the dictionary.
Return a list of the files with the commas removed.
Read the columns from an ASCII file as numpy arrays.
Parameters : | |
---|---|
infile : str
cols : list of int
|
|
Returns : | |
outarr : list of numpy arrays
|
Delete the file specified, but only if it exists and clobber is True.
Runs ‘updatewcs’ to recompute the WCS keywords for the input image.
Parameters : | |
---|---|
input : list of str
|
|
Returns : | |
output : list of str
|
Removes files flagged to be removed from the input filelist. Removes the corresponding ivm files if present.
Compares input parameter names specified by user with those already recognized by the task.
Any parameters provided by the user that does not match a known task parameter will be reported and a ValueError exception will be raised.
Verify that images specified in ‘filelist’ can be updated.
A message will be printed reporting the names of any images which do not have write-permission, then quit.
Verify that the value of refimage specified by the user points to an extension with a proper WCS defined. It starts by making sure an extension gets specified by the user when using a MEF file. The final check comes by looking for a CD matrix in the WCS object itself. If either test fails, it returns a value of False.
Report whether or not the specified WCSNAME already exists in the file
Verify the existence of WCSNAME in the file. If it is not present, report this to the user and raise an exception. Returns True if WCSNAME was found in all SCI extensions.