-
Notifications
You must be signed in to change notification settings - Fork 77
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
seasonal forecast valid-time inconsistency #97
Comments
@EddyCMWF thanks for reporting, this is indeed a rather non trivial bug, or rather a number of bugs.
|
Hi @alexamici The problem here is the limitation of the GRIB1 format to handle this kind of aggregations for long forecasts. As it is described in the GRIB1 section 1, we have octets 18 to 21 to describe that: With those ingredients, using P1 as the startStep and P2 as the endStep, it would not be possible to properly encode aggregations in forecasts longer than 255 The way this was dealt with in these cases was to use Additionally, in those GRIB messages coming from seasonal monthly means, it is present I hope that information is helpful and contributes to the discussion. |
@EddyCMWF and @matteodefelice even if the solution is still far from ideal, new version ECMWF SEAS5 datasets can now be opened correctly as follows:
|
Hi @alexamici ! Can it be that the additional feature in It seems to me that using just But if you look at the values in your example (I have reproduced the same with |
I am not really familiar at all with the code of |
@edupenabad I'm a bit puzzled, when setting BTW, when referencing monthly it is a convention where you put the |
@alexamici I will express a bit more bluntly what I said in my previous comment. It is not that I doubt about it, it is that I am convinced that issue #38 was solved with the feature added in I'll try to elaborate on the problem with a couple of additional examples that I hope will showcase more concisely its implications. If we explore some of the keywords related to time coordinates in a SEAS5 monthly means file:
Note the discrepancy between If we use
As you can see, Finally, regarding your thinking about where to point within an interval as its label, as you know, the encoding of an aggregation across a coordinate is solved in CF with a proper use of 'Cell Boundaries', which unequivocally defines the interval of aggregation. Having that complete definition of the interval, the election of a given value within the interval as its label, it is in my opinion, more a question of uses cases than of personal preferences, and we can easily find reasonable use cases for the beginning, the middle or the end of the interval. I hope those points contribute to disentangle the confusion and help to find the more suitable solution to this issue. |
@edupenabad thank you for your understanding your additional clarification, in fact I confused Let me recap the way I can recognise how SEAS5 encodes the I'll be looking for a generic way to make such a procedure possible because I don't want to add GRIB specific logic into cfgrib as that belong to ecCodes. |
Thanks @alexamici ! I would say that In my opinion, the key element is the use of |
@edupenabad in
If you can confirm that this is what you would expect, I'm quite happy with the API and I'll make a release shortly. |
Hi @alexamici Thanks for this! It looks like
|
@edupenabad great! Now to the questions:
Anyway I'm preparing the next release with support of SEAS5 data. |
I added support to have Release coming in a few minutes. |
Hi! I was almost trusting the |
Hi,
We have been looking at the xarrays and netCDF files produced by cfgrib for the seasonal forecast data. The valid_time recovered using cfgrib is not be exactly consistent with the time stamp recovered by the eccodes grib_to_netcdf method and it may be the case that users are misinterpreting the output they receive.
Using cfgrib, the value of valid_time is the time at the end of the time aggregation window. I think that cfgrib must calculate this as the sum of the time and step.
Using ecCodes, the time outputs is at the start of the aggregation window, which for step index n would be the sum of time and step(n-1).
I am bringing this to you attention so that you can decide the best way to deal with it, but it would be very useful (CDS-toolbox) for us to have access to the start of the time aggregation window in the xarray that is recovered. Otherwise we will have to build some sort of work around in the toolbox. One option could be to output the time bounds of the aggregation period, with an additional dimension of length 2.
Additionally, I think that it is probably necessary to include something in the metadata that the valid_time represents the time at the end of the aggregation window as this may not be what users were expecting.
Please let me know if you need any more information about what I am trying to explain. As an example case use the grib file retrieved with the API request below. The time stamps are different when converted using the grib_to_netcdf and cfgrib approaches.
The text was updated successfully, but these errors were encountered: