Questions tagged [ncdf4]

An R package as an interface to Unidata netCDF (Version 4 or earlier) format data files.

98 questions
0
votes
1 answer

From .csv to .nc file using ncdf4 package (Error in ncvar_put)

I'm trying to write a .nc file from a .csv file. This is PART of my .csv table (df) long lat elev 1 -47.99206 -7.501234 242.0362 2 -47.99206 -7.751234 200.7271 3 -47.99206 -8.001234 165.6918 4 -47.99206 -8.251234 271.2571 5 …
0
votes
0 answers

How to subset NetCDF files with conditionals in one dimension in R

I have a NetCDF file of monthly temperatures that range from 1979 to 2019 with 3 dimensions (lon,lat,time).I dowloaded the file from this website:…
ailf
  • 55
  • 6
0
votes
1 answer

Insert Fill_Value to nc file in R

I am trying to convert a .nc file to a .csv file for further analysis in R as I am used to working with .csv. Basically I think to solve my problem (more detail below) I need to add a _FillValue into the .nc file but everything I have tried doesn't…
QPaps
  • 312
  • 1
  • 14
0
votes
2 answers

How to convert Sentinel-3 .nc-file into .tiff-file?

regarding the conversion of .nc-files into .tiff-files i encounter the problem of loosing geoinformation of my pixels. I know that other users experienced the same problem and tried to solve it via kotlin but failed. i would prefer a solution using…
ExploreR
  • 313
  • 4
  • 15
0
votes
1 answer

How to make python script run or all files in a directory?

I have a script that converts a part of an nc file to a csv file. The script itself works, but the problem is that I would need to specify the exact directory including the name of the file and output csv. I am interested in running the script for…
Bob
  • 115
  • 10
0
votes
1 answer

Extracting data from NetCDF

I have downloaded the sea surface temperature for January from here https://oceancolor.gsfc.nasa.gov/l3/ and imported it into R. I know how to crop using extent(ymax, ymin, xmax,xmin) but I can't figure out how to do it just for one station (53.9S,…
user3073118
0
votes
1 answer

Plotting x and y values using data from two separate netCDF files in R

I am currently trying to plot, using a line-related plot, precipitation data (y-axis values) with cumulative emissions data (x-axis) using R. Both of these data are found on two separate netCDF files that I have already read into R. Ultimately, What…
Android17
  • 93
  • 1
  • 12
0
votes
0 answers

Levels for netcdf files in brick, R

I have many .nc files with a variable "skt". What I want to do is to load all these files in R as raster brick and have apart from the variable, the time, too. I tried to do this with levels, but with no success. I would really appreciate any…
geo_dd
  • 283
  • 1
  • 5
  • 22
0
votes
1 answer

how to write several rasterStack in a loop with R

I have several ncdf files in a folder. I would like to stack them individually in a loop and print their information in R. I have the following code: library(raster) library(ncdf4) c <- list.files(pattern="nc") for (i in 1:length(c)){ ff <-…
armin
  • 77
  • 8
0
votes
1 answer

Force 'float' precision for the coordinate variable of an unlimited dimension variable (time) in netcdf using R(ncdf4)

The command ncdim_def from package ncdf4 is built to encourage the automatic creation of the coordinate variable that goes with the dimension, a very good practice. However, it only allows to create "double" or "integer" precision for this…
acapet
  • 98
  • 1
  • 8
0
votes
1 answer

Get aggregated data from OPenDAP ncml that requires authentication using R

I'm trying to get TRMM data from NASA OPenDAP server using the raster package in R. Initially I had some difficulty regarding authentication, but that issue was resolved. NASA OPenDAP server publishes TRMM 3B42_daily data as individual files, one…
Daniel
  • 462
  • 3
  • 13
0
votes
1 answer

How to populate data frame from thousands of ncdf files using a for-loop?

I'm trying to open thousands of netcdf files and pull the data into a dataframe that I can save as a csv file. So after putting all the ncdf files names in a csv file as a list, I ended up using this code to create a dataframe populated with the…
Ktass
  • 47
  • 1
  • 1
  • 7
0
votes
4 answers

how to subtract a column to the other colums in a data frame

I have a data frame that consist of 1000 rows and 156 columns. I'm trying to subtract the first column to the next 38 columns, then subtract column 39 to the next 38, and so, but I can't find a way to do it. I'm only using ncdf4 and nothing else.…
0
votes
1 answer

Wrong Dimensions in Geospatial NetCDF

I would like to load the following geospatial file in R: ftp://ftp.nodc.noaa.gov/pub/data.nodc/icoads/1930s/1930s/ICOADS_R3.0.0_1930-10.nc. The problem is that using the subsequent code I only obtain one dimension, even though I should obtain…
Chr
  • 1,017
  • 1
  • 8
  • 29
0
votes
1 answer

Errors occur when I extract values from ncdf file in R

I wrote a function to extract values from ncdf files, as shown below: precresults <- function(x){ library(magrittr) library(ncdf4) library(raster) library(ncdf.tools) ##library(ncf) re1 <- brick(nl1a[x]) re <-…