easyclimate.core.extract

Obtain data within a specified time period

Functions

get_specific_years_data(| List[int], dim)

Slicing and extracting the part of the data containing the specified year based on an array of given integer years.

get_specific_months_data(...)

Slicing and extracting the part of the data containing the specified year based on an array of given integer months.

get_specific_days_data(| List[int], dim)

Slicing and extracting the part of the data containing the specified year based on an array of given integer days.

get_specific_hours_data(| List[int], dim)

Slicing and extracting the part of the data containing the specified year based on an array of given integer hours.

get_specific_minutes_data(| List[int], dim)

Slicing and extracting the part of the data containing the specified year based on an array of given integer minutes.

get_specific_seconds_data(| List[int], dim)

Slicing and extracting the part of the data containing the specified year based on an array of given integer seconds.

get_specific_microseconds_data(| List[int], dim)

Slicing and extracting the part of the data containing the specified year based on an array of given integer microseconds.

get_specific_nanoseconds_data(| List[int], dim)

Slicing and extracting the part of the data containing the specified year based on an array of given integer nanoseconds.

get_specific_dayofweek_data(| List[int], dim)

Slicing and extracting the part of the data containing the specified year based on an array of given integer dayofweek.

get_yearmean_for_specific_months_data(| List[int], ...)

Get the annual average of certain months.

get_year_exceed_index_upper_bound(→ numpy.array)

Extract the years under the specified threshold (upper bound) in the annual average index (one-dimensional data with only a time dimension).

get_year_exceed_index_lower_bound(→ numpy.array)

Extract the years under the specified threshold (lower bound) in the annual average index (one-dimensional data with only a time dimension).

get_time_exceed_index_upper_bound(→ numpy.array)

Extract the time under the specified threshold (upper bound) in the annual average index (one-dimensional data with only a time dimension).

get_time_exceed_index_lower_bound(→ numpy.array)

Extract the time under the specified threshold (lower bound) in the annual average index (one-dimensional data with only a time dimension).

Module Contents

easyclimate.core.extract.get_specific_years_data(data_input: xarray.DataArray | xarray.Dataset, year_array: np.array(int) | List[int], dim: str = 'time') xarray.DataArray | xarray.Dataset

Slicing and extracting the part of the data containing the specified year based on an array of given integer years.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

year_array: list[int]

Year(s) to be extracted.

dimstr

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

Returns

xarray.DataArray.

easyclimate.core.extract.get_specific_months_data(data_input: xarray.DataArray | xarray.Dataset, month_array: numpy.array, dim: str = 'time') xarray.DataArray | xarray.Dataset

Slicing and extracting the part of the data containing the specified year based on an array of given integer months.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

month_array: list[int]

Month(s) to be extracted.

dimstr

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

Returns

xarray.DataArray.

easyclimate.core.extract.get_specific_days_data(data_input: xarray.DataArray | xarray.Dataset, day_array: np.array(int) | List[int], dim: str = 'time') xarray.DataArray | xarray.Dataset

Slicing and extracting the part of the data containing the specified year based on an array of given integer days.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

day_array: list[int]

Days(s) to be extracted.

dimstr

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

Returns

xarray.DataArray.

easyclimate.core.extract.get_specific_hours_data(data_input: xarray.DataArray | xarray.Dataset, hour_array: np.array(int) | List[int], dim: str = 'time') xarray.DataArray | xarray.Dataset

Slicing and extracting the part of the data containing the specified year based on an array of given integer hours.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

hour_array: list[int]

Hour(s) to be extracted.

dimstr

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

Returns

xarray.DataArray.

easyclimate.core.extract.get_specific_minutes_data(data_input: xarray.DataArray | xarray.Dataset, minute_array: np.array(int) | List[int], dim: str = 'time') xarray.DataArray | xarray.Dataset

Slicing and extracting the part of the data containing the specified year based on an array of given integer minutes.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

minute_array: list[int]

Minute(s) to be extracted.

dimstr

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

Returns

xarray.DataArray.

easyclimate.core.extract.get_specific_seconds_data(data_input: xarray.DataArray | xarray.Dataset, second_array: np.array(int) | List[int], dim: str = 'time') xarray.DataArray | xarray.Dataset

