[GRASS-user] Set rasters with inf values to nodata

Hello all,

I have a set of geotiffs that have inf (infinity) values that I would like to set to nodata. How can I do that in GRASS or gdal?

Thanks!

Bob

Robert Moskovitz

California Geological Survey

Seismic Hazards Zonation Program

CONFIDENTIALITY NOTICE: This communication is intended only for the use of the individual or entity to which it is addressed. This message contains information from the State of California, California Geological Survey, which may be privileged, confidential and exempt from disclosure under applicable law, including the Electronic Communications Privacy Act. If the reader of this communication is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.

On Wed, Mar 19, 2014 at 8:18 PM, Moskovitz, Bob@DOC
<Bob.Moskovitz@conservation.ca.gov> wrote:

Hello all,

I have a set of geotiffs that have inf (infinity) values that I would like
to set to nodata. How can I do that in GRASS or gdal?

what does

gdalinfo -mm yourrastermap.tif

report as Min/Max?

Markus

Thanks for looking into this.

Here it is:
R:\SpecialProjects\tsunami work>gdalinfo --version
GDAL 1.10.1, released 2013/08/26
R:\SpecialProjects\tsunami work\>gdalinfo -mm NETCDF:pola_cascadiad_sift2.nc:max_speed
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Driver: netCDF/Network Common Data Format
Files: pola_cascadiad_sift2.nc
Size is 1810, 1100
Coordinate System is `'
Origin = (-118.302500000118700,33.779999999966194)
Pixel Size = (0.000092592592580,-0.000092592592587)
Metadata:
  lat#long_name=latituded
  lat#units=degrees_north
  lon#long_name=longitude
  lon#units=degrees_east
  max_speed#long_name=Maximum Current Speed
  max_speed#missing_value=-1e+034
  max_speed#units=centimeters/second
Corner Coordinates:
Upper Left (-118.3025000, 33.7800000)
Lower Left (-118.3025000, 33.6781481)
Upper Right (-118.1349074, 33.7800000)
Lower Right (-118.1349074, 33.6781481)
Center (-118.2187037, 33.7290741)
Band 1 Block=1810x1 Type=Float64, ColorInterp=Undefined
    Computed Min/Max=0.000,1.#IO
  NoData Value=-9.9999999999999995e+033
  Metadata:
    long_name=Maximum Current Speed
    missing_value=-1e+034
    NETCDF_VARNAME=max_speed
    units=centimeters/second

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: Sunday, March 30, 2014 2:39 PM
To: Moskovitz, Bob@DOC
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Set rasters with inf values to nodata

On Wed, Mar 19, 2014 at 8:18 PM, Moskovitz, Bob@DOC <Bob.Moskovitz@conservation.ca.gov> wrote:

Hello all,

I have a set of geotiffs that have inf (infinity) values that I would
like to set to nodata. How can I do that in GRASS or gdal?

what does

gdalinfo -mm yourrastermap.tif

report as Min/Max?

Markus

On Tue, Apr 1, 2014 at 6:43 PM, Moskovitz, Bob@DOC
<Bob.Moskovitz@conservation.ca.gov> wrote:

Thanks for looking into this.

Here it is:
R:\SpecialProjects\tsunami work>gdalinfo --version
GDAL 1.10.1, released 2013/08/26
R:\SpecialProjects\tsunami work\>gdalinfo -mm NETCDF:pola_cascadiad_sift2.nc:max_speed
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Driver: netCDF/Network Common Data Format
Files: pola_cascadiad_sift2.nc

...

Band 1 Block=1810x1 Type=Float64, ColorInterp=Undefined
    Computed Min/Max=0.000,1.#IO

Honestly, I have never seen such Max value.

Maybe a GDAL or dataset issue?

  NoData Value=-9.9999999999999995e+033
  Metadata:
    long_name=Maximum Current Speed
    missing_value=-1e+034
    NETCDF_VARNAME=max_speed
    units=centimeters/second

Markus

This is the first time I've seen such Max values too. But I have been able to solve my problem by converting these files to Arc/info ASCII Grids and replace all "1.#INF" to my nodata value. I'll see if anyone on the GDAL ML can help me.

-Bob

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: Tuesday, April 01, 2014 12:39 PM
To: Moskovitz, Bob@DOC
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Set rasters with inf values to nodata

On Tue, Apr 1, 2014 at 6:43 PM, Moskovitz, Bob@DOC <Bob.Moskovitz@conservation.ca.gov> wrote:

Thanks for looking into this.

Here it is:
R:\SpecialProjects\tsunami work>gdalinfo --version GDAL 1.10.1,
released 2013/08/26 R:\SpecialProjects\tsunami work\>gdalinfo -mm
NETCDF:pola_cascadiad_sift2.nc:max_speed
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Driver: netCDF/Network Common Data Format
Files: pola_cascadiad_sift2.nc

...

Band 1 Block=1810x1 Type=Float64, ColorInterp=Undefined
    Computed Min/Max=0.000,1.#IO

Honestly, I have never seen such Max value.

Maybe a GDAL or dataset issue?

  NoData Value=-9.9999999999999995e+033
  Metadata:
    long_name=Maximum Current Speed
    missing_value=-1e+034
    NETCDF_VARNAME=max_speed
    units=centimeters/second

Markus