An R package as an interface to Unidata netCDF (Version 4 or earlier) format data files.
Questions tagged [ncdf4]
98 questions
0
votes
1 answer
How to extract single variable from multiple nc files and save it to new nc file using cdo?
I have monthly data from 2015-01 to 2099-12 with hundreds of variables (big dataset). Now I just want to extract single variable (say, FAREA_BURNED) from each nc files and save it as FAREA_BURNED.nc file. I find several ways on internet, but none of…

Hemraj Bhattarai
- 11
- 3
0
votes
1 answer
Flipped raster map with no CRS and unable to mask with shapefile
I am trying to obtain the average temperature for different provinces in Ecuador on a specific date (2018-11-10).
I obtained the global temperature data from the CPC Global Unified Temperature website which comes in a .nc file for each year. Thus, I…

Alonso Quijano
- 73
- 6
0
votes
1 answer
Extract temperature data from NC files in a loop
I'm looking to extract some climate data from .nc files in R.d I've managed to make my code run for extracting data from a single file but I've got many different .nc files from which I'd like to extract a the entire time series of data from…

RGR_288
- 51
- 6
0
votes
0 answers
Problems running tidync on windows - convert filtered nc object to dataframe
I have a series of netCDF files which I am trying to convert to a dataframe after filtering the dimensions. This worked fine on my Mac, but I cannot get hyper_tibble() or hyper_array() to run on my Windows PC. There's no error, the function just…

faith
- 15
- 4
0
votes
1 answer
Layer names of netCDF files
I am working with big ncdf4 files. Example gridded temperature data as time series from UK met office Hadley data center: "CRUTEM.5.0.1.0 HadSST.4.0.0.0". Working with the ncdf4 dataset needs much memory if imported as an ncdf4 file and is very…

AloesR2512
- 11
- 4
0
votes
0 answers
Opening .NC file in R online rather than downloading it
I am trying to access the .nc file in R which can be found(downloaded) here:
https://www.ncei.noaa.gov/data/nclimgrid-daily/access/grids/1951/ncdd-195101-grd-scaled.nc
I tried using this function nc_open form ncdf4 library in…

Prasad Thota
- 111
- 2
0
votes
0 answers
How extract a region from a ncdf file
I have a ncdf file for the whole world and I just want to extract and plot US.
our_nc_data <- nc_open("main_2010.nc")
print(our_nc_data)
lswt_array <- ncvar_get(our_nc_data, "o3")
image(lswt_array)
our_nc_data$dim$lon$vals ->…

Arwen
- 77
- 4
0
votes
1 answer
How to write a data frame to netcdf file in R
I have a data frame (df) in R, which represent a trajectory/track, including time, position, and ID. I would like to write it from R as a netCDF file. Here is the df:
df <-structure(list(ID = 1:7, longitude = c(43.064598540146, 43.1822580645161,…

ahmathelte
- 559
- 3
- 15
0
votes
0 answers
How to subset latitude and longitude in nc format since they are not in dimensions in R
The latitude and longitude are not in dimensions and only are variables, how can I subset them?
f = nc_open("df.nc")
f is in 2 dimension of [stations, time]
Where stations has 2 variables of latitude and longitude
lat =…

SHAH
- 61
- 5
0
votes
0 answers
How to read a sub-set of a NetCDF file wraping around the desired dimension values?
I have NetCDF files from NCEP/DOE Reanalysis 2, which contains data for the entire globe.
That makes me want to load the values like this.
library(ncdf4)
file1 <- nc_open("uwnd.2017.nc")
ncvar_get(file1, "lon")
This outputs a vector of 144…

Dan Sid
- 1
0
votes
0 answers
Reading HadUK-Grid (NetCDF) files into R and covert into dataframe
Data read in from: https://data.ceda.ac.uk/badc/ukmo-hadobs/data/insitu/MOHC/HadOBS/HadUK-Grid/v1.1.0.0/region/tasmin/day/v20220310
Read daily min temp data in
nc <- nc_open("xxxxx")
print(nc)
*Time variable info printed....*
time …

Megang
- 1
0
votes
2 answers
how to convert the .hdf file to dataset?
I am using one of the files in here: http://orca.science.oregonstate.edu/1080.by.2160.monthly.hdf.vgpm.m.chl.m.sst.php:
untar(tarfile = "http://orca.science.oregonstate.edu/data/1x2/monthly/vgpm.r2018.m.chl.m.sst/hdf/vgpm.m.2010.tar", exdir =…

yuliaUU
- 1,581
- 2
- 12
- 33
0
votes
0 answers
reading NetCDF files - tibble columns must have compatible sizes
I like to read NetCDF files via stars::read_ncdf or tidync::tidync but get an error message like
#> Error:
#> ! Tibble columns must have compatible sizes.
#> • Size 2: Columns `filter_id` and `filter_params`.
#> • Size 3: Column `chunksizes`.
#> ℹ…

ckluss
- 1,477
- 4
- 21
- 33
0
votes
1 answer
Error calculating area of raster with lat/lon projection
I have a global raster stack (of three rasters) whose pixel values are the percent of a land use for that pixel. Here's the raster metadata:
class : RasterBrick
dimensions : 3600, 7200, 25920000, 3 (nrow, ncol, ncell, nlayers)
resolution : 1,…

Stephen Wood
- 43
- 5
0
votes
1 answer
the action can´t be completed because the folder is open in R session
I'm using package ncdf4 to read .nc file. After extracting the data, the .nc file stays open by RStudio, so I can't delete or rename the file in windows (I receive the error: "the action can´t be completed because the folder is open in RStudio R…

Shajar
- 87
- 6