Giter VIP home page Giter VIP logo

Comments (3)

isodrosotherm avatar isodrosotherm commented on August 21, 2024 1

awesome, thanks so much Brian! I'm a heavy user of this and find it super useful. You've done great work!

from herbie.

blaylockbk avatar blaylockbk commented on August 21, 2024

You're right that it is caused by reading the data into xarray. I don't know why cfgrib reads this into two separate DataFrames. That would be a good question for the cfgrib repo.

On the Herbie side, it may be possible to work around this; it would require doing something like xarray.concat(ds, dim='step') for the objects returned by hrrr subh.

from herbie.

blaylockbk avatar blaylockbk commented on August 21, 2024

In that last commit, Herbie will try xr.concat(xx, dim='step') on the list of Datasets returned by cfgrib. This works for the HRRR subh fields because the hypercubes have the same variable and level.

from herbie import fast_Herbie_xarray
import pandas as pd

dates = pd.date_range(
    '2022-01-01 1:00', 
    '2022-01-01 3:00',
    freq='1H'
)
fxx = [0,1,2,3]

ds = fast_Herbie_xarray(
    DATES=dates, 
    fxx=fxx, 
    model='hrrr', 
    product='subh', 
    searchString=':PRES:surface'
)
## ^ Took ~20 seconds to load

image

ds.isel(time=0, x=500, y=500).sp.plot(x='valid_time', marker='.')
ds.isel(time=1, x=500, y=500).sp.plot(x='valid_time', marker='.')
ds.isel(time=2, x=500, y=500).sp.plot(x='valid_time', marker='.')

image

@isodrosotherm Thanks for reporting this. These comments always help me improve Herbie.

from herbie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.