pypeit / PypeIt

The Python Spectroscopic Data Reduction Pipeline
BSD 3-Clause "New" or "Revised" License
163 stars 104 forks source link

coadd_1dspec bug for NIRES data #628

Closed percygomez closed 2 years ago

percygomez commented 5 years ago

The coadd_1dspec for NIREs data produces an error when trying to coadd an A and a B coadded spectra.

The error is as follows:

pypeit_coadd_1dspec bb.yaml [INFO] :: Coadding 2 data frames [INFO] :: Using OPT extraction Traceback (most recent call last): File "/Applications/anaconda3/bin/pypeit_coadd_1dspec", line 4, in import('pkg_resources').run_script('pypeit==0.9.2.dev0', 'pypeit_coadd_1dspec') File "/Applications/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 748, in run_script self.require(requires)[0].run_script(script_name, ns) File "/Applications/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 1517, in run_script exec(code, namespace, namespace) File "/Applications/anaconda3/lib/python3.6/site-packages/pypeit-0.9.2.dev0-py3.6.egg/EGG-INFO/scripts/pypeit_coadd_1dspec", line 11, in coadd_1dspec.main(args) File "/Applications/anaconda3/lib/python3.6/site-packages/pypeit-0.9.2.dev0-py3.6.egg/pypeit/scripts/coadd_1dspec.py", line 136, in main mtch_obj, idx = specobjs.mtch_obj_to_objects(use_obj, fdict[fkey], **local_kwargs) File "/Applications/anaconda3/lib/python3.6/site-packages/pypeit-0.9.2.dev0-py3.6.egg/pypeit/specobjs.py", line 648, in mtch_obj_to_objects np.abs(tbl[naming_model['slit']]-odict[naming_model['slit']]) < stol) & ( File "/Applications/anaconda3/lib/python3.6/site-packages/astropy/table/table.py", line 1225, in getitem return self.columns[item] File "/Applications/anaconda3/lib/python3.6/site-packages/astropy/table/table.py", line 107, in getitem return OrderedDict.getitem(self, item) KeyError: 'SPAT'

The bb.yaml file is: 'filenames': ['spec1d_2962_NIRES_2018Nov27T050217.542.fits','spec1d_2962_NIRES_2018Nov27T050751.082.fits'] 'a': 'object': 'OBJ0001-ORDER0004-DET01' 'outfile': 'tmp.hdf5' 'flux': False

The spec1d files are at https://www.dropbox.com/sh/wkzrmqumgtim7pg/AADl_9RkblDEq67LgHaH-f51a?dl=0

feigewang commented 5 years ago

Hi Percy, we just finish the core functions for echelle 1d coadd named as ech_coadd. The coadd_1dspec in master does not works for echelle data yet. I'm working on that in the next few days and will keep you posted on that.

jhennawi commented 5 years ago

Hi Percy,

There is also a 2d coadd routine. It will be merged into master today. Just hang tight and you can give it a spin. It requires that your object be traced on each exposure. It will co-add the 2d frames using the trace of the brightest object as the reference.

feigewang commented 5 years ago

Hi @percygomez, coadd_1dspec should works for NIRES now. You can try it out. Here is an example yaml file: 'extract': 'OPT' 'flux': True 'global': 'mergeorder': True 'orderscale': 'median' 'filenames': ['Science/J0252_nires_ut181001_01.fits','Science/J0252_nires_ut181001_02.fits'] 'a': 'object': ['OBJ0001','OBJ0001'] 'outfile': 'nires_coadd_test.fits'

jhennawi commented 5 years ago

Hi Percy,

Provided your object is being traced, you can also try the pypeit_coadd_2dspec script. The usage should be pretty self explanatory. You can then run the pypeit_show_2dspec etc on the outputs.

Joe

On Sun, Mar 3, 2019 at 10:48 Feige Wang notifications@github.com wrote:

Hi @percygomez https://github.com/percygomez, coadd_1dspec should works for NIRES now. You can try it out. Here is an example yaml file: 'extract': 'OPT' 'flux': True 'global': 'mergeorder': True 'orderscale': 'median' 'filenames': ['Science/J0252_nires_ut181001_01.fits','Science/J0252_nires_ut181001_02.fits'] 'a': 'object': ['OBJ0001','OBJ0001'] 'outfile': 'nires_coadd_test.fits'

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/pypeit/PypeIt/issues/628#issuecomment-469051715, or mute the thread https://github.com/notifications/unsubscribe-auth/AIXjowUfbdv4a2-saqKRlADIHxahqiKIks5vTBkDgaJpZM4bOUqf .

--

Joseph F. Hennawi Associate Professor Department of Physics Broida Hall, UC Santa Barbara Santa Barbara, CA 93106-9530 Phone: 805-893-3503 Mobile: 805-450-8697 E-mail: joe@ joe@physics.ucsb.eduphysics.ucsb.edu http://web.physics.ucsb.edu/~joe/ enigma.physics.ucsb.edu

profxj commented 4 years ago

@percygomez -- Is this still an Issue? If not, kindly close it.

profxj commented 2 years ago

outdated