question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weird issue with 'step' value from seasonal forecasts

See original GitHub issue

I have downloaded a dataset from seasonal-monthly-single-levels with starting month 1 and lead-time from 1 to 4 for several years. I have loaded the grib file with: d = xr.open_dataset('/path/to/grib', engine = 'cfgrib') and in the step field I get some strange numbers:

<xarray.DataArray 'step' (step: 7)>
array([ 2678400000000000,  5097600000000000,  5184000000000000,
        7776000000000000,  7862400000000000, 10368000000000000,
       10454400000000000], dtype='timedelta64[ns]')
Coordinates:
  * step     (step) timedelta64[ns] 31 days 59 days ... 120 days 121 days
    surface  int64 ...
Attributes:
    standard_name:  forecast_period
    long_name:      time since forecast_reference_time

Apparently, the steps take into account the variable number of days for February. This is a big problem because for some values of step I have NaN in some years with the impossibility to calculate climatologies for example.

Instead, I would expect to have step with the same size of leadtime_month. Is this an expected behaviour? Can you suggest a way to deal with this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
matteodefelicecommented, Dec 7, 2018

This is my request:

c.retrieve(
    'seasonal-monthly-single-levels',
    {
        'originating_centre':'ecmwf',
        'variable':'mean_sea_level_pressure',
        'product_type':'monthly_mean',
        'year':[
            '1993','1994','1995',
            '1996','1997','1998',
            '1999','2000'
        ],
        'month':'01',
        'leadtime_month':[
            '1','2','3'
        ],
        'format':'grib'
    },
    'download.grib')

This one works perfectly with grib_to_netcdf (grib_api version 1.26.1 installed from anaconda)

0reactions
alexamicicommented, Sep 24, 2019

Even if this issue is older than #97 I’d like to close this one as duplicate of that as the discussion there has added useful insights. @matteodefelice hope you don’t mind.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving Forecasting Errors - Tableau Help
A seasonal model cannot be computed because the time series is too short. Expand the time series in your view to include more...
Read more >
Seasonal Adjustment Questions and Answers - Census Bureau
The seasonal adjustment procedures can produce distorted estimates of the seasonal factors if a series has an unusual value or a sudden shift...
Read more >
How Bad Data Will Beat a Good Forecast Every Time!! - LinkedIn
Step 1. Data cleaning and data quality check. With just a simple flow ... Are there any unusual values that can distort the...
Read more >
Holt-Winters Forecasting and Exponential Smoothing Simplified
It can handle lots of complicated seasonal patterns by simply finding the central value, then adding in the effects of slope and seasonality....
Read more >
Time Series Analysis: Seasonal Adjustment Methods
Six values at each end of the series are lost as a result of the end point problem - only symmetric filters are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found