Interpolate in time
el_paso.processing.interpolate_in_time
Functions:
el_paso.processing.interpolate_in_time.interpolate_in_time
interpolate_in_time
Interpolates one or more variables by time according to specified methods and target axis.
This function takes an original time variable and a dictionary of other variables, then interpolates these variables over a new time basis. The new basis can either be generated via a target cadence (with optional start/end times) or explicitly provided via a target time variable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_variable
|
Variable
|
The master time variable that defines the original
time basis for all other variables. Its data should be in a time
unit (e.g., |
required |
variables
|
dict[str, Variable]
|
A dictionary where keys are variable names (str) and values
are the |
required |
interpolation_method_dict
|
dict[str, InterpolationMethod]
|
A dictionary mapping variable names (str) to interpolation method strings (e.g., "linear", "nearest"), specifying how each variable should be interpolated. If a variable is not present in this dictionary, it will be skipped. |
required |
target_cadence
|
timedelta | None
|
Optional. A |
None
|
target_time_variable
|
Variable | None
|
Optional. An explicit target time variable
to interpolate onto. If provided, |
None
|
start_time
|
datetime | None
|
Optional. A |
None
|
end_time
|
datetime | None
|
Optional. A |
None
|
fill_value
|
Literal['extrapolate'] | float
|
Optional. The value used to fill data points outside the bounds
of the original time variable. Defaults to |
nan
|
max_gap_seconds
|
float | None
|
Optional. The maximum allowable time gap (in seconds) between two
consecutive original timestamps. Target timestamps falling within a gap larger than this
value will not be interpolated and will be masked with |
None
|
Returns:
| Type | Description |
|---|---|
Variable
|
ep.Variable: An |
Variable
|
|
Variable
|
each variable's data updated to its interpolated values. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither |
TypeError
|
If an input data array is not a numeric type. |
Source code in el_paso/processing/interpolate_in_time.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |