HackerTrans
TopNewTrendsCommentsPastAskShowJobs

ElPeque

no profile record

Submissions

[untitled]

1 points·by ElPeque·há 10 meses·0 comments

Show HN: GribStream – Query Weather Forecasts Like a Database

gribstream.com
13 points·by ElPeque·ano passado·8 comments

Show HN: Creating Skew-T Log-P diagrams from the Rapid Refresh (RAP) model

github.com
6 points·by ElPeque·há 2 anos·0 comments

Show HN: Gribstream.com – Historical Weather Forecast API

gribstream.com
71 points·by ElPeque·há 2 anos·35 comments

GribStream: Historical Weather Forecasts API – with free tier

gribstream.com
2 points·by ElPeque·há 2 anos·1 comments

comments

ElPeque
·ano passado·discuss
It seems like Safari's support of chunked-streamed mp4 is lacking. If you have issues please consider trying Chrome or Firefox for now.
ElPeque
·ano passado·discuss
Ok. Should work now. :)
ElPeque
·ano passado·discuss
Oh shit. I fucked up. I'll fix it in a moment :facepalm:
ElPeque
·há 2 anos·discuss
Since TODAY GribStream.com now also leverages the NOAA Rapid Refresh (RAP) model https://rapidrefresh.noaa.gov/. It enables SkewT LogP charting for which I added a python example on the github repo. I hope you will find it useful.

You can check the example here: https://github.com/GribStream/python-client
ElPeque
·há 2 anos·discuss
Every hour these models forecast every hour 10 or 15 days ahead. The further ahead they become less accurate of course.

Having all historical weather forecasts is useful to backtest how accurate the model is because you can compare what was being forecasted at the time with what actually happened.

It is also useful to backtest derived models. If you want to figure out how accurate your model is forecasting something like solar power generation while using one of these weather datasets as features for cloud cover and solar radiation, you will want to run the model with the forecast that was current at that point in time. Otherwise you would be "cheating" by using data you wouldn't have had if you ran the model at that time.

In other words, you'd want to "see" the weather as it was being predicted at the time in order to find out what your model would predict for solar power generation.

I hope that makes sense.
ElPeque
·há 2 anos·discuss
Definitely more models right now. GribStream.com will be supporting many other models soon.

But open-meteo free access is only for non-commercial use. GribStream.com allows any use.

Also, can open-meteo query forecasts 10 days out at hourly resolution for 150.000 coordinates in a single request and take just 8 seconds? At what price?

I'll do a benchmark soon.
ElPeque
·há 2 anos·discuss
Thank you!
ElPeque
·há 2 anos·discuss
Shoot me an email and I'll reach out when I can implement selecting based on bounds.

Out of the top of my head, re-slicing into grib files for the response is probably a big lift but some of the other formats like maybe netCDF or geoTIFF or just compressed array of floats might be a nice MVP.

[email protected]
ElPeque
·há 2 anos·discuss
This is really great feedback. The truth is that the pricing model is being figured out, so if you have a specific type of use in mind maybe we could figure out what works best and it might become the actual default pricing model.

I tried to tie the pricing with the amount of processing that the API needs to do, which is closely related to the number of grib2 files that the API needs to download and process in order to create the response. And it doesn't change as much wether I extract 1 point or 1000 points. But I thought I had to draw the line somewhere or nobody would ever pay for anything because the freetier is enough.

But I might make it same price for maybe chunks of 5000 or more points.

From the line of business I come from the main usage is actually to extract scattered coordinates (think weather where specific assets are, like hotels or solar panels or wind farms) and not whole boundaries at full resolution but it makes a lot of sense that for other types of usage that is not the case.

It is definitely in the roadmap to be able to select based on lat/lon bounds and even shapes. Also to return data not as timeseries but the gridded data itself, either as grib2 or netCDF or parquet or a plain matrix of floats or png or even mp4 video.
ElPeque
·há 2 anos·discuss
Yeah, exactly.

I basically scrape all the grib index files to know all the offsets into all variables for all time. I store that in clickhouse.

When the API gets a request for a time range, set of coordinates and a set of weather parameters, first I pre-compute the mapping of (lat,lon) into the 1 dimensional index in the gridded data. That is a constant across the whole dataset. Then I query the clickhouse table to find out all the files+offset that need to be processed and all of them are queued into a multi-processing pool. And then processing each parameter implies parsing a grib file. I wrote a grib2 parser from scratch in golang so as to extract the data in a streaming fashion. As in... I don't extract the whole grid only to lookup the coordinates in it. I already pre-computed the index, so I can just decode every value in the grid in order and when I hit and index that I'm looking for, I copy it to a fixed size buffer with the extracted data. When You have all the pre-computed indexes then you don't even need to finish downloading the file, I just drop the connection immediately.

