<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This is a question for any gdal experts out there. <div><br></div><div>I'm working with reading NetCDF files. gdal does an admirable job of this. Many of the NetCDF climate data files have many bands and I'd like import only some of them. Specifying a particular NetCDF SUBSET will allow gdal to read the data for a particular variable.</div><div><br></div><div>For example, ...</div><div><br></div><div>gdal_translate NETCDF:"/Users/cmbarton/Dropbox/NCAR_files/ppt_A1.SRESA1B_EA1-8.CCSM.atmm.2000-01_cat_2099-12.nc":ppt /Users/cmbarton/Dropbox/NCAR_files/out.tif </div><div><br></div><div>...will translate all of the data sets for the ppt (precipitation) variable</div><div><div><br></div><div>AFAICT, the -mo flag in gdal_translates also allows it to operate on a subset of data specified by a metadata option. But I can't figure out the proper syntax to use it. There are hints in <<a href="http://www.gdal.org/frmt_netcdf.html">http://www.gdal.org/frmt_netcdf.html</a>>, but the exact way to specify relevant metadata still eludes me. It seems like to translate only the bands for which the time variable = <span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: 13px; ">730015.5 days after 1-01-01, I need to run...</span></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; ">gdal_translate -mo ppt#NETCDF_DIMENSION_time=730015.5 NETCDF:"/Users/cmbarton/Dropbox/NCAR_files/ppt_A1.SRESA1B_EA1-8.CCSM.atmm.2000-01_cat_2099-12.nc":ppt /Users/cmbarton/Dropbox/NCAR_files/out.tif</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; ">But this ignores the -mo specification and simply translates all bands.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; ">So does anyone know how to specify the metadata for time in this case?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; ">Thanks</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; ">Michael</div><div><br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><span class="Apple-style-span" style="font-size: 12px; ">_____________________</span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="font-size: 12px; ">C. Michael Barton</div><div style="font-size: 12px; ">Visiting Scientist, Integrated Science Program</div><div style="font-size: 12px; ">National Center for Atmospheric Research &</div><div style="font-size: 12px; ">University Consortium for Atmospheric Research</div><div style="font-size: 12px; ">303-497-2889 (voice)</div><div style="font-size: 12px; "><br></div><div style="font-size: 12px; ">Director, Center for Social Dynamics & Complexity </div><div style="font-size: 12px; ">Professor of Anthropology, School of Human Evolution & Social Change</div><div style="font-size: 12px; ">Arizona State University</div><div style="font-size: 12px; ">www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a>, <a href="http://csdc.asu.edu/">http://csdc.asu.edu</a></div></div><div><br></div></div></span></div></span></div></span></div></div><div><br></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>