kai.reduce.dar

Attributes

p2

module_dir

Functions

get_atm_conditions(year)

Retrieve atmospheric conditions from CFHT archive website,

keckDARcoeffs(lamda, year, month, day, hour, minute)

Calculate the differential atmospheric refraction

download_koa_dat_files(date_str, telescope_str, param_name)

Download the KOA atmospheric condition file for given date and

keckDARcoeffs_koa(lamda, year, month, day, hour, ...)

Calculate the differential atmospheric refraction

kaidar(fitsFile[, instrument, use_koa_weather])

Use the FITS header to extract date, time, wavelength,

darPlusDistortion(inputFits, outputRoot[, xgeoim, ...])

Create lookup tables (stored as FITS files) that can be used

applyDAR(inputFits, spaceStarlist[, plot, instrument, ...])

inputFits: (str) name of fits file associated with this starlist

removeDAR(inputFits, groundStarlist[, plot, ...])

inputFits: (str) name of fits file associated with this starlist

splitAtmosphereCFHT(year)

Take an original archive file containing atmospheric parameters and

test_darPlusDistortion()

Module Contents

kai.reduce.dar.p2 = False[source]
kai.reduce.dar.module_dir[source]
kai.reduce.dar.get_atm_conditions(year)[source]

Retrieve atmospheric conditions from CFHT archive website, then calls dar.splitAtmosphereCFHT() to separate the data by months.

kai.reduce.dar.keckDARcoeffs(lamda, year, month, day, hour, minute)[source]

Calculate the differential atmospheric refraction for two objects observed at Keck.

Input: lamda – Effective wavelength (microns) assumed to be the same for both year, month, day, hour, minute of observation (HST)

Output: refA refB

kai.reduce.dar.download_koa_dat_files(date_str, telescope_str, param_name, download_loc='./')[source]

Download the KOA atmospheric condition file for given date and specified parameter, and save at the download location

Parameters:
date_strstr

Date string for the night (e.g.: ‘20220525’).

telescope_strstr

String to specify which Keck telescope’s weather data to download. Can be ‘k1’ or ‘k2’.

param_namestr

Name of the parameter to download the conditions table (e.g.: ‘OutsideTemp’)

download_locstr, default = ‘./’

Directory to store the downloaded atmospheric condition table file.

kai.reduce.dar.keckDARcoeffs_koa(lamda, year, month, day, hour, minute, second, instrument=instruments.default_inst)[source]

Calculate the differential atmospheric refraction for two objects observed at Keck, using atmospheric conditions obtained via the KOA.

Parameters:
lamdafloat

Effective wavelength (microns), assumed to be the same for both.

yearint

UTC year

monthint

UTC month

dayint

UTC date

hourint

UTC hour

minuteint

UTC minute

secondint, float

UTC second

Returns:
refAfloat
refBfloat
kai.reduce.dar.kaidar(fitsFile, instrument=instruments.default_inst, use_koa_weather=False)[source]

Use the FITS header to extract date, time, wavelength, elevation, and image orientation information. This is everything that is necessary to calculate the differential atmospheric refraction. The differential atmospheric refraction is applicable only along the zenith direction of an image. This code calculates the predicted DAR using archived CFHT atmospheric data and the elevation and wavelength of the observations. Then the DAR correction is transformed into image coefficients that can be applied in image coordinates.

kai.reduce.dar.darPlusDistortion(inputFits, outputRoot, xgeoim=None, ygeoim=None, instrument=instruments.default_inst, use_koa_weather=False)[source]

Create lookup tables (stored as FITS files) that can be used to correct DAR. Optionally, the shifts due to DAR can be added to existing NIRC2 distortion lookup tables if the xgeoim/ygeoim input parameters are set.

Inputs: inputFits - a NIRC2 image for which to determine the DAR correction outputRoot - the root name for the output. This will be used as the

root name of two new images with names, <outputRoot>_x.fits and <outputRoot>_y.fits.

Optional Inputs: xgeoim/ygeoim - FITS images used in Drizzle distortion correction

(lookup tables) will be modified to incorporate the DAR correction. The order of the correction is 1. distortion, 2. DAR.

kai.reduce.dar.applyDAR(inputFits, spaceStarlist, plot=False, instrument=instruments.default_inst, plotdir='./')[source]

inputFits: (str) name of fits file associated with this starlist

spaceStarlist: (astropy table) must include columns ‘x0’ and ‘y0’.

Input a starlist in x=RA (+x = west) and y=Dec (arcseconds) taken from space and introduce differential atmospheric refraction (DAR). The amount of DAR that is applied depends on the header information in the input fits file. The resulting output starlist should contain what was observed after the starlight passed through the atmosphere, but before the starlight passed through the telescope. Only achromatic DAR is applied in this code.

returns spaceStarlist with updated ‘x0’ and ‘y0’

kai.reduce.dar.removeDAR(inputFits, groundStarlist, plot=False, instrument=instruments.default_inst, plotdir='./')[source]

inputFits: (str) name of fits file associated with this starlist

groundStarlist: (astropy table) must include columns ‘x’ and ‘y’.

The inverse of applyDAR(). Takes a starlist in x and y pixels taken from the ground and removes differential atmospheric refraction (DAR). The amount of DAR that is applied depends on the header information in the input fits file. The resulting output starlist should contain what would be observed above the atmosphere. Distortion should be applied before this function. Only achromatic DAR is applied in this code.

returns groundStarlist with updated ‘x0’ and ‘y0’

kai.reduce.dar.splitAtmosphereCFHT(year)[source]

Take an original archive file containing atmospheric parameters and split it up into seperate files for individual months. This makes later calls to calculate DAR parameters MUCH faster.

kai.reduce.dar.test_darPlusDistortion()[source]