Your files are in Float32 format, try rescaling them to 8bit: gdal_translate -ot Byte<br><br><div><span class="gmail_quote">2007/1/20, Chase, Andrew <<a href="mailto:achase@mbari.org">achase@mbari.org</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<p><font face="Arial" size="2">Hi All,</font>
</p>
<p><font face="Arial" size="2">I'm trying to convert a netcdf file to some an image format that I can use with imagemagick (tiff, jpg, png, anything will do). Unfortunately, I'm having some troubles getting the job done. When I try gdal_translate with any format other than Gtiff I get a completely black image. When I use the Gtiff format, I get a weird grayscale mutated version of my source file, with strange grainy vertical bands. When I open the netcdf file in OpenEV it looks perfectly normal, and I use the netcdf file for a lot of different data processing, so I feel confident that the data itself is good (if not the formatting of the data).
</font></p>
<p><font face="Arial" size="2">I've placed a subsetted version of the translated image online to show what the resulting geotiff looks like, it's here:</font></p>
<p><a href="http://www.mbari.org/staff/achase/vdm/hrbath.tif" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><u><font color="#0000ff" face="Arial" size="2">http://www.mbari.org/staff/achase/vdm/hrbath.tif
</font></u></a>
<br><font face="Arial" size="2">Maybe someone else has seen this same type of image problem?</font>
</p>
<p><font face="Arial" size="2">Here's the gdalinfo output:</font>
</p>
<p><font face="Arial" size="2">C:\workspace\vdm\resources\grids>gdalinfo NETCDF:"<a href="http://hrbath.nc" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hrbath.nc</a>":elevation</font>
<br><font face="Arial" size="2">Driver: netCDF/Network Common Data Format</font>
<br><font face="Arial" size="2">Size is 5001, 4001</font>
<br><font face="Arial" size="2">Coordinate System is `'</font>
<br><font face="Arial" size="2">Origin = (-125.000000000000000,38.000999999999998)</font>
<br><font face="Arial" size="2">Pixel Size = (0.000999800039992,-0.000999750062484)</font>
<br><font face="Arial" size="2">Metadata:</font>
<br><font face="Arial" size="2"> NC_GLOBAL#creationDate=01/19/2007</font>
<br><font face="Arial" size="2"> NC_GLOBAL#lastModified=01/19/2007</font>
<br><font face="Arial" size="2"> NC_GLOBAL#Conventions=CF-1.0</font>
<br><font face="Arial" size="2"> NC_GLOBAL#CreatedBy=VARS Data Mining Software - MBARI</font>
<br><font face="Arial" size="2"> NC_GLOBAL#title=DEM Grid from hrbath.asc</font>
<br><font face="Arial" size="2"> NC_GLOBAL#institution=MBARI</font>
<br><font face="Arial" size="2"> NC_GLOBAL#creator_name=Andrew Chase</font>
<br><font face="Arial" size="2"> NC_GLOBAL#keywords=dem bathymetry grid</font>
<br><font face="Arial" size="2"> elevation#positive=up</font>
<br><font face="Arial" size="2"> elevation#long_name=Elevation</font>
<br><font face="Arial" size="2"> elevation#missing_value=-9.999900e+004</font>
<br><font face="Arial" size="2"> elevation#units=meters</font>
<br><font face="Arial" size="2"> latitude#units=degrees_north (+N/-S)</font>
<br><font face="Arial" size="2"> longitude#units=degrees_east (+E/-W)</font>
<br><font face="Arial" size="2">Corner Coordinates:</font>
<br><font face="Arial" size="2">Upper Left (-125.0000000, 38.0010000)</font>
<br><font face="Arial" size="2">Lower Left (-125.0000000, 34.0010000)</font>
<br><font face="Arial" size="2">Upper Right (-120.0000000, 38.0010000)</font>
<br><font face="Arial" size="2">Lower Right (-120.0000000, 34.0010000)</font>
<br><font face="Arial" size="2">Center (-122.5000000, 36.0010000)</font>
<br><font face="Arial" size="2">Band 1 Block=5001x1 Type=Float32, ColorInterp=Undefined</font>
<br><font face="Arial" size="2"> NoData Value=-99999</font>
<br><font face="Arial" size="2"> Metadata:</font>
<br><font face="Arial" size="2"> NETCDF_VARNAME=elevation</font>
<br><font face="Arial" size="2">----------------------------------------------------------------------------------------------------------</font>
</p>
<p><font face="Arial" size="2">And here's the translation I'm trying:</font>
</p>
<p><font face="Arial" size="2">C:\workspace\vdm\resources\grids>gdal_translate -of GTiff -a_nodata -99999 NETCD</font>
<br><font face="Arial" size="2">F:"<a href="http://hrbath.nc" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hrbath.nc</a>":elevation hrbath.tif</font>
<br><font face="Arial" size="2">Input file size is 5001, 4001</font>
<br><font face="Arial" size="2">0...10...20...30...40...50...60...70...80...90...100 - done.</font>
<br><font face="Arial" size="2">----------------------------------------------------------------------------------------------------------</font>
</p>
<p><font face="Arial" size="2">And the resulting gdalinfo output:</font>
</p>
<p><font face="Arial" size="2">C:\workspace\vdm\resources\grids>gdalinfo hrbath.tif</font>
<br><font face="Arial" size="2">Driver: GTiff/GeoTIFF</font>
<br><font face="Arial" size="2">Size is 5001, 4001</font>
<br><font face="Arial" size="2">Coordinate System is `'</font>
<br><font face="Arial" size="2">Origin = (-125.000000000000000,38.000999999999998)</font>
<br><font face="Arial" size="2">Pixel Size = (0.000999800039992,-0.000999750062484)</font>
<br><font face="Arial" size="2">Metadata:</font>
<br><font face="Arial" size="2"> NC_GLOBAL#creationDate=01/19/2007</font>
<br><font face="Arial" size="2"> NC_GLOBAL#lastModified=01/19/2007</font>
<br><font face="Arial" size="2"> NC_GLOBAL#Conventions=CF-1.0</font>
<br><font face="Arial" size="2"> NC_GLOBAL#CreatedBy=VARS Data Mining Software - MBARI</font>
<br><font face="Arial" size="2"> NC_GLOBAL#title=DEM Grid from hrbath.asc</font>
<br><font face="Arial" size="2"> NC_GLOBAL#institution=MBARI</font>
<br><font face="Arial" size="2"> NC_GLOBAL#creator_name=Andrew Chase</font>
<br><font face="Arial" size="2"> NC_GLOBAL#keywords=dem bathymetry grid</font>
<br><font face="Arial" size="2"> elevation#positive=up</font>
<br><font face="Arial" size="2"> elevation#long_name=Elevation</font>
<br><font face="Arial" size="2"> elevation#missing_value=-9.999900e+004</font>
<br><font face="Arial" size="2"> elevation#units=meters</font>
<br><font face="Arial" size="2"> latitude#units=degrees_north (+N/-S)</font>
<br><font face="Arial" size="2"> longitude#units=degrees_east (+E/-W)</font>
<br><font face="Arial" size="2">Corner Coordinates:</font>
<br><font face="Arial" size="2">Upper Left (-125.0000000, 38.0010000)</font>
<br><font face="Arial" size="2">Lower Left (-125.0000000, 34.0010000)</font>
<br><font face="Arial" size="2">Upper Right (-120.0000000, 38.0010000)</font>
<br><font face="Arial" size="2">Lower Right (-120.0000000, 34.0010000)</font>
<br><font face="Arial" size="2">Center (-122.5000000, 36.0010000)</font>
<br><font face="Arial" size="2">Band 1 Block=5001x1 Type=Float32, ColorInterp=Gray</font>
<br><font face="Arial" size="2"> NoData Value=-99999</font>
<br><font face="Arial" size="2"> Metadata:</font>
<br><font face="Arial" size="2"> NETCDF_VARNAME=elevation</font>
</p>
<br>
<br>
<p><font face="Courier New" size="2">Any ideas of what to try would be appreciated.</font>
</p>
<p><font face="Courier New" size="2">-Andrew</font>
</p>
<br>
<p><font face="Courier New" size="2">Andrew C. Chase</font>
<br><font face="Courier New" size="2">Software Engineer</font>
<br><font face="Courier New" size="2">Monterey Bay Aquarium Research Institute</font>
</p>
</div>
<br>_______________________________________________<br>Gdal-dev mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Gdal-dev@lists.maptools.org">Gdal-dev@lists.maptools.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.maptools.org/mailman/listinfo/gdal-dev" target="_blank">
http://lists.maptools.org/mailman/listinfo/gdal-dev</a><br><br></blockquote></div><br><br clear="all"><br>-- <br><br>Hernán De Angelis<br>Linux user # 397217