webgl-wind icon indicating copy to clipboard operation
webgl-wind copied to clipboard

Trouble running download.sh

Open brendancol opened this issue 4 years ago • 9 comments

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}

brendancol avatar May 02 '20 18:05 brendancol

@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 avatar Aug 10 '20 12:08 lslzl3000

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

lslzl3000 avatar Aug 10 '20 13:08 lslzl3000

@brendancol Is the problem you have solved now?

angel-ycy avatar Jan 09 '21 12:01 angel-ycy

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":}

angel-ycy avatar Jan 09 '21 12:01 angel-ycy

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.

estamos avatar Feb 26 '21 18:02 estamos

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!

angel-ycy avatar Jun 05 '21 15:06 angel-ycy

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);

stevage avatar Jun 21 '21 00:06 stevage

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

nikolamilunovic avatar Aug 27 '21 07:08 nikolamilunovic

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.

grahamkane avatar Aug 31 '21 10:08 grahamkane