Skip to content

Commit

Permalink
adding to jpeg tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlysonStahl-NOAA committed Oct 11, 2024
1 parent 045b441 commit ef10ff5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
19 changes: 19 additions & 0 deletions tests/data/ref_simple2jpeg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
1:0:00Z30nov2021:WIND Wind Speed [m/s]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
2:15252:00Z30nov2021:WDIR Wind Direction (from which blowing) [deg]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
3:37893:00Z30nov2021:UGRD U-Component of Wind [m/s]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
4:53788:00Z30nov2021:VGRD V-Component of Wind [m/s]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
5:69056:00Z30nov2021:HTSGW Significant Height of Combined Wind Waves and Swell [m]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
6:79472:00Z30nov2021:PERPW Primary Wave Mean Period [s]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
7:91296:00Z30nov2021:DIRPW Primary Wave Direction [deg]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
8:108527:00Z30nov2021:WVHGT Significant Height of Wind Waves [m]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
9:116700:00Z30nov2021:SWELL Significant Height of Swell Waves [m]:lvl1=(241,1) lvl2=(255,missing):1 in sequence:anl:
10:128814:00Z30nov2021:SWELL Significant Height of Swell Waves [m]:lvl1=(241,2) lvl2=(255,missing):2 in sequence:anl:
11:140828:00Z30nov2021:SWELL Significant Height of Swell Waves [m]:lvl1=(241,3) lvl2=(255,missing):3 in sequence:anl:
12:151710:00Z30nov2021:WVPER Mean Period of Wind Waves [s]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
13:160997:00Z30nov2021:SWPER Mean Period of Swell Waves [s]:lvl1=(241,1) lvl2=(255,missing):1 in sequence:anl:
14:173650:00Z30nov2021:SWPER Mean Period of Swell Waves [s]:lvl1=(241,2) lvl2=(255,missing):2 in sequence:anl:
15:189397:00Z30nov2021:SWPER Mean Period of Swell Waves [s]:lvl1=(241,3) lvl2=(255,missing):3 in sequence:anl:
16:205255:00Z30nov2021:WVDIR Direction of Wind Waves [deg]:lvl1=(1,1) lvl2=(255,missing):surface:anl:
17:218231:00Z30nov2021:SWDIR Direction of Swell Waves [deg]:lvl1=(241,1) lvl2=(255,missing):1 in sequence:anl:
18:237001:00Z30nov2021:SWDIR Direction of Swell Waves [deg]:lvl1=(241,2) lvl2=(255,missing):2 in sequence:anl:
19:259187:00Z30nov2021:SWDIR Direction of Swell Waves [deg]:lvl1=(241,3) lvl2=(255,missing):3 in sequence:anl:
15 changes: 10 additions & 5 deletions tests/run_jpeg_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ echo ""
echo "*** Running wgrib2 jpeg tests"

echo "*** Converting from jpeg to simple packing"
../wgrib2/wgrib2 data/gdaswave.t00z.wcoast.0p16.f000.grib2 -set_grib_type simple -grib_out jpeg2simple.grb
../wgrib2/wgrib2 jpeg2simple.grb -v2 -s > jpeg2simple.txt
touch jpeg2simple.txt
diff -w jpeg2simple.txt data/ref_jpeg2simple.txt
../wgrib2/wgrib2 data/gdaswave.t00z.wcoast.0p16.f000.grib2 -set_grib_type simple -grib_out junk_jpeg2simple.grb
../wgrib2/wgrib2 junk_jpeg2simple.grb -v2 -s > junk_jpeg2simple.txt
touch junk_jpeg2simple.txt
diff -w junk_jpeg2simple.txt data/ref_jpeg2simple.txt

echo "*** Converting from simple back to jpeg packing"
../wgrib2/wgrib2 junk_jpeg2simple.grb -set_grib_type jpeg -grib_out junk_simple2jpeg.grb
../wgrib2/wgrib2 junk_simple2jpeg.grb -v2 > junk_simple2jpeg.txt
diff -w junk_simple2jpeg.txt data/ref_simple2jpeg.txt

echo "*** SUCCESS!"
exit 0
exit 0

0 comments on commit ef10ff5

Please sign in to comment.