Skip to content

Use real component dtype when writing statistics for complex data - #306

Open
gshiroma wants to merge 34 commits into
isce-framework:developfrom
gshiroma:fix_gcov_off_diag_stats_dtype
Open

Use real component dtype when writing statistics for complex data#306
gshiroma wants to merge 34 commits into
isce-framework:developfrom
gshiroma:fix_gcov_off_diag_stats_dtype

Conversation

@gshiroma

Copy link
Copy Markdown
Contributor

This PR updates BaseL2WriterSingleInput to ensure statistics computed from complex-valued data (e.g., GCOV off-diagonal terms) are written using the corresponding real-valued dtype.

gshiroma and others added 30 commits July 3, 2025 11:30
@gshiroma
gshiroma requested a review from nemo794 June 18, 2026 05:43
@nemo794

nemo794 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Adding more context to this PR description:

Currently, GCOV off-diagonal complex-valued datasets (e.g., HHHV with complex64 dtype), the statistics attributes (min_real_value, mean_real_value, min_imag_value, etc.) are incorrectly being stored as complex-valued (e.g., complex64) with the actual metric saved to the real component. (See screenshot)

However, for a complex64 dataset (composed of float32 + float32), statistics attributes should be stored as float32, not complex64, since the statistics themselves are real-valued scalars. This was inconsistent with RSLC and GSLC products, where statistics for complex-valued datasets are correctly stored as float-valued.

This PR addresses that inconsistency.

Screenshot 2026-06-17 at 6 44 36 PM

@nemo794 nemo794 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gshiroma !

I'm pretty sure you tested this PR awhile back. Please attach a screenshot of the output product, as a sanity check to confirm that these fields are being populated correctly now?

See #306 (comment) for an example screenshot of what the metadata looked like previously. Thanks!

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.

2 participants