kai.reduce.sky

Functions

makesky(files, nite, wave[, dark_frame, skyscale, ...])

Make short wavelength (not L-band or longer) skies.

makesky_lp(files, nite, wave[, dark_frame, number, ...])

Make L' skies by carefully treating the ROTPPOSN angle

makesky_fromsci(files, nite, wave[, raw_dir, ...])

Make short wavelength (not L-band or longer) skies from the science exposures

read_sky_rot_file(sky_rot_file)

Read in the list of files and rotation angles.

write_sky_rot_file(rawlis, nlis, skyRot)

Write the list of files and rotation angles in Lp.

get_raw_reduce_directories(raw_dir, reduce_dir)

Module Contents

kai.reduce.sky.makesky(files, nite, wave, dark_frame=None, skyscale=True, raw_dir=None, reduce_dir=None, instrument=instruments.default_inst)[source]

Make short wavelength (not L-band or longer) skies.

Parameters:
fileslist of int

Integer list of the files. Does not require padded zeros.

nitestr

Name for night of observation (e.g.: “nite1”), used as suffix inside the reduce sub-directories.

wavestr

Name for the observation passband (e.g.: “kp”)

dark_framestr, default=None

File name for the dark frame in order to carry out dark correction. If not provided, dark frame is not subtracted and a warning is thrown. Assumes dark file is located under ./calib/darks/

skyscalebool, default=True

Whether or not to scale the sky files to the common median. Turn on for scaling skies before subtraction.

raw_dirstr, optional

Directory where raw files are stored. By default, assumes that raw files are stored in ‘../raw’

reduce_dirstr, optional

Directory such as <epoch>/reduce/ with contents including the calib/, calib/darks/, etc. directories live. Files will be output into reduce_dir + calib/darks/. If epoch_dir is None, then use the current working directory.

instrumentinstruments object, optional

Instrument of data. Default is instruments.default_inst

kai.reduce.sky.makesky_lp(files, nite, wave, dark_frame=None, number=3, rejectHsigma=5, raw_dir=None, reduce_dir=None, instrument=instruments.default_inst)[source]

Make L’ skies by carefully treating the ROTPPOSN angle of the K-mirror. Uses 3 skies combined (set by number keyword).

Parameters:
fileslist of int

Integer list of the files. Does not require padded zeros.

nitestr

Name for night of observation (e.g.: “nite1”), used as suffix inside the reduce sub-directories.

wavestr

Name for the observation passband (e.g.: “lp”)

dark_framestr, default=None

File name for the dark frame in order to carry out dark correction. If not provided, dark frame is not subtracted and a warning is thrown. Assumes dark file is located under ./calib/darks/

numberint, default=3

Number of skies to be combined

rejectHsigmaint, default:None

Apply a sigma_high threshold for sigma clipping. This works to remove stars or galaxies when using science images to make the sky.

raw_dirstr, optional

Directory where raw files are stored. By default, assumes that raw files are stored in ‘../raw’

reduce_dirstr, optional

Directory such as <epoch>/reduce/ with contents including the calib/, calib/darks/, etc. directories live. Files will be output into reduce_dir + calib/darks/. If epoch_dir is None, then use the current working directory.

instrumentinstruments object, optional

Instrument of data. Default is instruments.default_inst

kai.reduce.sky.makesky_fromsci(files, nite, wave, raw_dir=None, reduce_dir=None, instrument=instruments.default_inst)[source]

Make short wavelength (not L-band or longer) skies from the science exposures themselves. We use strong clipping to get rid of stars. This should only be used on sparser science fields.

Parameters:
fileslist of int

Integer list of the files. Does not require padded zeros.

nitestr

Name for night of observation (e.g.: “nite1”), used as suffix inside the reduce sub-directories.

wavestr

Name for the observation passband (e.g.: “kp”)

raw_dirstr, optional

Directory where raw files are stored. By default, assumes that raw files are stored in ‘../raw’

reduce_dirstr, optional

Directory such as <epoch>/reduce/ with contents including the calib/, calib/darks/, etc. directories live. Files will be output into reduce_dir + calib/darks/. If epoch_dir is None, then use the current working directory.

instrumentinstruments object, optional

Instrument of data. Default is instruments.default_inst

kai.reduce.sky.read_sky_rot_file(sky_rot_file)[source]

Read in the list of files and rotation angles.

kai.reduce.sky.write_sky_rot_file(rawlis, nlis, skyRot)[source]

Write the list of files and rotation angles in Lp. Created to avoid using pyraf which causes issues when dealing with non-fits conforming headers.

kai.reduce.sky.get_raw_reduce_directories(raw_dir, reduce_dir)[source]