Marine Science: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(→‎Bathymetric data: cleanup stats test)
Line 46: Line 46:




===== Import =====


Process with GMT's img2grd to convert from spherical Mercator projection to geographic coordinates, then import into GRASS
Process with GMT's img2grd to convert from spherical Mercator projection to geographic coordinates, then import into GRASS
Line 70: Line 71:
   # cleanup
   # cleanup
   g.remove topo_NZ_1min_n
   g.remove topo_NZ_1min_n
or, import GMT .grd file directly (introduces FP +0.005 elev error??)
  # convert COARDS-compliant netCDF grdfile to old GMT native .grd
  grdreformat topo_NZ.grd topo_NZ_old.grd=bf
  # import
  r.in.bin -hf in=topo_NZ_old.grd out=topo_NZ_old


To load it into GRASS lat/lon location (spherical):
To load it into GRASS lat/lon location (spherical):

Revision as of 14:12, 24 April 2008

this page is a work in progress

Tools for marine scientists

Bathymetry processing

  • Basic DEM creation: v.in.ascii + v.surf.rst
  • r.in.xyz for processing multibeam sonar swaths
  • r.surf.nnbathy add-on script for creating bathymetic DEMs from input x,y,z data
  • Multibeam sonar swath transect planning script

Bathymetric data


  • Smith and Sandwell 1-minute global elevation, v9.1, August 21, 2007
http://topex.ucsd.edu/marine_topo/mar_topo.html (712mb)

global_topo_1min/README_V9.1.txt file:

Version 9.1 has a very different FORMAT than V8.2
The main differences are that the grid spacing in 
longitude is now 1 minute rather than 2 minutes.
In addition, the latitude range is increased to 
+/- 80.738.  Like the old versions, the elevation(+)
and depth(-) are stored as 2-byte integers to the nearest meter.
An odd depth of say -2001m signifies that this pixel was constrained
by a real depth sounding while an even depth of say -2000m is
a predicted depth.

Here are the parameters for the old and new versions:
param    V8.2     V9.2
___________________________
nlon     10800    21600
nlat     12672    17280
rlt0   -72.006  -80.738
rltf    72.006   80.738
___________________________

The binary format of the integers is bigendian so the bytes need to be 
swapped if you are running on an Intel processor.
Here is a typical command for swapping bytes:
dd if=topo_9.1.img of=topo_9.1.img.swab bs=21600 conv=swab.


Import

Process with GMT's img2grd to convert from spherical Mercator projection to geographic coordinates, then import into GRASS

 img2grd topo_9.1b.img -T1 -S1 -V -R0/360/-80.738/80.738 -m1 -D -Gtopo_all.grd
 # (out of memory, needs 1.4gb)
 # try just for NZ   (W/E/S/N bounds)
 REGION=160/180/-50/-30
 img2grd topo_9.1b.img -T1 -S1 -V -R"$REGION" -m1 -D -Gtopo_NZ.grd
 grd2xyz topo_NZ.grd -S > topo_NZ.xyz

 # get adjusted region bounds and resolution from img2grd output
 # ** check that rows and columns match **
 g.region n=-29.9945810754 s=-50.0056468984 w=160E e=180 \
    ewres=0:01 nsres=0.0126094 -p

 r.in.xyz in=topo_NZ_180.xyz out=topo_NZ_1min fs=tab
 r.colors output=topo_NZ_1min color=etopo2
 # create a r.in.xyz "n" map to test input point coverage
 r.in.xyz in=topo_NZ.xyz out=topo_NZ_1min_n fs=tab method=n
 # check rast map stats, min=max=1 and there should be no null cells
 r.univar topo_NZ_1min_n
 # cleanup
 g.remove topo_NZ_1min_n

or, import GMT .grd file directly (introduces FP +0.005 elev error??)

 # convert COARDS-compliant netCDF grdfile to old GMT native .grd
 grdreformat topo_NZ.grd topo_NZ_old.grd=bf
 # import
 r.in.bin -hf in=topo_NZ_old.grd out=topo_NZ_old


To load it into GRASS lat/lon location (spherical):

Location setup:
http://thread.gmane.org/gmane.comp.gis.gmt.user/918
http://article.gmane.org/gmane.comp.gis.proj-4.devel/192/

Is it even possible to load directly into GRASS? How to set up Merc/Sphere proj?

 # the following does not work correctly, just a trial
 # offset n,s,e,w by 1/2 a grid cell?
 r.in.bin input=topo_9.1b.img output=topo_9.1b \
      title="1' worldwide relief (1.852 km-sq)" \
      -b -s bytes=2 rows=17280 cols=21600 \
      n=80.738 s=-80.738 w=0 e=360

  r.colors output=topo_9.1b color=etopo2

Sidescan sonar processing

  • i.gdalwarp script for georectifying and mosaicking scanned paper rolls into a GeoTIFF

Wave exposure

  • Using GRASS to prepare and process data for the SWAN Wave Model
    • preparing input DEM
    • r.in.mat and r.out.mat


Circulation models

  • Preparing input grids
    • r.in.mat and r.out.mat

Tutorials

Remote Sensing

  • Importing MODIS Aqua SST and Chlorophyll-a data


Mapping and Cartography