[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #ILA-943980]: convert the variable data in a group from Netcdf4 to netcdf3

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: [netCDF #ILA-943980]: convert the variable data in a group from Netcdf4 to netcdf3
  • Date: Mon, 16 Dec 2019 15:31:17 -0700

If you replace '-v' with '-V', you should see definitions and data only for the 
variable (column_amount) that you are interested in.  The tools provided by 
Unidata (nccopy, ncgen, ncdump) do not offer batch operations, but there are 
other tools that might be able to do what you're looking for.  I'd suggest 
looking at the NetCDF Operators (NCO) software package.  

I hope this helps,

-Ward

> Hi,
> i am trying to extract only the variable as an output from a group out of
> many groups.
> how to copy a variable from a group and convert from netcdf4 to netcdf3:
> iFile name: 'Aura.nc'; ofile name: Aura(3456) Group name:
> 'key_science_data' ; Variable name: 'column_amount'
> in this case
> I run this command:
> 
> D:\CDO>nccopy -g key_science_data -v column_amount Aura.nc Aura3.nc
> D:\CDO>nccopy -g key_science_data -v key_science_data/column_amount Aura.nc
> Aura3.nc
> D:\CDO>nccopy -g key_science_data -v key_science_data/column_amount Aura.nc
> Aura4.nc
> D:\CDO>nccopy -v key_science_data/column_amount Aura.nc Aura4.nc
> D:\CDO>nccopy -v key_science_data/column_amount Aura.nc Aura5.nc
> D:\CDO>nccopy -v column_amount Aura.nc Aura5.nc
> D:\CDO>nccopy -v column_amount Aura.nc Aura6.nc
> 
> The output gives me all the variables in the group instead of one
> (column_amount) variable and the converted file is still in same format.
> 
> Also, Is there a way to extract (or copy) a variable, merge, and convert
> all files in a folder of similar dimension.?
> 
> 



Ticket Details
===================
Ticket ID: ILA-943980
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.