Closed zonca closed 4 years ago
ok, this is how it works with arrays:
In [1]: import numpy as np
In [2]: import iris_pipeline
In [3]: im = iris_pipeline.datamodels.IRISImageModel()
In [4]: im.meta.subarray_holes
Out[4]: []
In [5]: im.meta.subarray_holes.append({"xstart":10, "ystart":20, "xsize":100, "ysiz
...: e":100})
In [6]: im.meta.subarray_holes
Out[6]: [{'xstart': 10, 'ystart': 20, 'xsize': 100, 'ysize': 100}]
In [7]: im.meta.subarray_holes.append({"xstart":10, "ystart":20, "xsize":100, "ysiz
...: e":100})
In [8]: im.meta.subarray_holes
Out[8]: [{'xstart': 10, 'ystart': 20, 'xsize': 100, 'ysize': 100}, {'xstart': 10, 'ystart': 20, 'xsize': 100, 'ysize': 100}]
it is not saved in the FITS header but it is anyway saved into the file using ASDF
@arunsurya77 @ikashell I am testing the subarray mask feature, can you please check this notebook and provide some feedback?
https://gist.github.com/zonca/10763c9380e567c118c0036d286b54d5
I was thinking I can assume that the metadata in the file will be already available in the raw input and I will create a step in the pipeline that creates the subarray_mask
array.
read the document
"Framework Software Interface Control Document IRIS Imager (IMG) to IRIS Data Reduction System (DRS) TMT.INS.ICD.16.020.REL05(DRF02)"
again, the name of the extension is SUBARR_MAP
and is created by the detector HCD. So I should create a step in the DRS which turns SUBARR_MAP
into a ASDF array keyword, so we have metadata easier to handle.
ok, implemented ParseSubarrayMapStep
which takes the map from the raw science frame and produces metadata and raises bit 4 of the dq
array.
created a new unit test for parse subarray map which runs the full image2 pipeline on an input full frame with some subarrays.
will start from this notebook to create a sample dataset for merging back subarrays and full frame.
notebook source is in the tests
folder, executed notebook: https://gist.github.com/zonca/954b54e5dc86782a8a5d535da415f600
merging this, continue development of level 3 pipeline for merging subarrays back on other Pull Request
See the documentation at:
example usage/test:
Implementing #15