pynrc.nrc_utils.place_grism_spec

pynrc.nrc_utils.place_grism_spec(nrc, sp, xpix, ypix, wref=None, return_oversample=False, spec_ang=0, cen_rot=None)[source]

Create spectral image and place ref wavelenght at (x,y) location

Given a NIRCam instrument object and input spectrum, create a dispersed PSF and place the undeviated reference wavelength at the specified (xpix,ypix) coordinates (assuming ‘sci’ coords).

Returned values will be a tuple of (wspec, imspec)

Parameters:
  • nrc (NIRCam) – pynrc.NIRCam class

  • sp (webbpsf_ext.synphot_ext.Spectrum) – A synphot spectrum of target. Should already be normalized to the apparent flux.

  • xpix (float) – Pixel position along x-axis to place reference wavelength. Specified in ‘sci’ coordinates. Assumes no spectral rotation.

  • xpix (float) – Pixel position along y-axis to place reference wavelength. Specified in ‘sci’ coordinates. Assumes no spectral rotation.

Keyword Arguments:
  • wref (float) – Undeviated reference wavelength in mircons associated with grism. Automatically determined from grism_wref() if not specified.

  • return_oversample (bool) – Return

  • spec_ang (float) – Optionally set a rotation angle (deg) of the dispersion. Rotates in clockwise direction.

  • cen_rot (tuple) – Position in ‘sci’ coordinates to rotate around if spec_ang is set. If not specified, then will rotate around center of image.