You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Method to adjust 1 dimensional climate data by the linear scaling method.
280
+
r"""Method to adjust 1 dimensional climate data by the linear scaling method.
275
281
276
282
----- P A R A M E T E R S -----
277
283
@@ -343,7 +349,7 @@ def variance_scaling(
343
349
kind: str="+",
344
350
**kwargs,
345
351
) ->xr.core.dataarray.DataArray:
346
-
"""Method to adjust 1 dimensional climate data by variance scaling method.
352
+
r"""Method to adjust 1 dimensional climate data by variance scaling method.
347
353
348
354
----- P A R A M E T E R S -----
349
355
@@ -420,7 +426,7 @@ def delta_method(
420
426
kind: str="+",
421
427
**kwargs,
422
428
) ->xr.core.dataarray.DataArray:
423
-
"""Method to adjust 1 dimensional climate data by delta method.
429
+
r"""Method to adjust 1 dimensional climate data by delta method.
424
430
425
431
----- P A R A M E T E R S -----
426
432
@@ -485,11 +491,11 @@ def quantile_mapping(
485
491
simh: xr.core.dataarray.DataArray,
486
492
simp: xr.core.dataarray.DataArray,
487
493
n_quantiles: int,
488
-
group: Union[str, None] =None,
494
+
# group: Union[str, None] = None,
489
495
kind: str="+",
490
496
**kwargs,
491
497
) ->xr.core.dataarray.DataArray:
492
-
"""Quantile Mapping Bias Correction
498
+
r"""Quantile Mapping Bias Correction
493
499
494
500
----- P A R A M E T E R S -----
495
501
@@ -529,18 +535,20 @@ def quantile_mapping(
529
535
Alex J. Cannon and Stephen R. Sobie and Trevor Q. Murdock Bias Correction of GCM Precipitation by Quantile Mapping: How Well Do Methods Preserve Changes in Quantiles and Extremes?
530
536
https://doi.org/10.1175/JCLI-D-14-00754.1)
531
537
"""
532
-
533
-
ifgroupisnotNone:
534
-
returncls.grouped_correction(
535
-
method="quantile_mapping",
536
-
obs=obs,
537
-
simh=simh,
538
-
simp=simp,
539
-
group=group,
540
-
n_quantiles=n_quantiles,
541
-
kind=kind,
542
-
**kwargs,
543
-
)
538
+
# distribution-based adjustment on a grouped basis lead to high deviations
539
+
# in the monthly transitions, if group = "time.month". This is also when the group is
"""Method to adjust 1 dimensional climate data by empirical quantile mapping"""
624
631
raiseValueError(
625
632
"not implemented; please have a look at: https://svn.oss.deltares.nl/repos/openearthtools/trunk/python/applications/hydrotools/hydrotools/statistics/bias_correction.py "
626
633
)
627
-
# if group is not None:
628
-
# return cls.grouped_correction(
629
-
# method = 'empirical_quantile_mapping',
630
-
# obs = obs,
631
-
# simh = simh,
632
-
# simp = simp,
633
-
# group = group,
634
-
# n_quantiles = n_quantiles,
635
-
# extrapolate = extrapolate
636
-
# )
637
-
# else: pass
638
634
639
635
# ? -----========= Q U A N T I L E - D E L T A - M A P P I N G =========------
640
636
@classmethod
@@ -644,11 +640,11 @@ def quantile_delta_mapping(
644
640
simh: xr.core.dataarray.DataArray,
645
641
simp: xr.core.dataarray.DataArray,
646
642
n_quantiles: int,
647
-
group: Union[str, None] =None,
643
+
# group: Union[str, None] = None,
648
644
kind: str="+",
649
645
**kwargs,
650
646
) ->xr.core.dataarray.DataArray:
651
-
"""Quantile Delta Mapping bias adjustment
647
+
r"""Quantile Delta Mapping bias adjustment
652
648
653
649
----- P A R A M E T E R S -----
654
650
@@ -692,17 +688,20 @@ def quantile_delta_mapping(
692
688
693
689
"""
694
690
695
-
ifgroupisnotNone:
696
-
returncls.grouped_correction(
697
-
method="quantile_delta_mapping",
698
-
obs=obs,
699
-
simh=simh,
700
-
simp=simp,
701
-
group=group,
702
-
n_quantiles=n_quantiles,
703
-
kind=kind,
704
-
**kwargs,
705
-
)
691
+
# distribution-based adjustment on a grouped basis lead to high deviations
692
+
# in the monthly transitions, if group = "time.month". This is also when the group is
693
+
# day of year and so on.
694
+
# if group is not None:
695
+
# return cls.grouped_correction(
696
+
# method="quantile_delta_mapping",
697
+
# obs=obs,
698
+
# simh=simh,
699
+
# simp=simp,
700
+
# group=group,
701
+
# n_quantiles=n_quantiles,
702
+
# kind=kind,
703
+
# **kwargs,
704
+
# )
706
705
ifkindincls.ADDITIVE:
707
706
res=simp.copy(deep=True)
708
707
obs, simh, simp= (
@@ -769,7 +768,7 @@ def get_inverse_of_cdf(
769
768
insert_cdf: Union[list, np.array],
770
769
xbins: Union[list, np.array],
771
770
) ->np.array:
772
-
"""returns the inverse cummulative distribution function of base_cdf ($F_{base_cdf}\left[insert_cdf\right])$"""
771
+
r"""returns the inverse cummulative distribution function of base_cdf ($F_{base_cdf}\left[insert_cdf\right])$"""
0 commit comments