SantanderMetGroup / loadeR

A climate4R package for data access
https://github.com/SantanderMetGroup/climate4R
GNU General Public License v3.0
13 stars 13 forks source link

LoadGridData generate NaN data as results #56

Open Lover221 opened 5 years ago

Lover221 commented 5 years ago

Hi everyone, I am having an issue in LoadGridData using isimip precipitation code, because it is only generate NaN while data are correct (see data in attached). I have reviewed all data that I used but still the same error appear. Is there any way to train the model leaving aside the NaN? Because I tried adding na.rm = T, na.exclude, na.omit but it is not included in the LoadGridData function. The netcdf file is heavy, so I have attached the text file from the original netcdf (MAM_era_DOM_rain_1980-2005.txt) Here my example:

load observation

obs<-"/pd/data/wascal_cclm/BIAS_CORRECTION2019/cdo/MAM_era_DOM_rain_1980-2005.nc" obs_pr <- loadGridData(obs, var = "pr", lonLim = NULL, latLim =NULL,season =3:5, years = 1980:1981) obs_pr$Variable$varName <- "precipitation" obs_pr <- setGridUnits(obs_pr, unit.string = "mm", var = "pr") *str(obs_pr) List of 4 $ Variable:List of 2 ..$ varName: chr "precipitation" ..$ level : NULL ..- attr(, "use_dictionary")= logi FALSE ..- attr(, "description")= chr "total_precipitation" ..- attr(, "units")= chr "mm" ..- attr(, "longname")= chr "pr" ..- attr(, "daily_agg_cellfun")= chr "none" ..- attr(, "monthly_agg_cellfun")= chr "none" ..- attr(, "verification_time")= chr "none" $ Data : num [1:184, 1:168, 1:439] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... ..- attr(, "dimensions")= chr [1:3] "time" "lat" "lon" $ xyCoords:List of 2 ..$ x: num [1:439] -18.9 -18.8 -18.6 -18.5 -18.5 ... ..$ y: num [1:168] 0.15 0.25 0.35 0.45 0.55 ... ..- attr(, "projection")= chr "LatLonProjection" ..- attr(, "resX")= num 0.1 ..- attr(, "resY")= num 0.1 $ Dates :List of 2 ..$ start: chr [1:184] "1980-03-01 00:00:00 GMT" "1980-03-02 00:00:00 GMT" "1980-03-03 00:00:00 GMT" "1980-03-04 00:00:00 GMT" ... ..$ end : chr [1:184] "1980-03-01 00:00:00 GMT" "1980-03-02 00:00:00 GMT" "1980-03-03 00:00:00 GMT" "1980-03-04 00:00:00 GMT" ...

Would be cery happy if you can help! Best MAM_era_DOM_rain_1980-2005.txt

louwangzhiyuwhy commented 2 years ago

I meet the same problem did you solve it?