mapbox / webgl-wind

Wind power visualization with WebGL particles
https://mapbox.github.io/webgl-wind/demo/
ISC License
956 stars 212 forks source link

Trouble running download.sh #15

Open brendancol opened 4 years ago

brendancol commented 4 years ago

Loving this wind layer example, but having trouble running it locally.

Thanks in advance!

{"u":no messages found in utmp.grib,"v":no messages found in vtmp.grib}
lslzl3000 commented 4 years ago

@mourner Same problem, is the API of nomads.necp.noaa.gov still working? the request for http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_1p00.pl?file=gfs.t00z.pgrb2.1p00.f000&lev_10_m_above_ground=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=%2Fgfs.2016112000 is not working: the result shows: Data file is not present: /common/data/model/com/gfs/prod/gfs.2016112000/gfs.t00z.pgrb2.1p00.f000

lslzl3000 commented 4 years ago

I think the new url is GFS_URL="https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_${RES}.pl?file=gfs.t${GFS_TIME}z.pgrb2.${RES}.f000&${LEVEL}${BBOX}&dir=%2Fgfs.${GFS_DATE}%2F${GFS_TIME}" The changes are: http to https, and ${GFS_DATE}${GFS_TIME} to ${GFS_DATE}%2F${GFS_TIME}

And the tmp.json from the result is also different now, some changes are also required for prepare.js

angel-ycy commented 3 years ago

@brendancol Is the problem you have solved now?

angel-ycy commented 3 years ago

I've changed the URL ,but the following error still appears,so how to solve it ./download.sh: line 13: grib_set: command not found ./download.sh: line 14: grib_set: command not found ./download.sh: line 16: grib_dump: command not found ./download.sh: line 16: grib_dump: command not found undefined:1 {"u":,"v":}

estamos commented 3 years ago

I've changed the URL ,but the following error still appears,so how to solve it ./download.sh: line 13: grib_set: command not found ./download.sh: line 14: grib_set: command not found ./download.sh: line 16: grib_dump: command not found ./download.sh: line 16: grib_dump: command not found undefined:1 {"u":,"v":}

This means ecCodes is not installed in your system. You can install it by running brew install eccodes on macOS or apt-get install libeccodes-tools on Linux.

angel-ycy commented 3 years ago

I've changed the URL ,but the following error still appears,so how to solve it ./download.sh: line 13: grib_set: command not found ./download.sh: line 14: grib_set: command not found ./download.sh: line 16: grib_dump: command not found ./download.sh: line 16: grib_dump: command not found undefined:1 {"u":,"v":}

This means ecCodes is not installed in your system. You can install it by running brew install eccodes on macOS or apt-get install libeccodes-tools on Linux.

I've already installed eccodes, but having trouble running it locally.

% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 103k 0 103k 0 0 57362 0 --:--:-- 0:00:01 --:--:-- 57331 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 103k 0 103k 0 0 73502 0 --:--:-- 0:00:01 --:--:-- 73502 events.js:165 throw err; ^

Error: Uncaught, unspecified "error" event. (No data provided) at emit (events.js:163:17) at PNG.pack (/media/data1/ycy/webgl-wind/node_modules/pngjs/lib/png.js:54:10) at Object. (/media/data1/ycy/webgl-wind/data/prepare.js:30:5) at Module._compile (module.js:577:32) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.runMain (module.js:611:10) at run (bootstrap_node.js:394:7) Thanks in advance!

stevage commented 3 years ago

I found I had to change the URL as follows:

GFS_URL="https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_${RES}.pl?file=gfs.t${GFS_TIME}z.pgrb2.${RES}.anl&lev_max_wind=on&${BBOX}&dir=%2Fgfs.${GFS_DATE}%2F${GFS_TIME}%2Fatmos"

and update prepare.js as follows:

const umessage = data.u.messages[0];
const vmessage = data.v.messages[0];

const unpack = (message) =>
    message.reduce((acc, { key, value }) => ({ ...acc, [key]: value }), {});
const u = unpack(umessage);
const v = unpack(vmessage);
nikolamilunovic commented 3 years ago

I found I had to change the URL as follows:

GFS_URL="https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_${RES}.pl?file=gfs.t${GFS_TIME}z.pgrb2.${RES}.anl&lev_max_wind=on&${BBOX}&dir=%2Fgfs.${GFS_DATE}%2F${GFS_TIME}%2Fatmos"

and update prepare.js as follows:

const umessage = data.u.messages[0];
const vmessage = data.v.messages[0];

const unpack = (message) =>
    message.reduce((acc, { key, value }) => ({ ...acc, [key]: value }), {});
const u = unpack(umessage);
const v = unpack(vmessage);

URL Not working for me,

Data file is not present: /common/data/model/com/gfs/prod/gfs.20200701/00/atmos/gfs.t00z.pgrb2.1p00.anl

grahamkane commented 3 years ago

The url seems to have changed again. I found I also needed to change download.sh as grib_set (ecCodes Version 2.22.1) was complaining about the input / output files having identical names:

GFS_URL="https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_${RES}.pl?file=gfs.t${GFS_TIME}z.pgrb2.${RES}.f000&${LEVEL}&${BBOX}&dir=%2Fgfs.${GFS_DATE}/${GFS_TIME}/atmos"

curl "${GFS_URL}&var_UGRD=on" -o utmp.grib
curl "${GFS_URL}&var_VGRD=on" -o vtmp.grib

grib_set -r -s packingType=grid_simple utmp.grib utmp_out.grib
grib_set -r -s packingType=grid_simple vtmp.grib vtmp_out.grib

printf "{\"u\":`grib_dump -j utmp_out.grib`,\"v\":`grib_dump -j vtmp_out.grib`}" > tmp.json

rm utmp.grib vtmp.grib utmp_out.grib vtmp_out.grib

This worked along with the changes to prepare.js previously mentioned.