cdo-climate

Calculating ERA5 Daily Total Precipitation using CDO

二次信任 提交于 2020-04-13 17:00:14
问题 Essentially, this is a repost of this question: https://confluence.ecmwf.int/pages/viewpage.action?pageId=149341027 I have downloaded ERA5 from the CDS. The input file has 24 hourly steps (0, 1, 2, 3, 4,..,23) for each calendar day starting from Jan 1 to Dec 31 of each considered year. ECMWF state here https://confluence.ecmwf.int/display/CKB/ERA5%3A+How+to+calculate+daily+total+precipitation that daily total precipitation must be calculated by accumulating precipitation for e.g. Jan 1, 1979

converting an accumulated variable to timestep values in a netcdf file with CDO

爷,独闯天下 提交于 2020-02-25 04:40:29
问题 I have a netcdf-file with about 100 timesteps on a grid with one variable, which is accumulated over the timesteps. I am now interested in calculating the contribution of each timestep to the variable's value (i.e. the difference of consecutive timesteps). Currently I use the following sequence: To extract every single timestep into a new file I use cdo seltimestep,$i ... , calculate each difference into a new file with cdo sub $i ${i-1} ... and merge those new files in the end with cdo

how to convert Grib1 to Netcdf using R?

霸气de小男生 提交于 2020-01-30 02:58:48
问题 I have just downloaded some climate data in grib format. I want to use "R" to convert it to NetCDF format. Furthermore, as the file consists of different variables, I would like to extract one variable at a time into individual files. 回答1: It's hard to answer this without your specific file. You should look into producing reproducible examples, especially if you're posting to the R board. For R, check out library(raster) and library(ncdf4) . I just grabbed the first grib1 file I saw, and put

Is there a way to crop a NETCDF file?

本小妞迷上赌 提交于 2020-01-12 08:15:59
问题 Imagine that you have a file example.nc , that has wind data defined in 90N, 90S, 180E, 180W region. Is there anyway I could in linux, with a simple nc-type command (without extracting the data in matlab/python to rewrite), crop this file to include a smaller region, subset of the above. For example, 30N, 10S, 60E and 30W. 回答1: Yes, using ncks from the NCO package: http://nco.sourceforge.net/nco.html If you know the indices corresponding to the lat/lon range you want, let's say they are 30-40

Is there a way to crop a NETCDF file?

六月ゝ 毕业季﹏ 提交于 2020-01-12 08:14:07
问题 Imagine that you have a file example.nc , that has wind data defined in 90N, 90S, 180E, 180W region. Is there anyway I could in linux, with a simple nc-type command (without extracting the data in matlab/python to rewrite), crop this file to include a smaller region, subset of the above. For example, 30N, 10S, 60E and 30W. 回答1: Yes, using ncks from the NCO package: http://nco.sourceforge.net/nco.html If you know the indices corresponding to the lat/lon range you want, let's say they are 30-40

How to convert a rotated NetCDF back to a normal lat/lon grid?

妖精的绣舞 提交于 2020-01-02 04:57:07
问题 I have a NetCDF file with rotated coordinates. I need to convert it to normal lat/lon coordinates (-180 to 180 for lon and -90 to 90 for lat). library(ncdf4) nc_open('dat.nf') For the dimensions, it shows: [1] " 5 variables (excluding dimension variables):" [1] " double time_bnds[bnds,time] " [1] " double lon[rlon,rlat] " [1] " long_name: longitude" [1] " units: degrees_east" [1] " double lat[rlon,rlat] " [1] " long_name: latitude" [1] " units: degrees_north" [1] " char rotated_pole[] " [1] "

NCO cropping a netcdf file using dimension values rather than indices

自古美人都是妖i 提交于 2020-01-01 19:20:32
问题 CDO can crop a netcdf file in terms of latitude and longitude as long as they are defined in a standard way, and I know that NCO can cut out a subset of a netcdf file along any dimension if you know the range of indices that you want, as stated in the answers to this related question: Is there a way to crop a NETCDF file? However, I was wondering if the ncks hyperslabber can work directly on the values of the dimension, rather than the index values? 回答1: Yes, using a decimal indicates the

How to take a subset from a netCDF file using latitude/longitude boundaries in R

放肆的年华 提交于 2019-12-20 19:41:12
问题 I have a netCDF file that I wish to extract a subset from defined by latitude/longitude boundaries (i.e. a lat/long defined box), using the ‘ncdf’ package in R. A summary of my netCDF file is below. It has two dimensions (latitude and longitude) and 1 variable (10U_GDS4_SFC). It is essentially a lat/long grid containing wind values: [1] "file example.nc has 2 dimensions:" [1] "lat_0 Size: 1280" [1] "lon_1 Size: 2560" [1] "------------------------" [1] "file example.nc has 1 variables:" [1]

netcdf4 extract for subset of lat lon

↘锁芯ラ 提交于 2019-12-17 09:42:21
问题 I would like to extract a spatial subset of a rather large netcdf file. From Loop through netcdf files and run calculations - Python or R from pylab import * import netCDF4 f = netCDF4.MFDataset('/usgs/data2/rsignell/models/ncep/narr/air.2m.1989.nc') # print variables f.variables.keys() atemp = f.variables['air'] # TODO: extract spatial subset How do I extract just the subset of netcdf file corresponding to a state (say Iowa). Iowa has following boundary lat lon: Longitude: 89° 5' W to 96° 31

NCO: Extract a variable from NetCDF file using NCO ncks

坚强是说给别人听的谎言 提交于 2019-12-12 14:06:36
问题 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 below: --- temp1.nc header --- dimensions: time = UNLIMITED ; // (124 currently) lon = 256 ; bnds = 2 ; lat = 128 ; lev = 40 ; variables: double time(time) ; time:standard_name = "time" ; time:long_name = "time" ; time:units = "days since 1850-1-1" ; time