PlotSpectra and IRAF cropped spectra

Design, construction, tuning of spectroscopes
Information and discussion about softwares (telescope remote, autoguiding, acquisition, spectral processing ...)
Post Reply
Andrew Smith
Posts: 321
Joined: Fri Sep 30, 2011 12:23 pm

PlotSpectra and IRAF cropped spectra

Post 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
Tim Lester
Posts: 168
Joined: Fri Apr 04, 2014 6:31 pm
Location: Arnprior Ontario

Re: PlotSpectra and IRAF cropped spectra

Post 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
Andrew Smith
Posts: 321
Joined: Fri Sep 30, 2011 12:23 pm

Re: PlotSpectra and IRAF cropped spectra

Post by Andrew Smith »

Thanks Tim, sorry to create work for you. Regards Andrew
Post Reply