cylammarco / ASPIRED

Automated SpectroPhotometric Image REDuction (ASPIRED)
https://aspired.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
30 stars 4 forks source link

Cannot save spectrum in instrumental coordinates (counts vs pix) #27

Closed rjs3273 closed 3 years ago

rjs3273 commented 4 years ago

This is a pretty trivial one. It's not something I really absolutely need at the moment so it's not urgent.

I tried to use oneDSpec.save_fits(output='count') to save off a copy of the basic extraction in instrumental units, I.e., just photo-electrons (or counts) against CCD pixel. I got the error message.

Traceback (most recent call last): File "/data/lt/Commissioning/SPRAT/Aspired/test_aspired_July2020.py", line 130, in overwrite=True) File "/Users/rjs/miniconda3/envs/astroconda/lib/python3.6/site-packages/aspired/spectral_reduction.py", line 7630, in save_fits raise Error('Neither wavelength nor flux is calibrated.') NameError: name 'Error' is not defined

After I have done the wavelength and flux calibrations, then save_fits() works and will indeed save off a file in exactly the format I wanted, but it seems a bit odd to insist that you must wavelength calibrate the data before you can save off the uncalibrated version. As I say, I can certainly live without it for now, but thought I'd point it out.

cylammarco commented 3 years ago

Count(pixel), Count(Wavelength) & Flux(Wavelength) output should be supported, I must have introduced some wrong if/elif/else statements in the last few months.