Slicing and extracting the part of the data containing the specified year based on an array of given integer seconds.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

second_array: list[int]

Second(s) to be extracted.

dimstr

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

Returns

xarray.DataArray.

easyclimate.core.extract.get_specific_microseconds_data(data_input: xarray.DataArray | xarray.Dataset, microsecond_array: np.array(int) | List[int], dim: str = 'time') xarray.DataArray | xarray.Dataset

Slicing and extracting the part of the data containing the specified year based on an array of given integer microseconds.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

microsecond_array: list[int]

Microsecond(s) to be extracted.

dim: str

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

Returns

xarray.DataArray.

easyclimate.core.extract.get_specific_nanoseconds_data(data_input: xarray.DataArray | xarray.Dataset, nanosecond_array: np.array(int) | List[int], dim: str = 'time') xarray.DataArray | xarray.Dataset

Slicing and extracting the part of the data containing the specified year based on an array of given integer nanoseconds.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

nanosecond_array: list[int]

Nanosecond(s) to be extracted.

dim: str

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

Returns

xarray.DataArray.

easyclimate.core.extract.get_specific_dayofweek_data(data_input: xarray.DataArray | xarray.Dataset, dayofweek_array: np.array(int) | List[int], dim: str = 'time') xarray.DataArray | xarray.Dataset

Slicing and extracting the part of the data containing the specified year based on an array of given integer dayofweek.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

dayofweek_array: list[int]

The days of the week to be extracted.

The integer numbers correspond to the days of the week as follows.

Day of the week

Integer numbers

Monday

0

Tuesday

1

Wednesday

2

Thursday

3

Friday

4

Saturday

5

Sunday

6

dim: str

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

Returns

xarray.DataArray.

easyclimate.core.extract.get_yearmean_for_specific_months_data(data_input: xarray.DataArray | xarray.Dataset, month_array: np.array(int) | List[int], dim: str = 'time', **kwargs) xarray.DataArray | xarray.Dataset

Get the annual average of certain months.

Parameters

data_inputxarray.DataArray

xarray.DataArray to be extracted.

month_array: list[int]

Month(s) to be extracted.

dim: str

Dimension(s) over which to apply extracting. By default extracting is applied over the time dimension.

**kwargs:

Additional keyword arguments passed on to the appropriate array function for calculating mean on this object’s data. These could include dask-specific kwargs like split_every.

Returns

xarray.DataArray.

easyclimate.core.extract.get_year_exceed_index_upper_bound(data_input: xarray.DataArray, thresh: float, time_dim: str = 'time') numpy.array

Extract the years under the specified threshold (upper bound) in the annual average index (one-dimensional data with only a time dimension).

Parameters

data_inputxarray.DataArray

The one-dimensional data with only a time dimension.

thresh: float.

The threshold value.

time_dim: str.

The time coordinate dimension name.

Returns

numpy.array.

easyclimate.core.extract.get_year_exceed_index_lower_bound(data_input: xarray.DataArray, thresh: float, time_dim: str = 'time') numpy.array

Extract the years under the specified threshold (lower bound) in the annual average index (one-dimensional data with only a time dimension).

Parameters

data_inputxarray.DataArray

The one-dimensional data with only a time dimension.

thresh: float.

The threshold value.

time_dim: str.

The time coordinate dimension name.

Returns

numpy.array.

easyclimate.core.extract.get_time_exceed_index_upper_bound(data_input: xarray.DataArray, thresh: float, time_dim: str = 'time') numpy.array

Extract the time under the specified threshold (upper bound) in the annual average index (one-dimensional data with only a time dimension).

Parameters

data_inputxarray.DataArray

The one-dimensional data with only a time dimension.

thresh: float.

The threshold value.

time_dim: str.

The time coordinate dimension name.

Returns

Time array.

easyclimate.core.extract.get_time_exceed_index_lower_bound(data_input: xarray.DataArray, thresh: float, time_dim: str = 'time') numpy.array

Extract the time under the specified threshold (lower bound) in the annual average index (one-dimensional data with only a time dimension).

Parameters

data_inputxarray.DataArray

The one-dimensional data with only a time dimension.

thresh: float.

The threshold value.

time_dim: str.

The time coordinate dimension name.

Returns

Time array.