oirlab / liger_iris_pipeline

Data Reduction System (DRS) for the Thirty Meter Telescope IRIS imager/spectrograph
https://oirlab.github.io/iris-pipeline
0 stars 3 forks source link

Simple implementation of assign WCS #34

Closed zonca closed 3 years ago

zonca commented 3 years ago

Example:

import iris_pipeline
import astropy.units as u

iris_pipeline.monkeypatch_jwst_datamodels()

input_filename ="/home/zonca/p/issues/202002_mosaic/example_field/iris_sim_gc_filterKN3_fix.fits"
output = iris_pipeline.assign_wcs.AssignWcsStep.call(input_filename)
print(output.meta.wcs([0,4096]*u.pix,[0,4096]*u.pix))

I get (the first ERROR is nothing to worry about):

2020-09-11 12:33:04,203 - CRDS - ERROR -  Error determining best reference for 'pars-assignwcsstep'  =   Unknown reference type 'pars-assignwcsstep'
2020-09-11 12:33:04,205 - stpipe.AssignWcsStep - INFO - AssignWcsStep instance created.
2020-09-11 12:33:04,258 - stpipe.AssignWcsStep - INFO - Step AssignWcsStep running with args ('/home/zonca/p/issues/202002_mosaic/example_field/iris_sim_gc_filterKN3_fix.fits',).
2020-09-11 12:33:04,259 - stpipe.AssignWcsStep - INFO - Step AssignWcsStep parameters are: {'pre_hooks': [], 'post_hooks': [], 'output_file': None, 'output_dir': None, 'output_ext': '.fits', 'output_use_model': False, 'output_use_index': True, 'save_results': False, 'skip': False, 'suffix': None, 'search_output_file': True, 'input_dir': ''}
2020-09-11 12:33:04,778 - stpipe.AssignWcsStep - INFO - Step AssignWcsStep done
(<Quantity [265.19512288, 265.20032602] deg>, <Quantity [-28.99446396, -28.98991285] deg>)
zonca commented 3 years ago

the core of the implementation is https://github.com/oirlab/iris_pipeline/pull/34/files#diff-c01bc0450db405c7fed0c2ff9072dbe1R35-R65, for now is mostly a placeholder, but should work for simple FITS WCS

I have a notebook that goes through the implementation: https://zonca.dev/2020/09/wcs-astropy.html

zonca commented 3 years ago

anyone wants to check this and provide some feedback? @nils-erik @arunsurya77 @ikashell

zonca commented 3 years ago

next I'll implement a unit test

zonca commented 3 years ago

ok, implemented also the unit test notebook with some explanation on the implementation