Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring of parse_subarray_map_step and test #69

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

astrobc1
Copy link
Contributor

@astrobc1 astrobc1 commented Jul 4, 2024

@zonca Could you take a look at my progress on ParseSubarrayMapStep? It fails in this loop:

for each in parse_subarray_map(result["subarr_map"]):
result.meta.subarray_map.append(each)

result is a LigerIrisImage and result.meta has no attribute subarr_map to store a list of xstart, ystart, xsize, etc. The schemas are consistent with this. There is result.meta.subarray, but it is designed for one subarray; result.meta.subarray = each works for a single dict.

Can a single LigerIrisImage contain multiple subarrays at this stage? Eventually we should consider that subarrays are only relevant for IRIS, but maybe not just yet.

@zonca
Copy link
Member

zonca commented Jul 5, 2024

@astrobc1 reading https://oirlab.github.io/iris-pipeline/parse_subarray_map/index.html it seems like the purpose of the step is to create those fields.

we definitely had subarray map at:

subarr_map:
title: Subarray map
fits_hdu: SUBARR_MAP
default: 0
datatype: uint16

my bad, I lost that field in the refactoring, it defintely was there, see

subarray_map:
title: Subarray map
type: array
items:
type: object
properties:
xstart:
title: Starting pixel in axis 1 direction
type: integer
ystart:
title: Starting pixel in axis 2 direction
type: integer
xsize:
title: Number of pixels in axis 1 direction
type: integer
ysize:
title: Number of pixels in axis 2 direction
type: integer

I now restored it.

@zonca
Copy link
Member

zonca commented Jul 5, 2024

I think we were able to have multiple subarrays, but I don't remember exactly how it worked, let me look into that and report back here.

@zonca
Copy link
Member

zonca commented Jul 5, 2024

@astrobc1 actually no, each file only has 1 subarray,
see for example https://github.com/oirlab/liger_iris_pipeline/blob/master/liger_iris_pipeline/tests/test_merge_subarrays.ipynb

so I think subarray map is defined in the "Full frame" to keep track of the subarrays, but the subarrays are not actually in that file but in separate fits files.

@zonca
Copy link
Member

zonca commented Jul 5, 2024

@zonca
Copy link
Member

zonca commented Jul 5, 2024

@astrobc1 there are some examples and explanation around page 60 of the design document

@astrobc1 astrobc1 changed the title Minor refactoring of parse_subarray_map_step and test, not completed Minor refactoring of parse_subarray_map_step and test Jul 8, 2024
@astrobc1 astrobc1 requested a review from zonca July 8, 2024 16:09
@astrobc1 astrobc1 changed the title Minor refactoring of parse_subarray_map_step and test Refactoring of parse_subarray_map_step and test Jul 8, 2024
@zonca zonca merged commit 435f167 into master Jul 9, 2024
1 check failed
@zonca zonca deleted the port_parse_subarray_map_step branch July 9, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants