Different number of latitudes if regridded
I've found that with the new version of startR, the number of latitudes vary if a regrid is performed or not (179 vs 181).
Prior to the version update, both outputs were latitude=181.
> dim(obs)
dat var file_date1 file_date2 latitude longitude
1 1 3 2 179 360
> dim(fcst)
dat var syear time latitude longitude ensemble
1 1 1 2 181 360 51
The data loading with start() differ in the transform part. Dou you know how can I fix it?
Thanks
Francesc
I attach the sample code:
library(startR)
lats.min <- -90
lats.max <- 90
lons.min <- 0
lons.max <- 360
dates_file <- matrix(ncol=2,nrow=3,data=c("201702","201802","201902","201703","201803","201903"))
fcst.sdate.start <- "202002"
variable <- "tas"
fcst.freq <- "monthly_mean"
freq.hcst <- "f6h"
obs.dir <- "/esarchive/recon/ecmwf/era5/"
fcst.dir <- "/esarchive/exp/ecmwf/system5c3s/"
obs.path <- "/esarchive/recon/ecmwf/era5/monthly_mean/tas_f1h/tas_$file_date$.nc"
fcst.path <- "/esarchive/exp/ecmwf/system5c3s/monthly_mean/tas_f6h/tas_$syear$01.nc"
obs <- Start(dat = obs.path,
var = variable,
file_date = dates_file,
latitude = values(list(lats.min, lats.max)),
longitude = values(list(lons.min, lons.max)),
synonims = list(latitude=c('lat','latitude'),
longitude=c('lon','longitude')),
transform = CDORemapper,
transform_params = list(
grid = paste0(
"/esarchive/exp/ecmwf/system5c3s/",fcst.freq,
"/",variable,"_",
freq.hcst,
"/",variable,"_","201805","01.nc"
),
method = 'con',
crop = c(lons.min,lons.max,lats.min,lats.max)
),
transform_vars = c('latitude', 'longitude'),
return_vars = list(latitude = 'dat',
longitude = 'dat',
time = 'file_date'),
split_multiselected_dims = TRUE,
retrieve = TRUE)
ltmin <- 1
ltmax <- 2
fcst <- Start(dat = fcst.path,
var = variable,
syear = fcst.sdate.start,
time = indices(ltmin:ltmax),
latitude = values(list(lats.min, lats.max)),
longitude = values(list(lons.min, lons.max)),
synonims = list(latitude=c('lat','latitude'),
longitude=c('lon','longitude')),
ensemble= 'all',
return_vars = list(latitude = 'dat',
longitude = 'dat',
time = c('syear')),
retrieve = T)