pynrc.reduce.calib.get_fits_data

pynrc.reduce.calib.get_fits_data(fits_file, return_header=False, bias=None, reffix=False, DMS=False, int_ind=0, grp_ind=None, **kwargs)[source]

Read in FITS file data

Parameters
  • fname (str) – FITS file (including path) to open.

  • return_header (bool) – Return header as well as data?

  • bias (ndarray) – If specified, will subtract bias image from ramp.

  • reffix (bool) – Perform reference correction?

  • DMS (bool) – Is the FITS file DMS format?

  • int_ind (int) – If DMS format, select integration index to extract. DMS FITS files usually have all integrations within a given exposure in a single FITS extension, which can be quite large.

  • grp_ind (2-element array) – Option to index specific groups from the data. For instance grp_ind=[0:10] will select only the first 10 groups from the FITS cube.

Keyword Arguments
  • altcol (bool) – Calculate separate reference values for even/odd columns. (default: True)

  • supermean (bool) – Add back the overall mean of the reference pixels. (default: False)

  • top_ref (bool) – Include top reference rows when correcting channel offsets. (default: True)

  • bot_ref (bool) – Include bottom reference rows when correcting channel offsets. (default: True)

  • ntop (int) – Specify the number of top reference rows. (default: 4)

  • nbot (int) – Specify the number of bottom reference rows. (default: 4)

  • mean_func (func) – Function used to calculate averages. (default: robust.mean)

  • left_ref (bool) – Include left reference cols when correcting 1/f noise. (default: True)

  • right_ref (bool) – Include right reference cols when correcting 1/f noise. (default: True)

  • nleft (int) – Specify the number of left reference columns. (default: 4)

  • nright (int) – Specify the number of right reference columns. (default: 4)

  • perint (bool) – Smooth side reference pixel per integration, otherwise do frame-by-frame. (default: False)

  • avg_type (str) –

    Type of side column averaging to perform to determine ref pixel drift. Allowed values are ‘pixel’, ‘frame’, or ‘int’ (default: ‘frame’):

    • ’int’ : Subtract the avg value of all side ref pixels in ramp.

    • ’frame’ : For each frame, get avg of side ref pixels and subtract framewise.

    • ’pixel’ : For each ref pixel, subtract its avg value from all frames.

  • savgol (bool) – Use Savitsky-Golay filter method rather than FFT. (default: True)

  • winsize (int) – Size of the window filter. (default: 31)

  • order (int) – Order of the polynomial used to fit the samples. (default: 3)