-
Notifications
You must be signed in to change notification settings - Fork 38
Clessig/develop/synop datareader #860
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: develop
Are you sure you want to change the base?
Conversation
self.len = len(ds) | ||
|
||
self.offset_data_channels = 4 | ||
self.fillvalue = ds["air_temperature"][0, 0].values.item() |
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 think we should force the user to set a _FillValue attribute in the NetCDF files if there are missing data. I forgot to do this with my file (well actually, if you are using the default fill value of 9.96921e+36, then you don't need to set the flag, however xarray doesn't recognize this).
When _FillValue is set, xr.open_dataset fill automatically convert missing values to NaNs.
self.ds = ds | ||
self.len = len(ds) | ||
|
||
self.offset_data_channels = 4 |
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.
Line 91 can be removed now that the user specifically select channels
|
||
|
||
class DataReaderSynop(DataReaderTimestep): | ||
"Wrapper for SYNOP datasets from MetNo in NetCDF" |
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.
Would it be useful to specify the requirements of the NetCDF file? Here is a suggestion:
Generic parser for station data in NetCDF format. The file must have 2 dimensions: time and location.
- Data variables must have dimensions in the following order (time, location). The names of the dimension can be anything.
- Geoinfo variables must have dimension (location,)
- Any variable with missing values must have the _FillValue attribute set
- A latitude and longitude variable with dimension (location,) must be provided. The units must be degrees and the variable name can be configured.
- A variable called time must be provided and have dimension (time,). Units must follow CF-conventions and the variable must have a units attribute.
Description
Data reader for station-like data in simple netCDF format
Type of Change
Issue Number
Closes #862
Code Compatibility
Code Performance and Testing
uv run train
and (if necessary)uv run evaluate
on a least one GPU node and it works$WEATHER_GENERATOR_PRIVATE
directoryDependencies
Documentation
Additional Notes