It is pretty cool. It is running in very humble hardware so I'm hoping I'll get some traction so I can throw more money into it. It should scale pretty linearly.

I've tested doing multi-year requests and the golang program never goes over 80Mb of memory usage. The CPUs get pegged so that is the limiting factor.

Grib2 complex packing (what the NBM dataset uses) implies lots of bit-packing. So there is a ton more to optimize using SIMD instructions. I've been toying with it a bit but I don't want to mission creep into that yet (fascinating though!).

I'm tempted to port this https://github.com/fast-pack/simdcomp to native go ASM.
ElPeque
·há 2 anos·discuss
Oh wow. Those are really cool visualizations. I can't compete :P
ElPeque
·há 2 anos·discuss
True!

Fixed!

Thank you!
ElPeque
·há 2 anos·discuss
In theory it could be done. It is sort of analogous to what GribStream is doing already.

The grib2 files are the storage. They are sorted by time in the path and so that is used like a primary index. And then grib2 is just a binary format to decode to extract what you want.

I originally was going to write this as a plugin for Clickhouse but in the end I made it a Golang API cause then I'm less constrained to other things. Like, for example, I'd like to create and endpoint to live encode the gribfiles into MP4 so the data can be served as Video. And then with any video player you would be able to playback, jump to times, etc.

I might still write a clickhouse integration though because it would be amazing to join and combine with other datasets on the fly.
ElPeque
·há 2 anos·discuss
The point of GribStream is that you don't need to download the grided data (cause as you say it is huge! and it grows many Gb every single hour for years).

This is an API that will do streaming extraction and only have you download what you actually need.

When you make the http request to the API, the API will be processing up to terabytes of data only to respond to you with maybe a few Kb of csv.
ElPeque
·há 2 anos·discuss
Interesting!

Can you describe how it worked? Who knows, maybe I could make it happen.

I've been thinking of creating a more involved "demo" to entice traffic/links/SEO. Maybe something like this could be it.
ElPeque
·há 2 anos·discuss
Grib2 files are much more compact than netCDF, just less convenient to use. But GribStream takes care of that and just returns you the timeseries for the coordinates you need.

Besides using the usual index files to only do http range requests for weather parameters of interest, GribStream also avoids creating big memory buffers to decode/decompress the whole grid. It does the decoding in a streaming fashion and only accumulates the values that are being looked for so it can do so very efficiently. It doesn't even finish downloading the partial grib file, it early aborts. And it also skips ahead many headers and parts of the grib2 format that are not really required or that can be assumed for being constant in the whole dataset. In other words, it cuts all possible corners and the parse is (currently) specifically optimized for the NBM and GFS datasets.

Although I intend to support several others, like the Rapid Refresh (RAP) model.

And the fact that this process runs close to the data (AWS), it can do so way faster than you can run it anywhere else.
ElPeque
·há 2 anos·discuss
Glad you like it! I hope it will suit your work.
ElPeque
·há 2 anos·discuss
Interesting!

This is a little different though.

This dataset is is part of the AWS Open Data program and so it is freely available from S3. By running the API within AWS then you get a massive latency and bandwidth advantage.

So with GribStream you are pushing the computation closer to where the big data is and only downloading the small data. And GribStream uses a custom grib2 parser that allows it to extract the data in a streaming fashion, using very little memory.

It makes a huge difference if you need to extract timeseries of a handful of coordinates for months at a time.

Cheers!
ElPeque
·há 2 anos·discuss
Excited shamelessly promote my indie hacking project, GribStream, with the HN community! GribStream offers full access to historical weather data and forecasts through an efficient API. It's built for meteorologists, researchers, and anyone needing reliable weather data. Features include:

A free tier to help you get started Full history of weather forecasts Extract timeseries for thousands of coordinates, for months at a time, at hourly resolution in a single http request taking only seconds. Supports as-of/time-travel, indispensable for proper backtesting Automatic gap filling of any missing data with the next best (most recent) forecast.

It currently leverages the National Blend of Models (NBM) with more datasets to come.

High efficiency and low latency access to GRIB data I'm eager to hear your feedback and suggestions!