csep.core.forecasts.GriddedForecast.scale_to_test_date
- GriddedForecast.scale_to_test_date(test_datetime)[source]
Scales forecast data by the fraction of the date.
Uses the concept of decimal years to keep track of leap years. See the csep.utils.time_utils.decimal_year for details on the implementation. If datetime is before the start_date or after the end_date, we will scale the forecast by unity.
These datetime objects can be timezone aware in UTC timezone or both not time aware. This function will raise a TypeError according to the specifications of datetime module if these conditions are not met.
- Parameters:
test_datetime (datetime.datetime) – date to scale the forecast
in_place (bool) – if false, creates a deep copy of the object and scales that instead