Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
brivas
ORCHESTRA-SST
Commits
f0b3a85b
Commit
f0b3a85b
authored
4 years ago
by
Beatriz Recinos
Browse files
Options
Download
Email Patches
Plain Diff
update config.ini
parent
5240855c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
config.ini
config.ini
+4
-1
sst_tools/workflow_sst.py
sst_tools/workflow_sst.py
+22
-0
No files found.
config.ini
View file @
f0b3a85b
...
...
@@ -15,4 +15,7 @@ satellite_sst_buoy_1x1 = '/gws/nopw/j04/orchestra_vol2/ESAcci_sst_v2.1_coarse/v2
satellite_sst_buoy_2x2
=
'/gws/nopw/j04/orchestra_vol2/ESAcci_sst_v2.1_coarse/v2.1_atbuoy_2x2/'
time_series
=
'/gws/nopw/j04/orchestra_vol2/ESAcci_sst_v2.1_coarse/time_series_ESAcci_sst/'
\ No newline at end of file
# Local paths for local scripts
time_series
=
'/Users/brivas/ORCHESTRA_sst/input_data/time_series_ESAcci_sst/'
combined_data
=
'/Users/brivas/ORCHESTRA_sst/input_data/netcdf_ESAcci_sst_resampled'
\ No newline at end of file
This diff is collapsed.
Click to expand it.
sst_tools/workflow_sst.py
View file @
f0b3a85b
...
...
@@ -4,6 +4,7 @@ import numpy as np
np
.
seterr
(
divide
=
'ignore'
,
invalid
=
'ignore'
)
import
xarray
as
xr
from
scipy.stats
import
binned_statistic_2d
from
scipy.signal
import
find_peaks
from
datetime
import
datetime
from
collections
import
defaultdict
...
...
@@ -466,8 +467,29 @@ def calculate_time_moving_weighted_average(var_to_avg, weights, time_stamp, var_
return
weighted_avg
def
find_local_minima_maxima
(
signal
,
height
,
time
):
"""
Calculates local minima and maxima based in scipy.signal.find.peaks()
For more information
see: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html
Parameters
----------
signal: time series values
prominence: required prominence of peaks.
height: height of the peak. 0 from baseline
time: dates array to identify the time for a minima
Returns
-------
dates_with_maxima, dates_with_minima
"""
maxima
=
find_peaks
(
signal
,
height
=
height
)
minima
=
find_peaks
(
-
signal
,
height
=
height
)
dates_p
=
time
.
iloc
[
maxima
[
0
]].
values
dates_n
=
time
.
iloc
[
minima
[
0
]].
values
return
dates_p
,
dates_n
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment