<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Nick,&nbsp;<div>If you use the following script, you can convert the data in the third column of&nbsp;20100424_160000.dat&nbsp;(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&nbsp;16777215 to 1.&nbsp;</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&lt;=212930)</div><div>&nbsp;&nbsp;ret = read(file)</div><div>&nbsp;&nbsp;rc = sublin(ret,1)</div><div>&nbsp;&nbsp;data = sublin(ret,2)</div><div>&nbsp;&nbsp;c1 = subwrd(data,1)</div><div>&nbsp;&nbsp;c2 = subwrd(data,2)</div><div>&nbsp;&nbsp;c3 = subwrd(data,3)</div><div>&nbsp;&nbsp;if (c3=16777215)&nbsp;</div><div>&nbsp;&nbsp; &nbsp;'d 1'</div><div>&nbsp;&nbsp;else&nbsp;</div><div>&nbsp;&nbsp; &nbsp;'d 0'</div><div>&nbsp;&nbsp;endif</div><div>&nbsp;&nbsp;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:&nbsp;</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:&nbsp;+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs".&nbsp;</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! &nbsp;I have found a way to convert the geotiffs into gridded data. &nbsp;I have attached 2 of the output files after the conversion (I tried two different formats). &nbsp;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. &nbsp;Maybe someone could help? &nbsp;In the .dat file, I believe the 3 columns are Y,X, and either 0 (no oil) or 16777215 for oil. &nbsp;I am not sure why the converter picked that number. &nbsp;Thanks an advance for the help!<br><br>-Nick<br><br>----- Original Message -----<br>From: Jennifer Adams &lt;<a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a>&gt;<br>Date: Tuesday, December 21, 2010 10:48 am<br>Subject: Re: [gradsusr] Geotiffs in Grads<br>To: GrADS Users Forum &lt;<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>&gt;<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 &nbsp;<br></blockquote><blockquote type="cite">GrADS. Turning the information in a geotiff file into a grid of <br></blockquote><blockquote type="cite">values &nbsp;<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. &nbsp;I have geotiffs of the oil locations and I was &nbsp;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">wondering if there is any way to read those into Grads. &nbsp;I also <br></blockquote></blockquote><blockquote type="cite">have &nbsp;<br></blockquote><blockquote type="cite"><blockquote type="cite">the locations in .gif files. &nbsp;If that is not possible, does <br></blockquote></blockquote><blockquote type="cite">anyone &nbsp;<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 &nbsp;<br></blockquote><blockquote type="cite"><blockquote type="cite">apply equations to (such as a wind drift to watch how it moved &nbsp;<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 &nbsp;<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:&gt; &nbsp;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"> &nbsp;&nbsp;&nbsp;&nbsp;<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"> &nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.zlib.net">http://www.zlib.net</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;<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"> &nbsp;&nbsp;&nbsp;&nbsp;<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"> &nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.ijg.org">http://www.ijg.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;<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"> &nbsp;&nbsp;&nbsp;&nbsp;<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"> &nbsp;&nbsp;&nbsp;&nbsp;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"> &nbsp;&nbsp;&nbsp;&nbsp;<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"> &nbsp;&nbsp;&nbsp;&nbsp;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"> &nbsp;&nbsp;&nbsp;&nbsp;<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"> &nbsp;&nbsp;&nbsp;&nbsp;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"> &nbsp;&nbsp;&nbsp;&nbsp;<a href="http://hdfgroup.org">http://hdfgroup.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;HDF 4.2r3<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;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"> &nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.libtiff.org">http://www.libtiff.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;<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"> &nbsp;&nbsp;&nbsp;&nbsp;<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>&lt;20100424_160000.zip&gt;</span><span>&lt;20100424_160000.asc&gt;</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>