Takes two input grids and crops the overlapping part along time dimension
First grid (typically observations, but not necessarily)
Second grid (typically predictors in downscaling applications, but not necessarily)
Which subset grid should be returned,
The grid indicated in
which.return, encompassing the overlapping time period with the other one.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
data("NCEP_Iberia_psl") range(getRefDates(NCEP_Iberia_psl)) data("VALUE_Iberia_tas") range(getRefDates(EOBS_Iberia_tas)) # Assuming sea-level pressure field from NCEP is the predictor, # and VALUE observations are the predictand, # suppose they have different temporal periods: predictor <- subsetGrid(NCEP_Iberia_psl, years = 1987:2001, season = 1) getSeason(predictor) # January range(getYearsAsINDEX(predictor)) # period 1987-2001 predictand <- EOBS_Iberia_tas getSeason(predictand) # December-January-February (winter) range(getYearsAsINDEX(predictand)) # period 1983-2002 # We often want to ensure that their time dimension matches perfectly before downscaling: try(checkDim(predictor, predictand, dimensions = "time")) # getTemporalIntersection is the solution: predictand.adj <- getTemporalIntersection(obs = predictand, prd = predictor, which.return = "obs") getSeason(predictand.adj) # January range(getYearsAsINDEX(predictand.adj)) # 1987-2001 # In the same vein, it is often required to be done again on the predictor predictor.adj <- getTemporalIntersection(obs = predictand, prd = predictor, which.return = "prd") checkDim(predictor.adj, predictand.adj, dimensions = "time") # perfect
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.