| 1 |
# Tests for r3.out.netcdf and r3.in.netcdf |
| 2 |
# This script tests the export of voxel data using r3.out.netcdf |
| 3 |
# as well as the import of the generated data with r3.in.netcdf |
| 4 |
|
| 5 |
# We set up a specific region in the |
| 6 |
# @preprocess step of this test. We generate |
| 7 |
# voxel data with r3.mapcalc. The region setting |
| 8 |
# should work for UTM and LL test locations |
| 9 |
g.region s=-90 n=90 w=-180 e=180 b=0 t=5 res=10 res3=10 tbres=1 -p3 |
| 10 |
# We create several (float, double, null value) voxel map |
| 11 |
# with value = col + row + depth. |
| 12 |
r3.mapcalc --o expr="volume_float = float(col() + row() + depth())" |
| 13 |
r3.mapcalc --o expr="volume_double = double(col() + row() + depth())" |
| 14 |
r3.mapcalc --o expr="volume_time_double = double(col() + row() + depth())" |
| 15 |
r3.mapcalc --o expr="volume_time_float = float(col() + row() + depth())" |
| 16 |
r3.timestamp map=volume_time_double date='1 Jan 2001/5 Jan 2001' |
| 17 |
r3.support map=volume_time_double vunit="days" |
| 18 |
r3.timestamp map=volume_time_float date='5 seconds/10 seconds' |
| 19 |
r3.support map=volume_time_float vunit="seconds" |
| 20 |
# @test |
| 21 |
r3.out.netcdf --o input=volume_float output=test_float.nc |
| 22 |
r3.info volume_float |
| 23 |
ncdump -h test_float.nc |
| 24 |
r3.out.netcdf --o null=-100 input=volume_double output=test_double.nc |
| 25 |
r3.info volume_double |
| 26 |
ncdump -h test_double.nc |
| 27 |
r3.out.netcdf --o -p input=volume_time_double output=test_time_double.nc |
| 28 |
r3.info volume_time_double |
| 29 |
ncdump -h test_time_double.nc |
| 30 |
r3.out.netcdf --o -p null=-1000 input=volume_time_float output=test_time_float.nc |
| 31 |
r3.info volume_time_float |
| 32 |
ncdump -h test_time_float.nc |
| 33 |
|
| 34 |
g.remove -f type=raster_3d name=volume_float,volume_double,volume_time_double,volume_time_float |