Skip to content

Issue with ncvar_get #166

@arcel0n

Description

@arcel0n

Hi, I'm using ncdf4 to read EVI data over a large area in the Western Ghats of India. My code is as below:

library(ncdf4)
library(raster) 

library(ggplot2)


nc_data <- nc_open("C:/Users/lab23-user/Desktop/aayush_m/hmsc/data/evi_data.nc")

lon <- ncvar_get(nc_data, "lon")
lat <- ncvar_get(nc_data, "lat", verbose = F)
t <- ncvar_get(nc_data, "time")

ndvi.array <- ncvar_get(nc_data, "_250m_16_days_EVI")

However, while doing so I run into the following errors:

Error in Rsx_nc4_get_vara_int: NetCDF: Memory allocation (malloc) failure
Var: _250m_16_days_EVI  Ndims: 3   Start: 0,0,0 Count: 461,8243,4305
Error in ncvar_get_inner(ncid2use, varid2use, nc$var[[li]]$missval, addOffset,  : 
  C function Rsx_nc4_get_var_int returned error

I've tried Googling to find solutions but cannot find any to this problem, any direction would be appreciated! As a solution I have tried to request a subset of the original data (the data is from https://appeears.earthdatacloud.nasa.gov/) - but I would like to solve the issue as is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions