<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks Jennifer,<div><br></div><div>In my case I want all 1308 time dimensions… so I tried:</div><div><br></div><div>GRASS 6.4.1 (globe_30min):~ > r.in.gdal input=NETCDF:"~/Downloads/cru_ts_3_10.1901.2009.pet.dat.nc":PET output=cru_pet </div><div><br></div><div>but got the same error:</div><div><div>ERROR 4: `NETCDF:~/Downloads/cru_ts_3_10.1901.2009.pet.dat.nc:PET' does not exist in the file system,</div><div>and is not recognised as a supported dataset name.</div></div><div><br></div><div>I also tried single instead of double quotes, and give the full pathname instead of the ~/ for my home directory… still not working.</div><div><br></div><div>Also, if you specify PET as the variable of interest, do you still pull in the lat and lon data?</div><div><br></div><div>Thanks</div><div><br></div><div><br></div><div><div><div>On Oct 1, 2012, at 1:22 PM, Jennifer Boehnert <<a href="mailto:boehnert@ucar.edu">boehnert@ucar.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Kirk,<br>
in your r.in.gdal syntax the time_bnds is the variable you want to
read. My guess would be the variable you want to read is pet.<br>
<br>
I would suggestion executing the following commands to read your
file metadata before running the r.in.gdal.<br>
<br><p class="MsoNormal" style="margin-left:.25in"><i style="mso-bidi-font-style:
normal"><span style="font-family:"Cambria","serif";mso-ascii-theme-font:major-latin;mso-hansi-theme-font:major-latin;mso-bidi-font-family:Calibri;mso-bidi-theme-font:
minor-latin">gdalinfo
D:\data\projects\courses2012\IAI\data\B1_tas.nc<br>
</span></i></p>
<div class="moz-cite-prefix">
<link rel="File-List" href="file:///C:%5CUsers%5Cboehnert%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml">
<link rel="themeData" href="file:///C:%5CUsers%5Cboehnert%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx">
<link rel="colorSchemeMapping" href="file:///C:%5CUsers%5Cboehnert%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">
<br>
This will give you the variable names in your dataset. In your
case I see PET<br>
<br>
Then to find the dimensions on the variable of interest execute
The syntax is your netCDF name : variable name<br><p class="MsoNormal" style="margin-left:.25in"><i style="mso-bidi-font-style:
normal"><span style="font-family:"Cambria","serif";mso-ascii-theme-font:major-latin;mso-hansi-theme-font:major-latin;mso-bidi-font-family:Calibri;mso-bidi-theme-font:
minor-latin">gdalinfo
NETCDF:D:\data\projects\courses2012\IAI\data\A2_tas.nc:tasC
<o:p></o:p></span></i></p>
<link rel="File-List" href="file:///C:%5CUsers%5Cboehnert%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml">
<link rel="themeData" href="file:///C:%5CUsers%5Cboehnert%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx">
<link rel="colorSchemeMapping" href="file:///C:%5CUsers%5Cboehnert%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">
In my example the netCDF name is A2_tas.nc an the variable I
want is tasC (temperature in degrees celsius). My data has 10
temporal dimensions.<br>
You should put <netCDF Name>:PET<br>
<br>
Now that I know this I run the r.in.gdal<br><p class="MsoNormal" style="margin-left:.25in"><i style="mso-bidi-font-style:
normal"><span style="font-family:"Cambria","serif";mso-ascii-theme-font:major-latin;mso-hansi-theme-font:major-latin;mso-bidi-font-family:Calibri;mso-bidi-theme-font:
minor-latin">r.in.gdal -o -e input=NETCDF:
D:\data\projects\courses2012\IAI\data\A2_tas.nc:tasC
output=SRESA2_tas<o:p></o:p></span></i></p>
In this example I am bringing in all times if you want specify
just 1 time you can do so by using the
<link rel="File-List" href="file:///C:%5CUsers%5Cboehnert%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml">
<link rel="themeData" href="file:///C:%5CUsers%5Cboehnert%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx">
<link rel="colorSchemeMapping" href="file:///C:%5CUsers%5Cboehnert%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">
BAND number.<br>
Jennifer</div>
On 10/1/2012 12:02 PM, Kirk Wythers wrote:<br>
</div>
<blockquote cite="mid:7B81B70A-278B-41D9-B8BF-AF202696C91A@gmail.com" type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
I am trying to read some netCDF data (from the CRU climate
database) into grass. I am looking at the netcdf wiki page and
having a little trouble translating the instructions there to the
output I am getting from "gdalinfo". Here is the
<div><br>
</div>
<div>If I am trying to use syntax that looks something like:</div>
<div>
<pre style="font-family: monospace, 'Courier New'; padding: 1em; border: 1px dashed rgb(47, 111, 171); background-color: rgb(249, 249, 249); line-height: 1.3em; font-size: 13px; position: static; z-index: auto; ">r.in.gdal input=NETCDF:"sst.nc":time_bnds output=sst</pre>
<div>I am getting the following error:</div>
</div>
<div><br>
</div>
<div>
<div>ERROR 4:
`NETCDF:~/Downloads/cru_ts_3_10.1901.2009.pet.dat.nc:time_bnds'
does not exist in the file system,</div>
<div>and is not recognised as a supported dataset name.</div>
</div>
<div><br>
</div>
<div>In my case, the PATH_TO_FILE is</div>
<div><br>
</div>
<div>"~/Downloads/cru_ts_3_10.1901.2009.pet.dat.nc"</div>
<div><br>
</div>
<div>However, I can't tell what to use in the place of
":time_bnds". Any ideas from the pasted text below of what my
input argument should look like?</div>
<div><br>
</div>
<div>Thanks in advance,</div>
<div><br>
</div>
<div>Kirk</div>
<div><br>
</div>
<div><br>
</div>
<div>Here is output I am looking at from gdalinfo:</div>
<div><br>
</div>
<div>
<div>GRASS 6.4.1 (globe_30min):~ > gdalinfo
~/Downloads/cru_ts_3_10.1901.2009.pet.dat.nc </div>
<div>ERROR 1: GDAL/GRASS57 driver was compiled against GDAL 1.8
but current library version is 1.9</div>
<div><br>
</div>
<div>ERROR 1: GDAL/GRASS57 driver was compiled against GDAL 1.8
but current library version is 1.9</div>
<div><br>
</div>
<div>Driver: netCDF/Network Common Data Format</div>
<div>Files: /Network/Servers/<a moz-do-not-send="true" href="http://truffula.fr.umn.edu/Volumes/disk1/home1/kirkw/Downloads/cru_ts_3_10.1901.2009.pet.dat.nc">truffula.fr.umn.edu/Volumes/disk1/home1/kirkw/Downloads/cru_ts_3_10.1901.2009.pet.dat.nc</a></div>
<div>Size is 720, 360</div>
<div>Coordinate System is `'</div>
<div>Origin = (-180.000000000000000,90.000000000000000)</div>
<div>Pixel Size = (0.500000000000000,-0.500000000000000)</div>
<div>Metadata:</div>
<div> lat#long_name=latitude</div>
<div> lat#units=degrees_north</div>
<div> lon#long_name=longitude</div>
<div> lon#units=degrees_east</div>
<div> NC_GLOBAL#comment=Data restrictions: for academic
research use only.Contact BADC for details</div>
<div> NC_GLOBAL#contact=BADC <<a moz-do-not-send="true" href="mailto:badc@rl.ac.uk">badc@rl.ac.uk</a>></div>
<div> NC_GLOBAL#Conventions=CF-1.4</div>
<div> NC_GLOBAL#history=Wed Feb 2 03:32:36 GMT 2011 : User
badc : Program makegridsauto.for called by update.for</div>
<div> NC_GLOBAL#institution=Data held at British Atmospheric
Data Centre, RAL, UK.</div>
<div> NC_GLOBAL#references=Information on the data is available
at <a moz-do-not-send="true" href="http://badc.nerc.ac.uk/data/cru/">http://badc.nerc.ac.uk/data/cru/</a></div>
<div> NC_GLOBAL#source=Run ID = 1102011219</div>
<div>Data generated by BADC from:</div>
<div>tmp.1009221824.dtb</div>
<div>dtr.1009221824.dtb</div>
<div>vap.1009221824.dtb</div>
<div>cld.1009221824.dtb</div>
<div> NC_GLOBAL#title=CRU TS 3.10 Potential Evapotranspiration</div>
<div> pet#_FillValue=9.969209968386869e+36</div>
<div> pet#correlation_decay_distance=-999</div>
<div> pet#long_name=potential evapotranspiration</div>
<div> pet#missing_value=9.969209968386869e+36</div>
<div> pet#units=mm</div>
<div> time#calendar=gregorian</div>
<div> time#long_name=time</div>
<div> time#units=days since 1900-1-1</div>
<div>Corner Coordinates:</div>
<div>Upper Left (-180.0000000, 90.0000000) </div>
<div>Lower Left (-180.0000000, -90.0000000) </div>
<div>Upper Right ( 180.0000000, 90.0000000) </div>
<div>Lower Right ( 180.0000000, -90.0000000) </div>
<div>Center ( 0.0000000, 0.0000000) </div>
<div>Band 1 Block=720x1 Type=Float64, ColorInterp=Undefined</div>
<div> NoData Value=9.96920996838686905e+36</div>
<div> Metadata:</div>
<div> _FillValue=9.969209968386869e+36</div>
<div> correlation_decay_distance=-999</div>
<div> long_name=potential evapotranspiration</div>
<div> missing_value=9.969209968386869e+36</div>
<div> NETCDF_DIMENSION_time=380</div>
<div> NETCDF_time_units=days since 1900-1-1</div>
<div> NETCDF_VARNAME=pet</div>
<div> units=mm</div>
<div>Band 2 Block=720x1 Type=Float64, ColorInterp=Undefined</div>
<div> NoData Value=9.96920996838686905e+36</div>
<div> Metadata:</div>
<div> _FillValue=9.969209968386869e+36</div>
<div> correlation_decay_distance=-999</div>
<div> long_name=potential evapotranspiration</div>
<div> missing_value=9.969209968386869e+36</div>
<div> NETCDF_DIMENSION_time=410</div>
<div> NETCDF_time_units=days since 1900-1-1</div>
<div> NETCDF_VARNAME=pet</div>
<div> units=mm</div>
</div>
<div>.</div>
<div>.</div>
<div>.</div>
<div>.</div>
<div>
<div>Band 1308 Block=720x1 Type=Float64, ColorInterp=Undefined</div>
<div> NoData Value=9.96920996838686905e+36</div>
<div> Metadata:</div>
<div> _FillValue=9.969209968386869e+36</div>
<div> correlation_decay_distance=-999</div>
<div> long_name=potential evapotranspiration</div>
<div> missing_value=9.969209968386869e+36</div>
<div> NETCDF_DIMENSION_time=40161</div>
<div> NETCDF_time_units=days since 1900-1-1</div>
<div> NETCDF_VARNAME=pet</div>
<div> units=mm</div>
</div>
<div><br>
</div>
<div><br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div></body></html>