Skip to content

Option 'timesteps' does not work in R when the variable is 3D

Hi @fbeninca

As we discussed earlier, the option 'timesteps' works when the variable has only i and j, but doesn't work when it has level dimension. It happens in R, I don't know if the problem exists in python or not.

library(reticulate)
plotmap <- import("mapgenerator.plotting.plotmap")
pm <- plotmap$PlotMap()

# 2D variable (work)
path <- "/esarchive/exp/ecearth/a1om/diags/CMIP/EC-Earth-Consortium/EC-Earth3/piControl/r2i1p1f1/Omon/heatc0-300m/gn/v20190118/heatc0-300m_Omon_EC-Earth3_piControl_r2i1p1f1_gn_210501-210512.nc"
pm$plot(srcfiles = path, srcvars = "heatc0-300m", timesteps = 0)

# 3D variable (doesn't work)
path <-'/esarchive/exp/ecearth/a1om/diags/CMIP/EC-Earth-Consortium/EC-Earth3/piControl/r2i1p1f1/Omon/sigma0/gn/v20190118/sigma0_Omon_EC-Earth3_piControl_r2i1p1f1_gn_270001-270012.nc'
lev_ind <- 'lev,1'
pm$plot(srcfiles = path, srcvars = "sigma0",dimension = lev_ind, timesteps = 0)

# it works and plots the first timestep if the option is not specified
pm$plot(srcfiles = path, srcvars = "sigma0",dimension = lev_ind)

Thanks,
An-Chi