Get the bounding box from the HDF EOS level-1 files and pass it to the array attributes#3399
Get the bounding box from the HDF EOS level-1 files and pass it to the array attributes#3399adybbroe wants to merge 2 commits into
Conversation
…ss it to the projectabe channel data array object Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
| array = self._mask_invalid(array, valid_min, valid_max) | ||
| array = self._mask_uncertain_pixels(array, uncertainty, band_index) | ||
| # array = self._mask_rows_all_nan(array) | ||
| info["boundingbox"] = self._boundingbox |
There was a problem hiding this comment.
"bbox"? And I wonder if this should go in the .attrs["orbital_parameters"]?
There was a problem hiding this comment.
Eh I guess it isn't "orbital" though. Nevermind. Ohand I just realized this is a draft. Sorry for early review.
There was a problem hiding this comment.
Do you prefer bbox over boundingbox? Or should it be bounding_box?
There was a problem hiding this comment.
...and yes "orbital_parameters" sounds reasonable
There was a problem hiding this comment.
I think I prefer bbox but bounding_box is maybe OK too. I think I take back what I said about orbital_parameters. I'm not sure it should go there. I think long term it will go in the .attrs of the future SwathDefinition, but the .attrs of the DataArray is good enough for now. But I also still think the min/max of all lon/lats is the way to fix this in pyresample. This bbox solution is a larger undertaking that needs discussion.
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3399 +/- ##
==========================================
- Coverage 96.32% 96.30% -0.02%
==========================================
Files 466 466
Lines 59090 59096 +6
==========================================
- Hits 56917 56912 -5
- Misses 2173 2184 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Get the gringpoint (bounding box) data from the HDF EOS level-1 files, and pass it to the projectabe channel data array object.
AUTHORS.mdif not there alreadyIt can be debated if this PR really closes the issue referenced above. It will then also require Pyresample being enhanced, as suggested in a recent PR there:
pytroll/pyresample#724
If solving the issue without a Pyresample upgrade one should clip the NaN arrays upon reading as discussed in the issue.
There is at least one issue I would like to hear your opinion on: When loading the MODIS data the
HDFEOSBandReaderinit is invoked three times, ones for each radiance file (1km, half km and quarter km), in my example case these are:So, the bounding box is read and set three times. Bounding box is exactly the same in all three as far as I can see...