Git Product home page Git Product logo

wind-js-server's Introduction

wind-js-server NPM version NPM Downloads

Simple demo rest service to expose GRIB2 wind forecast data (1 degree, 6 hourly from NOAA) as JSON.

Consumed in leaflet-velocity. Contains a pre-packaged copy of grib2json for conversion.

Data Vis demo here: http://danwild.github.io/leaflet-velocity

Note that this is intended as a crude demonstration, not intended for production use. To get to production; you should improve upon this or build your own.

install, run:

(assumes you have node and npm installed)

# from project root:
npm install
npm start

endpoints

  • /latest returns the most up to date JSON data available
  • /nearest returns JSON data nearest to requested
    • $GET params:
      • timeIso an ISO timestamp for temporal target
      • searchLimit number of days to search beyond the timeIso (will search backwards, then forwards)
  • /alive health check url, returns simple message

License

MIT License (MIT)

wind-js-server's People

Contributors

danwild avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wind-js-server's Issues

最新的NOAA的数据源提供的路径为/00/atmos,以及window环境下执行grib2json路径配置

NOAA 路径

var stamp = moment(targetMoment).format('YYYYMMDD') + roundHours(moment(targetMoment).hour(), 6);
var years = moment(targetMoment).format('YYYYMMDD')
var hour = roundHours(moment(targetMoment).hour(), 6);
image

window环境使用bin/的grib2json工具路径配置:

app.js:
child = exec('converter\bin\grib2json --data --output json-data\' + stamp + '.json --names --compact grib-data\' + stamp + '.f000',
image

经过上述改动后可以直接成功获取数据并解析存储成grib2json数据

Can you explain the meaning of value 'data' in out.json?

[{"header":{"discipline":0,"disciplineName":"Meteorological products","gribEdition":2,"gribLength":49047,"center":7,"centerName":"US National Weather Service ,"data":[253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253.8,253]}]?

Error: hit limit, harvest complete or there is a big gap in data..

Hi danwild,

I try to run your wind-js-server and consumed data in wind-js-leaflet but after 2 minutes I have this error in wind-js-server:

response 404 | 2017121700 response 404 | 2017121618 response 404 | 2017121612 hit limit, harvest complete or there is a big gap in data..

Could you explain for me why I had this error ? and another problem is data seem not correct because now temperature in my region is lower than in data. Thank you
screen shot 2018-01-16 at 5 44 59 pm

Is f000 really forecast?

This tool is great @danwild !
But it seems to simply download f000 files, which WAS the forecast for the latest moment (it was the f006 of the previous moment, 6 hours ago, f012 twelve hours ago, etc...).
AFAIK, f000 is only useful to compare forecast with real weather (.anl file, stands for analyzed).

To really get forecast, we should get f003, f006, f012, ... FROM the latest moment available and update them each 6 hours, right?

Analyzing past data is nice, but Readme implies forecast and none of the data is actually forecasting the future AFAIU.

Feel free to kindly prove me wrong 😄

GRIB edition 62 is not yet supported - error

I've started getting this error on conversion...

running server on port 7000
response 200 | 2019020718
piping 2019020718
exec error: Error: Command failed: converter/bin/grib2json --data --output json-data/2019020718.json --names --compact grib-data/2019020718.f000
ucar.grib.NotSupportedException: GRIB edition 62 is not yet supported
	at ucar.grib.grib2.Grib2IndicatorSection.<init>(Grib2IndicatorSection.java:123)
	at ucar.grib.grib2.Grib2Input.scan(Grib2Input.java:175)
	at net.nullschool.grib2json.Grib2Json.write(Grib2Json.java:104)
	at net.nullschool.grib2json.Launcher.main(Launcher.java:75)

any advice / fix ?

Explanation on Grib2 Request information

Hi,

Can you explain how do build the grib2 request parameters? It is best if you could provide the reference documentation.
The server run well with leaflet-velocity. Actually what I trying to do is including more forcast info such as temperature, humidity, pressure,..
I found some infomation here: http://nomads.ncep.noaa.gov/ and http://www.nco.ncep.noaa.gov/pmb/products/gfs/gfs.t00z.pgrb2.1p00.f000.shtml but still not sure how to select the right parameters to obtain the additional data.

Thank you very much,
John

throw new Error('Can\'t set headers after they are sent.');

Hello,
I installed the server and for a few data works fine, but after 5 or 6 request, ended with the following error (see error below): I'am not expert with the "express" library but I think that happens when people treat an asyn c response inside an express route as a synchronous response and they end up sending data twice.
Thanks for your support
Alessandro

attempting to harvest older data 2017102200
response 200 | 2017102118
piping 2017102118
converted..
got older, no need to harvest further
2017102218 doesnt exist yet, trying previous interval..
2017102212 doesnt exist yet, trying previous interval..
_http_outgoing.js:356
throw new Error('Can't set headers after they are sent.');
^

Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:356:11)
at sendLatest (/home/ubuntu/wind-js-server-master/app.js:58:7)
at /home/ubuntu/wind-js-server-master/app.js:62:5
at /home/ubuntu/wind-js-server-master/node_modules/express/lib/response.js:430:22
at onerror (/home/ubuntu/wind-js-server-master/node_modules/express/lib/response.js:1040:5)
at Array.onfinish (/home/ubuntu/wind-js-server-master/node_modules/express/lib/response.js:1058:21)
at listener (/home/ubuntu/wind-js-server-master/node_modules/on-finished/index.js:169:15)
at onFinish (/home/ubuntu/wind-js-server-master/node_modules/on-finished/index.js:100:5)
at callback (/home/ubuntu/wind-js-server-master/node_modules/ee-first/index.js:55:10)
at Socket.onevent (/home/ubuntu/wind-js-server-master/node_modules/ee-first/index.js:93:5)

No wind data

It's arror

no wind data

show after change demo.json to converted json from NOAA this file by grib2json -d -n -o demo.json gfs.t18z.pgrb2.1p00.f000 command

Error to convert grib data

Hi Danwild the converter give me an error:
"exec error: Error: Command failed: converter / b
data / 2019011512.json --names --compact grib-da
"converter" not? recognized as a command in
an executable program or a batch file.__"

No POM file blocks Maven installation

I'm new to Maven, but trying to install wind-js-server on Linux/nginx server fails with error:
"The goal you specified requires a project to execute but there is no POM in this directory"

I've looked through the distribution and found no POM file. Did I miss it? Is it not needed? Thanks for tolerating a noob question.

0...65160, but which way?

Hello,
AFAIU, you get 65160 values (360x181).
Looking at JSON, it seems that start [0],[0] is located at 90,0 (north Pole) and end at south pole, but is it going on longitudes first, like [181],[0] is south pole, then [182][0] is north pole again?
Or is it starting with latitudes first [360][0] (north pole), then [361][0] is 89°,0°?

How is the grid mapped to values?

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.