netcdf

R create NetCDF from .CSV

百般思念 提交于 2019-12-08 06:25:47
问题 I am trying to create a NetCDF from a .csv file. I have read several tutorials here and other places and still have some doubts. I have a table according to this: lat,long,time,rh,temp 41,-109,6,1,1 40,-107,18,2,2 39,-105,6,3,3 41,-103,18,4,4 40,-109,6,5,2 39,-107,18,6,4 I create the NetCDF using the ncdf4 package in R. xvals <- data$lon yvals <- data$lat nx <- length(xvals) ny <- length(yvals) lon1 <- ncdim_def("longitude", "degrees_east", xvals) lat2 <- ncdim_def("latitude", "degrees_north"

how to display a projected map on an R::lattice::layerplot?

时间秒杀一切 提交于 2019-12-08 06:01:37
问题 summary: I can display a lon-lat map on a lattice::layerplot , and I can display a Lambert conformal conic (LCC) map on a spam::image . How to display an LCC map on a lattice::layerplot ? Examples of how not to do it follow--assistance in fixing is appreciated (or even just debugging). details: I've been using trellis graphics (via latticeExtra and rasterVis ) successfully to display unprojected lon-lat global atmospheric data, which works well enough (though I am definitely intrigued by

Error during RNNLib configuration: netcdfcpp.h cannot be found

不问归期 提交于 2019-12-08 01:08:58
问题 When attempting to compile RNNLib, I got an error in NetcdfDataset.hpp:26:24 saying that Netcdfcpp.h could not be found. I looked around and found a bug report from 2011 that suggested that this was a bug, but it claimed to have been fixed. I have tried everything I can think of, including rebuilding NetCDF (a dependency of RNNLib) with various different flags, and have been unable to fix this bug. Can anyone give me a hand? 回答1: I had some trouble on a virtual machine building rnnlib. I had

how to display a projected map on an R::lattice::layerplot?

半城伤御伤魂 提交于 2019-12-07 23:40:31
summary: I can display a lon-lat map on a lattice::layerplot , and I can display a Lambert conformal conic (LCC) map on a spam::image . How to display an LCC map on a lattice::layerplot ? Examples of how not to do it follow--assistance in fixing is appreciated (or even just debugging). details: I've been using trellis graphics (via latticeExtra and rasterVis ) successfully to display unprojected lon-lat global atmospheric data, which works well enough (though I am definitely intrigued by ggplot / ggmap ). Particularly, I am able to overlay those plots with maps, which is essential for the sort

NetCDF: How to mask/filter out non-land values in global dataset, preferably using Python and/or NCO?

*爱你&永不变心* 提交于 2019-12-07 22:56:41
问题 I have a global data at 0.25 degree resolution that I'd like to mask so that it only contains data values over land. The data covers full 360 degrees in the lon dimension and from -60 to 60 degrees in the lat dimension. The file header, as well as summary lat and lon coordinate values, are listed below: netcdf cmorph_global_daily { dimensions: lat = UNLIMITED ; // (480 currently) lon = 1440 ; time = 7305 ; variables: float lat(lat) ; lat:units = "degrees_north" ; lat:long_name = "Latitude" ;

Interpolating Gridded 3D Data to a finer scale

别来无恙 提交于 2019-12-07 22:51:35
问题 I have a NetCDF file of a probability surface. It's a 30x30 grid of 0.25 degree lat/lon intervals with a probability surface described in the z dimension. I can easily import this into Panoply, a NetCDF viewer: And it's then a breeze (checking one box) to interpolate/smooth the raw data to a finer grid size: However, I don't just want to visualize the data, I want to plot it in R along with bathymetry and point data. That all is no problem, but I have not found a straightforward way to

Visual Studio - adding netCDF library

独自空忆成欢 提交于 2019-12-07 18:07:01
问题 I want to use netCDF formats in a C project using Visual Studio Express 2013 on a Windows 64bit. I've downloaded the installation file from the official website and executed the .exe. Then, I've looked into this post to see how I should do the linking etc. More specifically, in my project in Visual Studio, I did the following: Put #include < netcdf.h > in VC++ Directories, Library directories, I added C:\Program Files (x86)\netCDF 4.3.3.1\lib; C:\Program Files (x86)\netCDF 4.3.3.1\bin; in VC+

time and geographical subset of netcdf raster stack or raster brick using R

风流意气都作罢 提交于 2019-12-07 08:32:51
问题 For the following netcdf file with daily global sea surface temperatures for 2016, I'm trying to (i) subset temporally, (ii) subset geographically, (iii) then take long-term means for each pixel and create a basic plot. Link to file: here library(raster) library(ncdf4) open the netcdf after setting my working directory nc_data <- nc_open('sst.day.mean.2016.v2.nc') change the time variable so it's easy to interpret time <- ncdf4::ncvar_get(nc_data, varid="time") head(time) change to dates that

Cannot install netCDF4 python package on OS X

不羁岁月 提交于 2019-12-07 05:46:06
问题 I'm trying to install netCDF4 on OS X with pip install netCDF4 and I am getting the following error: ------------------------------------------------------------ /usr/local/bin/pip run on Wed Aug 7 23:02:37 2013 Downloading/unpacking netCDF4 Running setup.py egg_info for package netCDF4 HDF5_DIR environment variable not set, checking some standard locations .. checking /Users/mc ... checking /usr/local ... checking /sw ... checking /opt ... checking /opt/local ... checking /usr ... Traceback

NetCDF to Raster Brick “Unable to find inherited method for function 'brick' for 'ncdf4'”

浪尽此生 提交于 2019-12-06 11:29:44
问题 Really simple problem with the raster package, also using ncdf4 to load in an ECMWF Era-Interim Netcdf file. Simply doing this: a <- nc_open("SSTs.nc") B <- brick(a, varname="sst") Returns this: Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘brick’ for signature ‘"ncdf4"’ The file is just SST data over the whole globe, for 1 month (Jan2016). When I convert it into an array (i.e. extract dimensions/variable, and convert time to UTC, shove it into