Extra Functions

Created on Mon Nov 20 15:08 2023

@author: MCR

Extra functions for use alongside the main pipeline.

exotedrf.extra_functions.download_observations(proposal_id, instrument_name=None, objectname=None, filters=None, visit_nos=None)

Directly download uncal files associated with a given observation from the MAST archive.

Parameters:
  • proposal_id (str) – ID for proposal with which the observations are associated.

  • instrument_name (str) – Name of instrument data to retrieve. NIRISS/SOSS, NIRSPEC/SLIT currently supported. (optional).

  • objectname (str) – Name of observational target. (optional).

  • filters (str) – Instrument filters to retrieve.

  • visit_nos (int, array-like(int)) – For targets with multiple visits, which visits to retrieve.

exotedrf.extra_functions.get_throughput_from_photom_file(photom_path)

Calculate the throughput based on the photom reference file. Function from Loïc, and is apparently the proper way to get the throughput? Gives different results from contents of spectra reference file.

Parameters:

photom_path (str) – Path to photom reference file

Returns:

  • w1 (np.array(float)) – Order 1 wavelength axis.

  • w2 (np.array(float)) – Order 2 wavelength axis.

  • thpt1 (np.array(float)) – Order 1 throughput values

  • thpt2 (np.array(float)) – Order 2 throughput values

exotedrf.extra_functions.make_smoothed_2d_lightcurve(spec, baseline_ints, nint, dimx, filename, order=1, tscale=3, wscale=9)

Smooth extracted 2D SOSS light curves on specified time and wavelength scales to use as input for chromatic 1/f correction.

Parameters:
  • spec (array-like(float)) – Extracted 2D light curves.

  • baseline_ints (int, array-like(int)) – Integrations or ingress and/or egress.

  • nint (int) – Number of integration in exposure.

  • dimx (int) – Number of wavelength bins in exposure.

  • filename (str) – File to which to save results.

  • order (int) – SOSS diffraction order being considered.

  • tscale (int) – Timescale, in integrations, on which to smooth. Must be odd.

  • wscale (int) – Timescale, in wavelength bins, on which to smooth. Must be odd.