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

[Solved]: All SCAs option in romanisim-make-image only generates one SCA #168

Open
Borlaff opened this issue Oct 22, 2024 · 3 comments
Open

Comments

@Borlaff
Copy link

Borlaff commented Oct 22, 2024

Hi,

I am trying to generate a complete (SCAs 1 to 18) Roman/WFI image using romanisim but the resulting ASDF file only contains one "data" array.

Example:

romanisim-make-image --radec 0 0 RST_WFI_test_v3.asdf --roll 0 --sca -1 --bandpass F087 --level 2 --usecrds

Result tree:

oot (AsdfObject)
├─asdf_library (Software)
│ ├─author (str): The ASDF Developers
│ ├─homepage (str): http://github.com/asdf-format/asdf
│ ├─name (str): asdf
│ └─version (str): 3.4.0
├─history (dict)
│ └─extensions (list) ...
├─roman (WfiImage) # The Schema for WFI Level 2 Images.
│ ├─meta (dict) ...
│ ├─data (Quantity): shape=(4088, 4088), dtype=float32 # Science Data (DN / s) or (M (truncated)
│ ├─dq (NDArrayType): shape=(4088, 4088), dtype=uint32 # Data Quality Flags
│ ├─err (Quantity): shape=(4088, 4088), dtype=float32 # Error (DN / s) or (MJy / sr)
│ ├─var_poisson (Quantity): shape=(4088, 4088), dtype=float32 # Poisson Variance (DN (truncated)
│ ├─var_rnoise (Quantity): shape=(4088, 4088), dtype=float32 # Read Noise (DN^2 / s^ (truncated)
│ ├─var_flat (Quantity): shape=(4088, 4088), dtype=float32 # Variance for Estimate o (truncated)
│ ├─amp33 (Quantity): shape=(6, 4096, 128), dtype=uint16 # Amp 33 Reference Pixel Da (truncated)
│ ├─border_ref_pix_left (Quantity): shape=(6, 4096, 4), dtype=float32 # Border Refer (truncated)
│ ├─border_ref_pix_right (Quantity): shape=(6, 4096, 4), dtype=float32 # Border Refe (truncated)
│ ├─border_ref_pix_top (Quantity): shape=(6, 4096, 4), dtype=float32 # Border Refere (truncated)
│ ├─border_ref_pix_bottom (Quantity): shape=(6, 4096, 4), dtype=float32 # Border Ref (truncated)
│ └─5 not shown
└─romanisim (dict) ...
Some nodes not shown.

roman_exp["roman"]["data"].shape
(4088, 4088)

The total size of the ASDF file is the same (~400 Mb) as the one generated using --sca 1, for example, so no additional data arrays are hidden in the ASDF structure.

Alex

@schlafly
Copy link
Collaborator

Hi Alex---I think the issue is that it needs to know where to build the WFI sca number into the file name. I think if you replace the filename with something like
RST_WFI{}_test_v3.asdf
then it will make 18 files. This might be a useful example:
https://github.com/spacetelescope/romanisim/blob/main/scripts/romancal_make_all_l1s.sh#L17

See if that helps? Thanks!

@Borlaff
Copy link
Author

Borlaff commented Oct 23, 2024

100% correct, thank you so much. Adding {} to the output name allowed romanisim to allocate different filenames for the different SCA. Thanks a lot.

My follow-up question would be: Is this the format that level 1 and 2 WFI images will have, different files per SCA?

@Borlaff Borlaff changed the title Bug: All SCAs option in romanisim-make-image only generates one SCA [Solved]: All SCAs option in romanisim-make-image only generates one SCA Oct 23, 2024
@schlafly
Copy link
Collaborator

Yes, this is the way that L1 and L2 files are being made. For example, we use romanisim to make the L1 files used to test the pipeline via that script I linked above.

When you're happy, please go ahead and close the issue. I'll push an update to the docs to make this undocumented '{}' feature more clear in the future; thanks for the reminder there.

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

No branches or pull requests

2 participants