The -s flag is used for importing two's-complement signed data.
The -h flag is used to read region information from a Generic Mapping Tools (GMT) type binary header. It is compatible with GMT binary grid types 1 and 2.
The north, south, east, and west field values are the coordinates of the edges of the geographic region. The rows and cols values describe the dimensions of the matrix of data to follow. If the input is a GMT binary array (-h flag), the six dimension fields (north, south, east, west, rows and cols) are obtained from the GMT header. If the bytes field is entered incorrectly an error will be generated suggesting a closer bytes value.
r.in.bin can be used to import numerous binary arrays including: ETOPO30, ETOPO-5, ETOPO-2, Globe DEM, BIL, AVHRR and GMT binary arrays (ID 1 & 2).
The geographic coordinates north, south, east, and west describe the outer edges of the geographic region. They run along the edges of the cells at the edge of the geographic region and not through the center of the cells at the edges.
Eastern limit of geographic region (in projected coordinates must be east
of the west parameter value, but in geographical coordinates will wrap
around the globe; user errors can be detected by comparing the ewres and
nsres values of the imported map layer carefully).
Western limit of geographic region (in projected coordinates must be west
of the east parameter value, but in geographical coordinates will wrap
around the globe; user errors can be detected by comparing the ewres and
nsres values of the imported map layer carefully).
Notes on (non)signed data:
If you use the -s flag, the highest bit is the sign bit. If this is 1, the data is negative, and the data interval is half of the unsigned (not exactly).
This flag is only used if bytes= 1. If bytes is greater than 1, the flag is ignored.
r.in.bin -sb input=E020N90.DEM output=gtopo30 bytes=2 north=90 south=40 east=60 west=20 r=6000 c=4800
(you can add "anull=-9999" if you want sea level to have a NULL value)
r.in.bin -hf input=sample.grd output=sample.grass
(-b could be used to swap bytes if required)
r.in.bin in=p07_b6.dat out=avhrr c=128 r=128
r.in.bin ETOPO2.dos.bin out=ETOPO2min r=5400 c=10800 n=90 s=-90 w=-180 e=180 bytes=2 r.colors ETOPO2min rules=terrain
r.in.bin -sb input=e020n40.Bathymetry.srtm output=e020n40_topex \ bytes=2 north=40 south=-10 east=60 west=20 r=6000 c=4800 r.colors e020n40_topex rules=etopo2
YEAR="2000" MONTH="01" # number of days of this month MDAYS=`date -d"${YEAR}-${MONTH}-01 + 1 month - 1 day" +%d` r.in.bin in=gpcp_1dd_v1.2_p1d.${YEAR}${MONTH} out=gpcp_${YEAR}.${MONTH}. \ order=big bytes=4 -f header=1440 anull=-99999 \ n=90 s=-90 w=0 e=360 rows=180 cols=360 bands=$MDAYS
The following is a sample call of r.in.bin to import GPCP v2.2 data:
r.in.bin in=gpcp_v2.2_psg.1979 out=gpcp_1979. \ order=big bytes=4 -f header=576 anull=-99999 \ n=90 s=-90 w=0 e=360 rows=72 cols=144 bands=12
Available at: r.in.bin source code (history)
Accessed: Sunday Jan 22 07:36:12 2023
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
© 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual