Skip to content

Add the fill_value parameter to GeocodeCov CPU module - #352

Open
gshiroma wants to merge 40 commits into
isce-framework:developfrom
gshiroma:fill_no_data
Open

gshiroma wants to merge 40 commits into
isce-framework:developfrom
gshiroma:fill_no_data

Conversation

@gshiroma

Copy link
Copy Markdown
Contributor

This PR adds the fill_value parameter to the GeocodeCov CPU module. It is inspired by #337 and sets the fill value of the layover/shadow mask layer in the Static Layers (STATIC) product to 255, instead of the default value of 0. Details about the issue and the discussion can be found in that PR.

The C++ and Python interfaces have been updated with the new parameter. The two CPU geocoding algorithms, interpolation and area projection, have also been updated to account for the new parameter. For the interpolation algorithm, the array is first filled with fill_value before interpolation occurs. In contrast, for the area projection algorithm, fill_value is applied after multilooking. This is necessary because the area projection algorithm accumulates averaged values (multilooked backscatter), and applying fill_value before data accumulation could cause it to be interpreted as a valid value.

@gshiroma gshiroma changed the title Add thefill_value Parameter to GeocodeCov CPU module Add thefill_value parameter to GeocodeCov CPU module Aug 12, 2026
@gshiroma

Copy link
Copy Markdown
Contributor Author

We just met to review this PR, and it was decided that we should add a warning message to alert the user when casting the data or fill value to the output raster type changes the data or fill value. In addition, the docstring for fill_value needs to be updated to explain these changes. The new feature should also be covered by a unit test.

@gshiroma gshiroma changed the title Add thefill_value parameter to GeocodeCov CPU module Add the fill_value parameter to GeocodeCov CPU module Sep 15, 2026
@gshiroma

Copy link
Copy Markdown
Contributor Author

We just met to review this PR, and it was decided that we should add a warning message to alert the user when casting the data or fill value to the output raster type changes the data or fill value. In addition, the docstring for fill_value needs to be updated to explain these changes. The new feature should also be covered by a unit test.

@hfattahi , @bhawkins , and @nemo794 . I implemented all the suggestions from our PR review meeting. I can’t pinpoint specific commits because the changes are spread across several commits. The changes are:

  • Added a unit test.
  • Added warning messages when data or fill values are cast while being stored in the output raster files.
  • Replaced the invalid complex fill value NaN + 0j with NaN + NaN.j.

Would you mind taking another look at this PR?

@gshiroma gshiroma added this to the R05.03.0 milestone Sep 16, 2026

@bhawkins bhawkins 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.

LGTM

Comment thread cxx/isce3/geocode/GeocodeCov.cpp Outdated
Comment thread tests/python/extensions/pybind/geocode/geocodeCov.py

@hfattahi hfattahi 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.

looks good to me overall. Good functionality added. I have one minor question below

Comment on lines +189 to +192
<< "which is not natively supported by the GeocodeCov "
<< "module. The data values and fill value will therefore "
<< "be cast to an integer type by isce3::io::Raster. "
<< "NaN values will be cast to 0."

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.

Can you clarify what do you mean exactly here? Do you intend to provide a warning that the geocoding is done by casting integer to float and then the final geocoded value will be cast to integer by isce3::io::Raster, during writing the output?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's correct, @hfattahi . @bhawkins asked that the user be informed about this casting. This is the same type of casting that caused the “problem” in the STATIC workflow, where the NaN values were silently cast to 0.

@gshiroma

Copy link
Copy Markdown
Contributor Author

@bhawkins , just letting you know that I'm setting the fill value for the GCOV & GSLC inputDataExceptionMask to 65535 in the commit c2e7f6e (instead of issuing a new PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants