PAHFIT / pahfit

Model Decomposition for Near- to Mid-Infrared Spectroscopy of Astronomical Sources
https://pahfit.readthedocs.io/
18 stars 26 forks source link

Instrument packs: Incorrect coefficients for NIRSpec resolution #235

Closed drvdputt closed 1 year ago

drvdputt commented 1 year ago

The resolution returned by pahfit.instrument.resolution is not correct, at least not for nirspec. Looking at this plot https://jwst-docs.stsci.edu/files/97979440/97979452/1/1596073265647/jwst_nirspec_g140h_disp.png, from this page https://jwst-docs.stsci.edu/jwst-near-infrared-spectrograph/nirspec-instrumentation/nirspec-dispersers-and-filters#NIRSpecDispersersandFilters-DispersioncurvesfortheNIRSpecdispersers, it should be around 1500 at 0.8 micron, for G140H. Instead we get

>>> instrument.resolution('jwst.nirspec.g140.high', 0.8)
3490.42860832

These are the coefficients from the instrument pack:

            coefficients: [2291.3574, 1404.4167, 88.98144, 36.30806]

The zeroth order coefficient seems too high.

jdtsmith commented 1 year ago

Ok actually the fits were fine, but the dumb auto domain/range stuff from numpy.polynomial.Polynomial were interfering. They rescale the input values (here wavelength).

jdtsmith commented 1 year ago

See #236 (please check it over!).

drvdputt commented 1 year ago

This might need to be reopened for the ISO resolution. I found this in the SWS handbook

Screen Shot 2022-10-05 at 3 49 50 PM

But the resolution function is giving me this

>>> resolution("iso.sws.speed2.*", [3, 5, 10, 16, 25])
masked_array(
  data=[[1677, --, --],
        [1608, --, --],
        [1570, --, --],
        [1406, --, --],
        [993, --, --]],
  mask=[[False,  True,  True],
        [False,  True,  True],
        [False,  True,  True],
        [False,  True,  True],
        [False,  True,  True]],
  fill_value=999999)

I found this while looking at the included SWS data pahfit/data/ISO_SWS/Orion_D5_ISO-SWS_merged.ipac, and doing a fit. This data is supposedly AOT1 speed 2 (is this the same as SWS01 speed 2?), but the lines seem to narrow.

Figure 2

Manually hacking the resolution to 500 (as stated in the readme for the ISO files) makes the fit much better.

Figure 2(1)