Skip to content

How to deal with obs and simh if they have different time lengths? #65

Answered by btschwertfeger
Pan-Yuxian asked this question in Q&A
Discussion options

You must be logged in to vote

AH - yes, I have seen my fault. I have found the reason for this. It was a bit tricky. The problem is that the cumulative distribution functions for obs and simh will have the length of n_quantiles +1 BUT because of the different lengths of these data sets, they dont count up to the same number. Thus when having less values for simh thant for obs, we will always miss high values.

import xarray as xr
import matplotlib.pyplot as plt 
import numpy as np
from cmethods.utils import get_cdf, get_inverse_of_cdf

obs = xr.open_dataset("examples/input_data/observations.nc")["tas"]
simp = xr.open_dataset("examples/input_data/control.nc")["tas"]
simh = simp.copy(deep=True)[3650:]
n_quantiles = 2000

o…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Pan-Yuxian
Comment options

@btschwertfeger
Comment options

Answer selected by Pan-Yuxian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Question Further information is requested
2 participants