Track and write measurement time for area#3168
Track and write measurement time for area#3168gerritholl wants to merge 34 commits intopytroll:mainfrom
Conversation
Start unit test to track time for the SEVIRI HRIT reader. This is to prepare an implementation of pytroll#3161. There is no implementation yet.
Added a first implementation for SEVIRI per-pixel times in ancillary variables. So far just takes the scanline time for all pixels in the scanline.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3168 +/- ##
==========================================
- Coverage 96.34% 96.33% -0.01%
==========================================
Files 463 465 +2
Lines 58974 59113 +139
==========================================
+ Hits 56817 56949 +132
- Misses 2157 2164 +7
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:
|
Pull Request Test Coverage Report for Build 16744116940Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
To track "valid time" through resampling for geostationary satellite data, I'm trying to think of a good way to approach this. My current thinking is that if the user creates the scene with reader_kwargs={"track_time": True}, the file handler adds per-pixel time information to the variable attributes. By putting it inside ancillary variables, dataset_walker and co ensure it gets sliced and resampled along with the parent dataset, so that at the end, an approximate measurement time can be estimated for the resampled scene. But normally ancillary variables are actual variables available in the data file, they remain text attributes until after segments have been concatenated, and then the file handler is called again for every segment, to replace the text label by actual data in ancillary variables. Therefore, I'm not sure if ancillary variables is the right place to put it, or if time should be stored there at all. |
|
Maybe it fits better in a coordinate variable, but not sure if it's valid to have those be not-unique. |
|
Coordinates can probably be non-unique, but are currently dropped in resampling. In case of nearest neighbour resampling, this is due to |
Add time as a coordinate rather than as an auxiliary variable. Start working on resampling time coordinates, so far with a failing test.
Implement time tracking as a float coordinate for SEVIRI L1B HRIT. Retain this through resampling. Add documentation on how to use this.
Adapt ninjo tag test to account for the novelty of optional dynamic tags.
|
Addressing the CodeScene complaint about I am not able to resolve this as part of this PR. |
Refactor getting the valid time out of the ninjogeotiff writer, so that the functionality is available elsewhere.
|
I find it hard to make sense of the |
Remove code leftover from an earlier implementation attempt, that is no longer needed.
pnuu
left a comment
There was a problem hiding this comment.
Some comments and change requests inline.
Pased on Panus review, renamed get_valid_time to get_mean_time. The tag in the ninjogeotiff writer is still called ValidDateID, pending a decision by NinJo developers. Also renamed some local variables to avoid confusion with conventions for imported module shorthands.
|
Docs still failing: |
Fixing two merge conflicts
Add support for the `track_coords` resample keyword argument, so that the mean time tracking introduced in pytroll/satpy#3168 can be used with trollflow2.
Resampling a time coordinate fails if data are not reduced (``reduce_data=False``). This commit adds a test reproducing this error, but does not implement a solution yet.
|
Returned to draft because it fails with |
Track measurement times such that a representative measurement time can be estimated and written for an area.
To include valid time in the filename:
reader_kwargs: {"track_time": True}toScene.__init__, andresample_coords=TruetoScene.resample, anddynamic_fields={"valid_time"}toScene.save_datasets, and{valid_time}in the filename pattern passing toScene.save_datasets.When storing as
ninjogeotiff, time coordinates will be averaged and stored in theninjo_ValidTimeIDtag.An example is included in the PR under
doc/source/examples/valid_time.rst.The PR also does some refactoring in
Scene._resampled_scene, on top of #3178, which should be merged first.Next steps, either within this PR or within one or more later PRs:
AUTHORS.mdif not there already