irispreppy API Documentation
Submodules
irispreppy.radcal.radcal module
- irispreppy.radcal.radcal.radiometric_calibrate(ras, quiet=True, error=False)
Performs radiometric calibration of IRIS spectrograph files.
(See Section 5.2 of ITN26 for more details - https://iris.lmsal.com/itn26/calibration.html#radiometric-calibration)
- Parameters:
ras (astropy.io.fits.hdu.hdulist.HDUList) – Input IRIS raster
quiet (bool) – Whether to suppress print statements. Default: True
error (bool) – Whether to calculate errors (beta). Ignored if ras is a full disc mosaic. Default: False
- Returns:
hdul (astropy.io.fits.hdu.hdulist.HDUList) – The calibrated data
hdule (astropy.io.fits.hdu.hdulist.HDUList) – If error=True. The poissonian error and dark current on the data (beta)
Example
>>> from astropy.io import fits >>> import irispreppy as ip >>> f=fits.open('iris_raster.fits') >>> frc=ip.radiometric_calibrate(f)
irispreppy.radcal.iris_get_response module
- irispreppy.radcal.iris_get_response.fit_iris_xput_lite(tt0, tcc0, ccc)
Stripped down form of fit_iris_xput.pro, with only the sections relevant to iris_get_response.pro. I am so sorry, but I have no idea what the last two inputs are.
- Parameters:
tt0 (string) – Observation date.
tcc0 (array_like) – Time Coefficients.
ccc (array_like) – Coefficients.
- Returns:
f – IRIS crossput.
- Return type:
float
- irispreppy.radcal.iris_get_response.iris_get_response(date=None, version=0, response_file=None, pre_launch=False, full=False, angstrom=False, update_response=True, quiet=False)
Functions identically to that of iris_get_response.pro. Generates the IRIS response required for radiometric calibration.
- Parameters:
date (string) – Date of observation. e.g. ‘2013-06-28T02:27:46.00Z’ Default is now.
version (int) – Which version of the response file you want. Default is newest. Version numbers are 1 indexed. Default: 0 (i.e. the newest).
response_file (string) – Name of the response file you want to use. Must exactly match, including extension. Else reverts to default response of the most recent.
pre_launch (bool) – Analaguous to version=2. Default: False.
full (bool) – Full effective area structure is returned with cryptic coefficients. Default: False.
angstrom (bool) – Whether to return lambda in angstroms. If False, lambda is returned in nm. Default: False.
update_response (bool) – Whether to call update_response_files(quiet=True) to check for new response files before starting calibration. Default: True.
quiet (bool) – Whether to suppress all print statements including messages about failing to find specified response file and reverting to default. Default: False.
- Returns:
o – IRIS response. A dict was chosen to mimic an IDL struct.
- Return type:
dict
Notes
- In order to mimic iris_get_response.pro, there are three different parameters that specify the version of the response file to use. If none are set, the most recent response file will be used. Their precedence (if all are set) is:
pre_launch > version > response_file
Example
>>> from astropy.io import fits >>> import irispreppy as ip >>> f=fits.open('iris_raster.fits') >>> frc=ip.iris_get_response(f[0].header['DATE_OBS'])
- irispreppy.radcal.iris_get_response.update_response_files(quiet=False)
Checks https://hesperia.gsfc.nasa.gov/ssw/iris/response/ for new IRIS response files, and downloads any it finds.
- Parameters:
quiet (bool) – Whether to suppress printing status, and URL errors. Default: False.
- Returns:
new – Whether any new response files were found.
- Return type:
bool
Example
>>> import irispreppy as ip >>> f=ip.update_response_files()
irispreppy.radcal.calsave module
- irispreppy.radcal.calsave.calibrate_and_save(ras, errors=False, filename=None)
Performs radiometric calibration of IRIS spectrograph files using default values and saves.
(See Section 5.2 of ITN26 for more details - https://iris.lmsal.com/itn26/calibration.html#radiometric-calibration)
- Parameters:
ras (astropy.io.fits.hdu.hdulist.HDUList) – Input IRIS raster
error (bool) – Whether to calculate errors (beta). Ignored if ras is a full disc mosaic. Default: False
filename (string) – Filename of output. If not set, will be saved as original filename (and path) with ‘_rc’ appended.
Notes
If no filename is present in the HDUL and filename is not set, the original filename will be deciphered from the header information.
Example
>>> from astropy.io import fits >>> import irispreppy as ip >>> f=fits.open('iris_raster.fits') >>> frc=ip.calibrate_and_save(f)
irispreppy.psf.deconvolve module
- irispreppy.psf.deconvolve.decon(rasfits, psfs, iterations=0, fft=False)
Wrapper around IRIS_SG_deconvolve
- Parameters:
rasfits (astropy.io.fits.hdu.hdulist.HDUList) – The hdu to be deconvolved
psfs (dict) – The point spread functions
iterations (int or list) – How many iterations to use in Richardson-Lucy deconvolution. Integer input will be applied to all ImageHDUs. List input should be a separate number of iterations for each ImageHDU. Defaults - FUV: 10, NUV: 50
fft (bool) – Whether to deconvolve by division in Fourier space instead of using a Richardson-Lucy deconvolution. Default: False
- Returns:
hdul – Deconvolved hdu
- Return type:
astropy.io.fits.hdu.hdulist.HDUList
- irispreppy.psf.deconvolve.deconvolve(ras, iterations=0, fft=False)
Deconvolves IRIS PSF from IRIS spectrograph files.
(See Courrier et al. 2018 for more information - DOI: 10.1007/s11207-018-1347-9)
- Parameters:
ras (astropy.io.fits.hdu.hdulist.HDUList) – Input IRIS raster
iterations (int or list) – How many iterations to use in Richardson-Lucy deconvolution. Integer input will be applied to all ImageHDUs. List input should be a separate number of iterations for each ImageHDU. Defaults - FUV: 10, NUV: 50
fft (bool) – Whether to deconvolve by division in Fourier space instead of using a Richardson-Lucy deconvolution. Default: False
- Returns:
hdul – The deconvolved data
- Return type:
astropy.io.fits.hdu.hdulist.HDUList
Example
>>> from astropy.io import fits >>> import irispreppy as ip >>> f=fits.open('iris_raster.fits') >>> frc=ip.deconvolve(f)
irispreppy.psf.decsave module
- irispreppy.psf.decsave.deconvolve_and_save(ras, filename=None)
Deconvolves IRIS PSF from IRIS spectrograph files using default values and saves.
(See Courrier et al. 2018 for more information - DOI: 10.1007/s11207-018-1347-9)
- Parameters:
ras (astropy.io.fits.hdu.hdulist.HDUList) – Input IRIS raster
filename (string) – Filename of output. If not set, will be saved as original filename (and path) with ‘_d’ appended.
Notes
If no filename is present in the HDUL and filename is not set, the original filename will be deciphered from the header information.
Example
>>> from astropy.io import fits >>> import irispreppy as ip >>> f=fits.open('iris_raster.fits') >>> frc=ip.deconvolve_and_save(f)