[ncl-talk] downloading partial netcdf file

Dennis Shea shea at ucar.edu
Tue Jun 11 11:36:19 MDT 2019


Actually, Cathy's '*ncks*' method could be used from within a script using
just about any language.
An NCL example where an NCO operator is invoked is at:

*http://www.ncl.ucar.edu/Applications/system.shtml*
<http://www.ncl.ucar.edu/Applications/system.shtml>

See the section:
*     Using NCL with environment variables to set variables from within a
shell script*

Create a *NCO* or *CDO* command and execute it via *system*. The example
uses *ncrcat *but* ncks *[any *NCO*] could be used*.*
[snip]

      ncocmd= "*ncrcat* -v TEMP " + diri + fili + "*.nc "+diro+filo+nyear+".nc"
      *print* ("ncocmd = "+ncocmd)  ; echo for tracking purposes
      *system* (ncocmd)



On Mon, Jun 10, 2019 at 12:34 PM Micah Sklut <micahs2005 at gmail.com> wrote:

> Okay, great. Thanks for your help, ncks looks like the tool I've been
> looking for.
>
> On Mon, Jun 10, 2019 at 2:18 PM Cathy Smith <cathy.smith at noaa.gov> wrote:
>
>> You could use ncks for a single line extraction (see PSD page below that
>> Dennis helpfully supplied). e.g.
>>
>>  ncks -v lat
>> https://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/interp_OLR/olr.mon.mean.nc
>> a.nc
>>
>> or
>>
>> ncks -v olr
>> https://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/interp_OLR/olr.mon.mean.nc
>> a.nc
>>
>> (ncks keeps coordinate variables too)
>>
>> NCL will read and write a netCDF file with a single variable usinfg the
>> OPEnDAP URL though you have to write a few lines of code. You could even
>> make that work as command line routine and read in variable/file to save.
>>
>> I'm sure there are other ways, too.
>>
>> Cathy
>>
>>
>> On 6/10/19 11:35 AM, Dennis Shea wrote:
>>
>>
>> re: " ... *only downloading specific variables of a NetCDF file"*
>>
>> The question is unclear. In what context?
>> Are you talking about accessing a variable from a remote site [ eg: a
>> NOAA server ] from within a NCL script?
>>      See: *https://www.ncl.ucar.edu/Applications/opendap.shtml*
>> <https://www.ncl.ucar.edu/Applications/opendap.shtml>
>>
>> ----
>>
>> The ESRL: PSD site provides
>> *https://www.esrl.noaa.gov/psd/data/gridded/using_dods.html#software*
>> <https://www.esrl.noaa.gov/psd/data/gridded/using_dods.html#software>
>>
>> links to a number of tools to do what you want
>>
>> Good luck
>>
>> On Mon, Jun 10, 2019 at 10:01 AM Micah Sklut <micahs2005 at gmail.com>
>> wrote:
>>
>>> I haven't found any info regarding only downloading specific variables
>>> of a NetCDF file, but I just wanted to check with the NCL community in case
>>> I am missing something.
>>>
>>> Thank you.
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>> _______________________________________________
>> ncl-talk mailing listncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>> --
>> ----------------------------------------------
>> NOAA/ESRL PSD and CU CIRES
>> 303-497-6263https://www.esrl.noaa.gov/psd/people/cathy.smith/
>>
>> Emails about data/webpages may get quicker responses from emailing esrl.psd.data at noaa.gov
>>
>>
>
> --
> Micah Sklut
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190611/80cf9c13/attachment.html>


More information about the ncl-talk mailing list