Page 1 of 1

PlotSpectra and IRAF cropped spectra

Posted: Sun Nov 12, 2017 3:08 pm
by Andrew Smith
Hi Tim, I have found an anomaly with PlotSpectra if I plot spectra cropped in IRAF.

From what I can tell you start plotting at CRVAL1 which seems reasonable. So for an original image (i.e. not cropped) IRAF has say CRVAL1 = 5763.231... and CRPIX1 = 1.
However if you crop the image rather than update CRVAL1 IRAF updates CRPIX1 , LTV1, CDELT1, CD1_1 and LTM1_1

Thus after a crop I get CRVAl1 = 5763.231 and CRPIX1 = -454.8499... and LTV1 = -455.8501.

Given the scale cropped scale is CDELT1 = 0.071884498... it looks like the plot should start at CRPIX1 - CRPIX1*CDELT1. (-ve as CRPIX1 is negative).

However I am not familiar enough with the FIT format to be sure.

I will look into how the crop is being done to see if I can make it crop without these issues.

ISIS does seem to do it correctly as far as I can tell.

Regards Andrew

Re: PlotSpectra and IRAF cropped spectra

Posted: Mon Nov 13, 2017 1:55 am
by Tim Lester
Andrew,

I had to write the fit parsing routine myself as I could not find a ready made fits library for c#. My routine is definitely not a complete implementation of the fits standard. At present it only looks at NAXIS1, CRVAL1 and CDELT1 and ignores CRPIX1 (assumes it is 1). I will work on a more complete implementation. I had meant to do this earlier but because I haven't encountered any problems myself it kind of dropped off my radar.

Tim

Re: PlotSpectra and IRAF cropped spectra

Posted: Mon Nov 13, 2017 1:31 pm
by Andrew Smith
Thanks Tim, sorry to create work for you. Regards Andrew