Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Commits
e32f012e
Commit
e32f012e
authored
3 years ago
by
leufen1
Browse files
Options
Downloads
Patches
Plain Diff
try out dask approach
parent
f13604b0
Branches
Branches containing commit
Tags
Tags containing commit
5 merge requests
!319
add all changes of dev into release v1.4.0 branch
,
!318
Resolve "release v1.4.0"
,
!317
enabled window_lead_time=1
,
!295
Resolve "data handler FIR filter"
,
!259
Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline
#67277
passed
3 years ago
Stage: test
Stage: docs
Stage: pages
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mlair/helpers/filter.py
+6
-5
6 additions, 5 deletions
mlair/helpers/filter.py
with
6 additions
and
5 deletions
mlair/helpers/filter.py
+
6
−
5
View file @
e32f012e
...
...
@@ -10,6 +10,7 @@ import pandas as pd
from
matplotlib
import
pyplot
as
plt
from
scipy
import
signal
import
xarray
as
xr
import
dask.array
as
da
from
mlair.helpers
import
to_list
,
TimeTrackingWrapper
,
TimeTracking
...
...
@@ -267,10 +268,10 @@ class ClimateFIRFilter:
"
causal
"
:
False
,
"
padlen
"
:
int
(
min
(
padlen_factor
,
1
)
*
length
)}
with
TimeTracking
():
filt
=
fir_filter_numpy_vectorized
(
filter_input_data
,
var_dim
,
kwargs
)
#
with TimeTracking():
#
filt = xr.apply_ufunc(fir_filter_vectorized, filter_input_data, time_axis,
#
input_core_dims=[[new_dim], []], output_core_dims=[[new_dim]], vectorize=True,
#
kwargs=kwargs)
with
TimeTracking
():
filt
=
xr
.
apply_ufunc
(
fir_filter_vectorized
,
filter_input_data
,
time_axis
,
input_core_dims
=
[[
new_dim
],
[]],
output_core_dims
=
[[
new_dim
]],
vectorize
=
True
,
kwargs
=
kwargs
)
# plot
if
self
.
plot_path
is
not
None
:
...
...
@@ -397,7 +398,7 @@ def fir_filter_numpy_vectorized(filter_input_data, var_dim, kwargs):
for
var
in
filter_input_data
.
coords
[
var_dim
]:
logging
.
info
(
f
"
{
filter_input_data
.
coords
[
'
Stations
'
].
values
[
0
]
}
:
{
str
(
var
.
values
)
}
"
)
# ToDo must be removed, just for debug
a
=
np
.
apply_along_axis
(
fir_filter_vectorized
,
2
,
filter_input_data
.
sel
({
var_dim
:
var
}).
values
,
**
kwargs
)
a
=
da
.
apply_along_axis
(
fir_filter_vectorized
,
2
,
filter_input_data
.
sel
({
var_dim
:
var
}).
values
,
**
kwargs
)
filt_np
.
loc
[{
var_dim
:
var
}]
=
a
return
filt_np
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment