netcdf

copy netcdf file using python

拈花ヽ惹草 提交于 2019-12-19 09:03:30
问题 I would like to make a copy of netcdf file using Python. There are very nice examples of how to read or write netcdf-file, but perhaps there is also a good way how to make the input and then output of the variables to another file. A good-simple method would be nice, in order to get the dimensions and dimension variables to the output file with the lowest cost. 回答1: I found the answer to this question at python netcdf: making a copy of all variables and attributes but one, but I needed to

how to install R packages “RNetCDF” and “ncdf” on Ubuntu?

孤街浪徒 提交于 2019-12-18 15:48:56
问题 I would like to use the R packages RNetCDF and ncdf in Ubuntu. When I try install.packages('RNetCDF') or install.packages('ncdf') , I get similar errors: ... ncdf.c:3:20: fatal error: netcdf.h: No such file or directory compilation terminated. make: *** [ncdf.o] Error 1 ERROR: compilation failed for package ‘ncdf’ ... Warning message: In install.packages("ncdf") : installation of package ‘ncdf’ had non-zero exit status The packages libnetcdf6 and netcdf-bin from the Ubuntu repository are

What are the disadvantages of using .Rdata files compared to HDF5 or netCDF?

隐身守侯 提交于 2019-12-18 10:50:49
问题 I have been asked to change a software that currently exports .Rdata files so that it exports in a 'platform independent binary format' such as HDF5 or netCDF. Two reasons were given: Rdata files can only be read by R binary information is stored differently depending on operating systems or architecture I also found that the "R Data import export manual" does not discuss Rdata files although it does discuss HDF5 and netCDF. A discussion on R-help suggests that .Rdata files are platform

convert csv to netcdf

感情迁移 提交于 2019-12-18 03:44:46
问题 I am trying to convert a .csv file to a netCDF4 via Python but I am having trouble figuring out how I can store information from a .csv table format into a netCDF. My main concern is how do we declare the variables from the columns into a workable netCDF4 format? Everything I have found is normally extracting information from a netCDF4 to a .csv or ASCII. I have provided the sample data, sample code, and my errors for declaring the appropriate arrays. Any help would be much appreciated. The

R - Plotting netcdf climate data

旧城冷巷雨未停 提交于 2019-12-17 19:17:11
问题 I have been trying plot the following gridded netcdf file: "air.1999.nc" found at the following website: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.html I have tried the code below based on answers I have found here and elsewhere, but no luck. library(ncdf); temp.nc <- open.ncdf("air.1999.nc"); temp <- get.var.ncdf(temp.nc,"air"); temp.nc$dim$lon$vals -> lon temp.nc$dim$lat$vals -> lat lat <- rev(lat) temp <- temp[nrow(temp):1,] temp[temp==-32767] <- NA temp <- t(temp) image(lon,lat

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

Download files with specific extension from a website [closed]

岁酱吖の 提交于 2019-12-14 03:38:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . How can I download the content of a webpage and find all files with specific extension listed on it. And then download all of them. For example, I would like to download all netcdf files (with extension *.nc4) from the following webpage: https://data.giss.nasa.gov/impacts/agmipcf

Visualization of 3-dimensional grid from X_Y_Z(seperate datasets) on Paraview without using xdmf

℡╲_俬逩灬. 提交于 2019-12-14 02:43:56
问题 Reading netcdf files with Paraview using xdmf I used to parse netcdf files with an xdmf script in order to create 3DSMesh on paraview. On top of it, I was adding scalar or vector fields. (So 3DSMesh provides physical coordinates). I never though if it is best way to do that actually. It works, so I was OK. Please let me know if there is more convenient way. I am able to create a 3-dimensional grid with the following script. <?xml version="1.0" ?> <!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []> <Xdmf

RNetCDF cannot open shared object file

流过昼夜 提交于 2019-12-14 00:53:07
问题 I am trying to install the RNetCDF package on my laptop (Ubuntu 12.04) with the command install.packages('RNetCDF',lib='/home/my_computer/RSCRIPTS/R_LIB/',configure.args="--with-netcdf-include='/home/my_computer/bin/libs4cdo-0.0.10/netcdf-4.2/include/' --with-netcdf-lib='/home/my_computer/local/bin' --with-hdf5-lib='/home/my_computer/local/lib/' --with-udunits-include='/usr/local/lib/' --with-udunits-lib='/usr/local/lib/'",repos='http://star-www.st-andrews.ac.uk/cran/') but the package won't

Python NetCDF IOError: netcdf: NetCDF: Invalid dimension ID or name

為{幸葍}努か 提交于 2019-12-13 22:24:33
问题 I am writing a script in python for handling NetCDF files, but I am facing some issues in creating variables, here is the part of the code: stepnumber_var = ofl.createVariable("step_number", "i",("step_number",)) stepnumber_var.standard_name = "step_number" atomNumber_var = ofl.createVariable("atom_number", "i", ("atom_number",)) atomNumber_var.standard_name = "atom__number" But gives me this error: Traceback (most recent call last): File "sub_avg.py", line 141, in <module> atomNumber_var =