cube_apply_FFT.py
#
Utility function to apply forward FFT along specified axis of 3D cube (netCDF).
get_freq_filter_win(filter_freqs, frequencies, dim='freq_twt', filter_type='lowpass')
#
Calculate filter window (highpass
, lowpass
, or bandpass
) in frequency domain.
Parameters:
-
filter_freqs
(list
) –Cut-off frequencies as [fmin, fmax] for
highpass
orlowpass
and [f1, f2, f3, f4] forbandpass
. Must be same units asfrequencies
(e.g., kHz). -
frequencies
(DataArray
) –DataArray coordinate of frequencies. Must be same units as
filter_freqs
(e.g., kHz). -
filter_type
(str
, default:'lowpass'
) –Filter type in frequency domain (default:
lowpass
)
Returns:
-
DataArray
–Filter window with values in range [0, 1] that can be used for multiplication.
Source code in pseudo_3D_interpolation\cube_apply_FFT.py
get_freq_filter_mask(da, dim, freqs, filter_type='lowpass')
#
Return mask of filtered frequency samples.
Parameters:
-
da
((DataArray, Dataset)
) –Input data (in frequency domin).
-
dim
(str
) –Name of frequency dimension (default: 'freq_{NAME}').
-
freqs
(list
) –List of filter frequencies as [fmin, fmax] (lowpass, highpass) or [f1, f2, f3, f4] (bandpass).
-
filter_type
(str
, default:'lowpass'
) –Filter type (default: 'lowpass'). Available options are 'lowpass', 'higpass' and 'bandpass'.
Returns:
-
DataArray
–Boolean mask DataArray (for multiplication with input data).
Source code in pseudo_3D_interpolation\cube_apply_FFT.py
main(argv=sys.argv, return_dataset=False)
#
Apply FFT along time axis wrapper function.
Source code in pseudo_3D_interpolation\cube_apply_FFT.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
|