netcdf

convert all the variables and dimensions from int/float to double in netcdf file

无人久伴 提交于 2021-02-10 22:29:52
问题 I have a netCDF file with the foll. ncdump: netcdf nc_data { dimensions: lon = 1440 ; bounds = 2 ; lat = 720 ; time = UNLIMITED ; // (6 currently) variables: double lon_bounds(lon, bounds) ; double lat_bounds(lat, bounds) ; int time(time) ; time:units = "year as %Y.%f" ; time:calendar = "proleptic_gregorian" ; time:long_name = "time" ; time:standard_name = "time" ; time:axis = "T" ; float lat(lat) ; lat:units = "degrees_north" ; lat:long_name = "latitude" ; lat:standard_name = "latitude" ;

Visual Studio - Cmake Project - Add NetCDF

大憨熊 提交于 2021-02-10 16:50:40
问题 I have a project that I was able to compile in Linux, but was also hoping to compile in a windows environment, namely, visual studio. I installed netcdf, but when I build using cmake, I get this error: Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 1> -- Checking for one of the modules 'netcdf' 1> CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.11/Modules/FindPkgConfig.cmake:641 (message):

Use R to extract time series from netcdf data

邮差的信 提交于 2021-02-10 14:18:14
问题 A newbie question related to R. How do I extract time series data for a particular location using R from an netdcf file. So for example, the following snapshot shows that the time series for location (1,2) is 13,28,43. Thanks in advance. 回答1: This might do it, where "my.variable" is the name of the variable you are interested in: library(survival) library(RNetCDF) library(ncdf) library(date) setwd("c:/users/mmiller21/Netcdf") my.data <- open.nc("my.netCDF.file.nc"); my.time <- var.get.nc(my

Concatenate netcdf files with different variables - using nco

吃可爱长大的小学妹 提交于 2021-02-10 11:48:41
问题 I want to concatenate two sets of netcdf files using nco , where each set has about 30 files. Set 1 contains: longitude, latitude, time and v. Set 2 contains: longitude, latitude, time and u. I have tried: ncks *.nc out.nc but I get: Error received 97 filenames; need no more than two then I tried: ncks -A *.nc out.nc but the error persists: Error received 97 filenames; need no more than two Please can you point me in the right direction, I am quite new to this. Thanks in advance. 回答1: Your

Concatenate netcdf files with different variables - using nco

允我心安 提交于 2021-02-10 11:48:31
问题 I want to concatenate two sets of netcdf files using nco , where each set has about 30 files. Set 1 contains: longitude, latitude, time and v. Set 2 contains: longitude, latitude, time and u. I have tried: ncks *.nc out.nc but I get: Error received 97 filenames; need no more than two then I tried: ncks -A *.nc out.nc but the error persists: Error received 97 filenames; need no more than two Please can you point me in the right direction, I am quite new to this. Thanks in advance. 回答1: Your

Concatenate netcdf files with different variables - using nco

爷,独闯天下 提交于 2021-02-10 11:48:08
问题 I want to concatenate two sets of netcdf files using nco , where each set has about 30 files. Set 1 contains: longitude, latitude, time and v. Set 2 contains: longitude, latitude, time and u. I have tried: ncks *.nc out.nc but I get: Error received 97 filenames; need no more than two then I tried: ncks -A *.nc out.nc but the error persists: Error received 97 filenames; need no more than two Please can you point me in the right direction, I am quite new to this. Thanks in advance. 回答1: Your

NetCDF : set variable as constant in time

你说的曾经没有我的故事 提交于 2021-02-10 06:34:28
问题 I am dealing with netCDF files with the following structure : netcdf YYY { dimensions: Time = UNLIMITED ; // (XXX currently) lat = XX ; lon = XX ; variables: double U_p_500hPa(Time, lat, lon) ; U_p_500hPa:units = "m/s" ; U_p_500hPa:_FillValue = -9999. ; U_p_500hPa:description = "U at 500hPa" ; U_p_500hPa:PlotLevelID = "500 hPa" ; float XLAT(Time, lat, lon) ; XLAT:FieldType = 104 ; XLAT:MemoryOrder = "XY " ; XLAT:description = "LATITUDE, SOUTH IS NEGATIVE" ; XLAT:units = "degree_north" ; XLAT

How to extract NetCDF data frame by region using a polygon shapefile

拈花ヽ惹草 提交于 2021-01-29 10:31:32
问题 I'am trying to extract the variable "swh_ku" from multiple NetCDF files together with their corresponding latitude and longitude values into csv files using a polygon shapefile or it's extent. I'm working with Jason-1 global altimetry swath data but I only need the data for the domain represented by the shapefile. I just need help with some lines of code that would complete the working code bellow so I can extract only the data for the region I'm interested in. I've tried several software

Estimating monthly climatology on NetCDF data using R

五迷三道 提交于 2021-01-27 17:02:07
问题 I am working on NOAA AVHRR daily Sea Surface Temperature (SST) data of 31 years. The data is in NetCDF format with dimensions as 28 (lon) x 40 (lat) x 11686(days). I am supposed to compute monthly climatological mean (e.g. mean of all Januaries of 31 years and so on). Using ncdf4 and chron libraries I was able to get it in array form. ncin <- nc_open('sstfile.nc') sst_array <- ncvar_get(ncin, 'sst') Since time variable is separate from SST data, I had to use it loop over the array. is

Is there a way to release the file lock for a xarray.Dataset?

ぃ、小莉子 提交于 2021-01-27 07:29:27
问题 I have a process that grows a NetCDF file fn every 5 minutes using netcdf4.Dataset(fn, mode=a) . I also have a bokeh server visualization of that NetCDF file using a xarray.Dataset (which I want to keep, because it is so convenient). The problem is that the NetCDF-update-process fails when trying to add new data to fn if it is open in my bokeh server process via ds = xarray.open_dataset(fn) If I use the option autoclose ds = xarray.open_dataset(fn, autoclose=True) updating fn with the other