metno / esd

An R-package designed for climate and weather data analysis, empirical-statistical downscaling, and visualisation.
87 stars 30 forks source link

How to open a .nc file from giovanni NASA data? #241

Closed MeJitendra closed 5 years ago

MeJitendra commented 6 years ago

Dear Sir, While opening a Giovanni satellite data from earth data, I am getting the following error.

x<-retrieve('g4.timeAvgMap.MYD08_D3_6_1_Cloud_Effective_Radius_Liquid_Mean.20111130-20170130.60E_20N_90E_40N.nc') Error in retrieve.ncdf4(ncfile, path = path, param = param, verbose = verbose, : Error in dim lon In addition: There were 11 warnings (use warnings() to see them) warnings() Warning messages: 1: In if (substr(varid, 1, 1) == "/") stop(paste("Error, I was given a name that starts with a slash; fully qualified names NEVER start with a slash (this is required for backwards compatability). Leave off the leading slash!")) : the condition has length > 1 and only the first element will be used 2: In if (origvarid == nc$var[[kk]]$name) varToUse <- kk : the condition has length > 1 and only the first element will be used 3: In if (origvarid == nc$var[[kk]]$name) varToUse <- kk : the condition has length > 1 and only the first element will be used 4: In if (origvarid == nc$var[[kk]]$name) varToUse <- kk : the condition has length > 1 and only the first element will be used 5: In if (origvarid == nc$dim[[i]]$name) { ... : the condition has length > 1 and only the first element will be used 6: In if (origvarid == nc$dim[[i]]$name) { ... : the condition has length > 1 and only the first element will be used 7: In if (substr(varid, 1, 1) == "/") stop(paste("Error, I was given a name that starts with a slash; fully qualified names NEVER start with a slash (this is required for backwards compatability). Leave off the leading slash!")) : the condition has length > 1 and only the first element will be used 8: In if (origvarid == nc$var[[kk]]$name) varToUse <- kk : the condition has length > 1 and only the first element will be used 9: In if (origvarid == nc$var[[kk]]$name) varToUse <- kk : the condition has length > 1 and only the first element will be used 10: In if (origvarid == nc$var[[kk]]$name) varToUse <- kk : the condition has length > 1 and only the first element will be used 11: In if (origvarid == nc$dim[[i]]$name) { ... : the condition has length > 1 and only the first element will be used

I have attached the file so that you can test what I have to do to retrieve the data. Kindly retrieve the file as it is compressed.

Thanks and Regards Jitendra

g4.timeAvgMap.MYD08_D3_6_1_Cloud_Effective_Radius_Liquid_Mean.20111130-20170130.60E_20N_90E_40N.zip

abdelkaderm commented 6 years ago

Hi Jitendra,

I am afraid that retrieve is not appropriate in this case as your file does not have a time dimension.

summary.ncdf4('Downloads/g4.timeAvgMap.MYD08_D3_6_1_Cloud_Effective_Radius_Liquid_Mean.20111130-20170130.60E_20N_90E_40N.nc')

[1] " -------------------------------------------------------------------" Downloads/g4.timeAvgMap.MYD08_D3_6_1_Cloud_Effective_Radius_Liquid_Mean.20111130-20170130.60E_20N_90E_40N.nc" [1] "Time Averaged Map of Liquid Water Cloud Effective Particle Radius: Mean of Daily Mean daily 1 deg. [MODIS-Aqua MYD08_D3 v6.1] microns over 2011-11-30 - 2017-01-30, Region 60E, 20N, 90E, 40N" [1] "MYD08_D3_6_1_Cloud_Effective_Radius_Liquid_Mean (variable 1) has unit (microns) and dimension(s) lon(30) lat(20)" [1] "lon (dimension 1) Unit (degrees_east) First point (60.5) Last point (89.5) Step (1)" [1] "lat (dimension 2) Unit (degrees_north) First point (20.5) Last point (39.5) Step (1)" [1] "Warning: Frequency has not been found in data attributes !" [1] "lat_bnds (variable 2) has unit (degrees_north) and dimension(s) latv(2) lat(20)" [1] "latv (dimension 1) Unit () First point (1) Last point (2) Step (1)" [1] "lat (dimension 2) Unit (degrees_north) First point (20.5) Last point (39.5) Step (1)" [1] "Warning: Frequency has not been found in data attributes !" [1] "lon_bnds (variable 3) has unit (degrees_east) and dimension(s) lonv(2) lon(30)" [1] "lonv (dimension 1) Unit () First point (1) Last point (2) Step (1)" [1] "lon (dimension 2) Unit (degrees_east) First point (60.5) Last point (89.5) Step (1)" [1] "Warning: Frequency has not been found in data attributes !"

try using regular nc_open()

Bests,