<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Nick, <div>If you use the following script, you can convert the data in the third column of 20100424_160000.dat (presumably the oil/no-oil grid) into a binary file. Note that dummy.ctl can be any GrADS data set, it is irrelevant, you just need to have some file open, and I changed the 'oil' value from 16777215 to 1. </div><div><br></div><div><div>'open dummy.ctl'</div><div>'set gxout fwrite'</div><div>file = "20100424_160000.dat"</div><div>'set fwrite c3.dat'</div><div>row=1</div><div>while (row<=212930)</div><div> ret = read(file)</div><div> rc = sublin(ret,1)</div><div> data = sublin(ret,2)</div><div> c1 = subwrd(data,1)</div><div> c2 = subwrd(data,2)</div><div> c3 = subwrd(data,3)</div><div> if (c3=16777215) </div><div> 'd 1'</div><div> else </div><div> 'd 0'</div><div> endif</div><div> row = row+1</div><div>endwhile</div><div>rc = close(file)</div><div>'disable fwrite'</div><div><br></div></div><div>After you do that, this descriptor file will load that binary grid into GrADS: </div><div><br></div><div><div>dset ^c3.dat</div><div>xdef 535 linear 1 1</div><div>ydef 398 linear 1 1</div><div>*xdef 535 linear -1.0515988822025 175.4381134356</div><div>*ydef 398 linear -58.3371844811313 175.4013801622</div><div>title c3</div><div>undef -9.99e8</div><div>zdef 1 levels 0</div><div>tdef 1 linear 1jan0001 1dy</div><div>vars 1</div><div>c3 0 99 c3</div><div>endvars</div></div><div><br></div><div>I left the 0's in as valid data and used -9.99e8 as a missing value, but you could use 0 as an undef if you wanted to. The commented out lines for xdef and ydef reflect the values in the first and second columns of your original .dat file (by the way, it's not a good practice to give a file containing ascii a .dat extension). I don't know what those grid values mean -- you must figure out if or how they map to latitude and longitude. I couldn't figure out the geolocation by loading your geotiff file into Quantum GIS, a tool that will display a Geotiff, but it did provide this metadata: "Layer Spatial Reference System: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs". </div><div><br></div><div>--Jennifer</div><div><br></div><div><br><div><div>On Dec 21, 2010, at 2:54 PM, Nick Heath wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br><br>Thank you both for the help! I have found a way to convert the geotiffs into gridded data. I have attached 2 of the output files after the conversion (I tried two different formats). Now, I am a bit lost on how to make a control file with this data as I am used to working with Grib or netcdf. Maybe someone could help? In the .dat file, I believe the 3 columns are Y,X, and either 0 (no oil) or 16777215 for oil. I am not sure why the converter picked that number. Thanks an advance for the help!<br><br>-Nick<br><br>----- Original Message -----<br>From: Jennifer Adams <<a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a>><br>Date: Tuesday, December 21, 2010 10:48 am<br>Subject: Re: [gradsusr] Geotiffs in Grads<br>To: GrADS Users Forum <<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br><br><blockquote type="cite">Hi, Nick --<br></blockquote><blockquote type="cite">What you are asking for is a 'dtype geotiff' which does not exist <br></blockquote><blockquote type="cite">in <br></blockquote><blockquote type="cite">GrADS. Turning the information in a geotiff file into a grid of <br></blockquote><blockquote type="cite">values <br></blockquote><blockquote type="cite">that you can analyze with GrADS is a job for customized stand-alone <br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">code. You may find some useful utilities to help you get started in <br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">the libgeotiff distribution.<br></blockquote><blockquote type="cite">--Jennifer<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Dec 21, 2010, at 10:29 AM, Nick Heath wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Hi everyone,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I am working with oil spill data, and I need a way to display the <br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">oil in my model. I have geotiffs of the oil locations and I was <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">wondering if there is any way to read those into Grads. I also <br></blockquote></blockquote><blockquote type="cite">have <br></blockquote><blockquote type="cite"><blockquote type="cite">the locations in .gif files. If that is not possible, does <br></blockquote></blockquote><blockquote type="cite">anyone <br></blockquote><blockquote type="cite"><blockquote type="cite">have any good ideas of how I could make a "blob" of oil that I <br></blockquote></blockquote><blockquote type="cite">could <br></blockquote><blockquote type="cite"><blockquote type="cite">apply equations to (such as a wind drift to watch how it moved <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">through time)?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Here is the config of the Grads I'm using:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Config: v2.0.a8 little-endian readline printim grib2 netcdf hdf4-<br></blockquote></blockquote><blockquote type="cite">sds <br></blockquote><blockquote type="cite"><blockquote type="cite">hdf5 opendap-grids,stn geotiff shapefile<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Grid Analysis and Display System (GrADS) Version 2.0.a8<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Copyright (c) 1988-2010 by Brian Doty and the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Institute for Global Environment and Society (IGES)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">This program is distributed WITHOUT ANY WARRANTY<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">See file COPYRIGHT for more information.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Built Fri Mar 26 10:24:10 EDT 2010 for x86_64-unknown-linux-gnu<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">This version of GrADS has been configured with the following <br></blockquote></blockquote><blockquote type="cite">options:> o Built on a LITTLE ENDIAN machine<br></blockquote><blockquote type="cite"><blockquote type="cite"> o Athena Widget GUI DISABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> o Command line editing ENABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://tiswww.case.edu/php/chet/readline/rltop.html">http://tiswww.case.edu/php/chet/readline/rltop.html</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> o printim command for image output ENABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://www.zlib.net">http://www.zlib.net</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://www.libpng.org/pub/png/libpng.html">http://www.libpng.org/pub/png/libpng.html</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://www.libgd.org/Main_Page">http://www.libgd.org/Main_Page</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> o GRIB2 interface ENABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://www.ijg.org">http://www.ijg.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://www.ece.uvic.ca/~mdadams/jasper">http://www.ece.uvic.ca/~mdadams/jasper</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2">http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> g2clib-1.1.8<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> o NetCDF interface ENABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://www.unidata.ucar.edu/software/netcdf">http://www.unidata.ucar.edu/software/netcdf</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> netcdf 4.1.1-rc2 of Mar 23 2010 09:31:58 $<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> o OPeNDAP gridded data interface ENABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> o OPeNDAP station data interface ENABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://iges.org/grads/gadoc/supplibs.html">http://iges.org/grads/gadoc/supplibs.html</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> libgadap 2.0<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> o HDF4 and HDF5 interfaces ENABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://hdfgroup.org">http://hdfgroup.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> HDF 4.2r3<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> HDF5 1.8.4<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> o GeoTIFF and KML output ENABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://www.libtiff.org">http://www.libtiff.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://geotiff.osgeo.org">http://geotiff.osgeo.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> o Shapefile interface ENABLED<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> <a href="http://shapelib.maptools.org">http://shapelib.maptools.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Thanks for the help!<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Nick<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">gradsusr mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite">Jennifer M. Adams<br></blockquote><blockquote type="cite">IGES/COLA<br></blockquote><blockquote type="cite">4041 Powder Mill Road, Suite 302<br></blockquote><blockquote type="cite">Calverton, MD 20705<br></blockquote><blockquote type="cite"><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><span><20100424_160000.zip></span><span><20100424_160000.asc></span>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></div></blockquote></div><br><div apple-content-edited="true"> <div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></div> </div><br></div></body></html>