我有同样的问题,所以我想使用 wgrib2 命令提取 TMP 并保存每个点(csv 文件的站点列表),但出现错误。我正在使用 while do 循环,如下所示:
ifile="GSM_GPV_Rgl_I"$yyyymmddhh"_grib2.bin" #.nc4 file to read
istnlst="/media/moza/Elements//work1/guidance/temp/Station_Table.csv" #list of lat-lon for which to extract TS
ofile="_tmp_gpv.csv"
while IFS=-,- read -r p; do
echo -e "Reading station..... "$p
stn=$(echo $p | cut -d ',' -f 1)
out="/media/moza/Elements/work1/guidance/temp/gpvdata/"$yyyymmddhh"_"$stn$ofile
lon=$(echo $p | cut -d ',' -f 2)
lat=$(echo $p | cut -d ',' -f 3)
wgrib2 "GSM_GPV_Rgl_I"$yyyymmddhh"_grib2.bin" \
-match ":TMP:" -match ":24 hour fcst:|:36 hour fcst:" \
-v p -Lon lon lat -csv > $out
sed -i -e "/value/"$stn"/1"$ofile #replace value column name w/ stn name
echo
done < $istnlst
错误是:
Reading station..... "Nacala",40.716,-14.466 ./station_guidance2221.sh: line 67: /media/moza/Elements/work1/guidance/temp/gpvdata/2021060300_"Nacala"_tmp_gpv.csv: Invalid argument
Reading station..... "Dindiza",33.5,-22.75 ./station_guidance2221.sh: line 67: /media/moza/Elements/work1/guidance/temp/gpvdata/2021060300_"Dindiza"_tmp_gpv.csv: Invalid argument
我需要一些帮助来解决这个问题。