-
Notifications
You must be signed in to change notification settings - Fork 3
feat/sentinel2 pydantic model #64
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
base: main
Are you sure you want to change the base?
Conversation
…ter sentinel models
…to feat/sentinel2-pydantic-model
…to feat/sentinel2-pydantic-model
|
@emmanuelmathot have a look. this adds pydantic models for the structure of the sentinel1 and sentinel2 zarr hierarchies. These models also have reprs for jupyter notebooks that make browsing the structure of the hierarchy intuitive:
|
|
these models are not refined because I have not started using them yet in the other parts of the codebase, and also I am not yet sure which aspects of sentinel1 and sentinel2 data are invariant. but they will be a solid declarative foundation for a conversion API. |
emmanuelmathot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually would love to have some examples to test as linked in the readme
|
I added separate models for the different sentinel1 / 2 platforms, added tests for our python examples in the docs, and added some simple demos of the models for the docs |
I think I will need another PR before i have good examples -- right now these models are pretty low-level; once they are integrated into the higher-level API, then this process will inform the shape of useful examples |
emmanuelmathot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just have Sentinel1 and 2 without platform distinctions
| "Sentinel2ReflectanceGroup", | ||
| "Sentinel2ResolutionDataset", | ||
| "Sentinel2Root", | ||
| "Sentinel2ARoot", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not make any distinction in the Sentinel A, B or C platform. There is no difference, they are just twins.
|
|
||
| This document demonstrates the basic usage of models for Sentinel-1 L2 data products. These models only describe the Zarr hierarchy; they do not support reading and writing array values. | ||
|
|
||
| ## Sentinel-1A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to distinguish the platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are some s1a exclusive fields:
Quality Group
- noise_azimuth - Noise characteristics in azimuth direction
- noise_range - Noise characteristics in range direction
Antenna Pattern Group
- count - Count of antenna pattern elements
- slant_range_time_ap - Slant range time specifically for antenna pattern
- swath - Swath designation
GCP (Ground Control Points) Group
- azimuth_time_gcp - GCP-specific azimuth time array
- ground_range - Ground range values
- slant_range_time_gcp - Slant range time specific to GCP
S1C replaces some of these S1A-specific fields with simpler alternatives:
- Uses slant_range_time instead of slant_range_time_ap and slant_range_time_gcp
- Removes GCP-specific metadata (azimuth_time_gcp, ground_range)
- Removes antenna pattern metadata (count, swath)
- Removes noise azimuth/range subgroups entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these consistent differences or is this just drift in the zarr structure?

this PR adds pydantic models for the sentinel1 and sentinel2 zarr hierarchies. These models can be used as the basis for an API against these data products.