Module for handling IO in SALT software.
All calls to IO functions should go through this module.
Note this is a replacement for the saltio module.
convert relative path to absolute path
has an argument been defined?
For arguments that might be a file or list, unpack to make a single list
Ask for a user response
returns the response
Given a list of fits files returns an index of exposures for use with get_indexed_exposure.
change working directory
Create the list of appropriate proprosal codes
close ASCII file
close HDU structure
are two lists the same length?
copy file
copy direcotry recursively
create a directory
delete a file
delete a directory
send email
has a file been defined?
check that a file does not exist
check that a file exists
check files in list exist
construct FITS table columns
iraf_format: It will invert the x and y values
Given a list of fits files returns exposure data as numpy array.
By default get_exposure will return the first exposure with data. If number parameter is given it will browse the file list until the requested exposure number is found.
Because of this browing get_exposure is only fast for small exposure number. If the exposure numbers are always big or if you need to access a lot of exposures you should use build_exposure_index and get_indexed_exposure instead.
Given a list of fits files and a index generated by build_exposure_index it returns the requested exposure as a numpy array.
By default get_exposure will return the first exposure with data. If number parameter is given it will browse the file list until the requested exposure number is found.
The index consumes a lot of memory. Only use get_indexed_exposure when you need to access a large number of exposures fast, or when the exposure number is always big. Otherwise you should use get_exposure instead.
does a list file exist, i.e. a parameter that begins with the ‘@’ character
create a list from a file or parameter
test the log file exists
move file
write FITS table
open ASCII file
Open binary file.
open FITS file
open FITS file for updating
clobber if file is to be overwritten
check that a path exists and name ends with a /
read data from a binary file.
read CCD geometry definition file
read gain database file
read image from HDU structure
read image from HDU structure
Read in and parse a list of input images
Returns list from epar parameter.
It accepts the following for param A filename prefixed by @, for example:
readlist('@images')
will read names from the file images. A comma separated list of filenames
read FITS table HDU
read crosstalk coefficent file
Remove propcodes that you do not want –namely junk, bias, test
Removing propcodes that are associated with engineering and calibration proposals
create symbolic link
create a temporary file name
update existing FITS file
write to FITS file
write image from HDU structure
Ask for a [y/n] user response
returns the response