webgl-wind
webgl-wind copied to clipboard
Trouble running download.sh
Loving this wind layer example, but having trouble running it locally.
- When I try to download data, I got a
no messages found in utml.grub
error. - Running on OSX Mojave and have the brew dependencies mentioned in readme.
Thanks in advance!
{"u":no messages found in utmp.grib,"v":no messages found in vtmp.grib}
@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
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
@brendancol Is the problem you have solved now?
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":}
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 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 orapt-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.
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);
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
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.