Questions tagged [ncks]

17 questions
8
votes
2 answers

NCO: Extract a variable from NetCDF file using NCO ncks

I am trying to extract a variable from a multi-variable netcdf file, by entering the command: ncks -v ta temp1.nc out.nc However then I look at the out.nc header, all the variables are still there. The headers of both temp1.nc and out.nc are…
F. Brazil
  • 199
  • 1
  • 1
  • 10
2
votes
1 answer

Duplicating Monthly Data to Bi-monthly in a NetCDF File

I have a monthly .nc file from ISIMIP. Here's the time series: time = "2000-01-01", "2000-02-01", "2000-03-01", "2000-04-01", "2000-05-01", "2000-06-01", "2000-07-01", "2000-08-01", "2000-09-01", "2000-10-01", "2000-11-01", "2000-12-01",…
rocinantes
  • 39
  • 4
2
votes
3 answers

Need assistance in Appending two netcdf files based choosing time period

I have two netcdf files: 1) BB_001.nc with 337 records with record variable as time; 2) BB_002.nc which is continuation of the simulation with 385 records (record variable is also time). Therefore, these two files have one overlap record. $ ncdump…
ssorou1
  • 23
  • 2
2
votes
2 answers

nco cut daily netcdf file to 10 minute files

I have a daily netcdf file (20060101) and the time dimension has 144 steps, so 10 minutes time steps within the file. Now I want to create one netcdf file for each 10 min time step with nco. So at the end it should create 144 files. I already found…
Krystian
  • 887
  • 5
  • 21
  • 52
1
vote
2 answers

nco cut daily netcdf file from 10AM to 10AM everyday with duplicated 10am entries

I am a very beginner of nco, and I want to split my .nc file (from 1996010110 to 2019123110) as daily file, from 10AM to 10PM. In that case, each split file contains YYYY-MM-DD:10:00 to YYYY-MM-(DD+1):10:00. Note that the end hour of DD day is…
Xu Shan
  • 175
  • 3
  • 11
1
vote
1 answer

Extract text from variable in netCDF file using ncks

I am trying to extract the variable "flash_lon" from a file and output to a text file in plain text - using ncks. When I use the following command, it displays the variables I need on screen and outputs to a file. ncks -v flash_lon -x file.nc…
David
  • 605
  • 2
  • 14
  • 44
1
vote
2 answers

Extracting data with NCO bounded by variable values

Is it possible to pull out all data within a region (or specific cells) that meet criteria set by a variable rather than a dimension? For example, I'm looking to pull data within a height ('HGT') bounded region. Hyperslabbing seems to requires…
bwc
  • 1,028
  • 7
  • 18
1
vote
1 answer

nco extracting data from netCDF with hyperslab

I have a netCDF file with ten minute resolution data. I would like to extract the hourly data from this and write a new netCDF file that grabs the data at the top of each hour in the original ten minute file. I think that I would do this with the…
HM14
  • 689
  • 1
  • 10
  • 30
0
votes
1 answer

How to extract all variables that start with specific string from netCDF file?

I am working with a netCDF file that has a lot of variables and I need to extract only those that start with the string Var_. The only answers that I found that came close to what I am asking were done by using ncdump however I need to do that with…
I.M.
  • 344
  • 3
  • 14
0
votes
1 answer

Extract NetCDF Variable and create New NetCDF

I need some help with manipulating NetCDF files. In total I have 10 files for 10 years respectively. Each year hast multiple (the same) variables, some of them also covering daily values. Here, I show you one example for the structure: (base)…
Thessla7
  • 17
  • 3
0
votes
2 answers

Create loop for ncks to extract NetCDF data from Hycom using Python

I already have written a ncks code to extract data from the Hycom Database, however, due to server issues I can only download one timestep at a time. I need a loop that allows me to download singular timestep data for the time period of one…
0
votes
1 answer

ncks: ERROR received 3 filenames; need no more than two

I have six CSV files which I have sent in this link (https://drive.google.com/drive/folders/1GQtyY1mI1YrK8GFP9SEo7dZfFHexKro3?usp=sharing). Each of these files has 720 rows and 360 columns which indicates longitude and latitude respectively. The…
Nazanin
  • 29
  • 3
0
votes
1 answer

multiply variables in two NetCDF files in single command

I have two netcdf files: file_1.nc with variables qty_1 and qty_2 and file_2.nc with variables qty_3, qty_4 and qty_5. I want a file with 3 variables qty_3=qty_3*qty_2; qty_4=qty_4+qty_2 and qty_5. Now I am first copying the variables to file_2…
amo
  • 99
  • 1
  • 7
0
votes
1 answer

Concatenate netcdf files with multiple 'record' dimensions

Let's consider those two files: from netCDF4 import Dataset as dset for i in range(2): with dset('test_{}.nc'.format(i),'w') as f: f.createDimension('A',5) f.createDimension('B',8) …
Seb
  • 1,765
  • 9
  • 23
0
votes
1 answer

Hyperslab of a 4D netcdf variable using ncks

I have a large large netcdf file, of which I only need certain data. Therefore, I want to create a subdivision of this netcdf file using ncks. The netcdf file is as following: Source: F:\LECOB\Model\20091208_195356.nc Format: …
Jellyse
  • 839
  • 7
  • 22
1
2