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
1867af70
Commit
1867af70
authored
4 years ago
by
Beatriz Recinos
Browse files
Options
Download
Email Patches
Plain Diff
fixed animation error
parent
43fa9be1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
16 deletions
+10
-16
scripts/plot_cci_buoy_error.py
scripts/plot_cci_buoy_error.py
+7
-9
sst_tools/workflow_sst.py
sst_tools/workflow_sst.py
+3
-7
No files found.
scripts/plot_cci_buoy_error.py
View file @
1867af70
...
...
@@ -126,10 +126,8 @@ for hour in hours_list_to_plot:
plot_sst
.
plot_sst_map
(
cci_to_plot
,
ax
=
ax
,
vmin
=-
7
,
vmax
=
7
)
for
date
in
dates_list
:
buoy_data
=
df_buoy
[
date
.
strftime
(
'%Y-%m-%d'
)][
0
]
if
buoy_data
.
empty
:
pass
else
:
try
:
buoy_data
=
df_buoy
[
date
.
strftime
(
'%Y-%m-%d'
)][
0
]
xx
=
buoy_data
.
lon
.
values
yy
=
buoy_data
.
lat
.
values
s
=
30
/
buoy_data
.
age
.
values
...
...
@@ -142,6 +140,8 @@ for hour in hours_list_to_plot:
c
=
temp
,
cmap
=
cmap
,
vmin
=-
1
,
vmax
=
1
,
edgecolors
=
'k'
,
linewidths
=
0.5
,
transform
=
crs
.
PlateCarree
())
except
IndexError
:
pass
# Now adding the colour-bar
cax
,
kw
=
colorbar
.
make_axes
(
ax
,
location
=
'top'
,
pad
=
0.07
,
aspect
=
30
)
...
...
@@ -156,10 +156,8 @@ for hour in hours_list_to_plot:
f
.
suptitle
(
plot_end_date
)
#ax.set_title()
plot_name
=
str
(
int
(
year
))
+
'_'
+
f
"
{
str
(
int
(
month
)):
0
>
2
}
"
\
+
f
"
{
str
(
int
(
day_to_plot
)):
0
>
2
}
"
+
f
"
{
str
(
int
(
hour
)):
0
>
2
}
"
plot_name
=
str
(
int
(
year
))
+
'_'
+
f
"
{
str
(
int
(
month
)):
0
>
2
}
"
+
f
"
{
str
(
int
(
day_to_plot
)):
0
>
2
}
"
+
f
"
{
str
(
int
(
hour
)):
0
>
2
}
"
plt
.
savefig
(
os
.
path
.
join
(
config
[
'plots_path'
],
plot_name
+
'.png'
),
bbox_inches
=
'tight'
,
pad_inches
=
0.25
)
bbox_inches
=
'tight'
,
pad_inches
=
0.25
)
plt
.
clf
()
plt
.
close
(
f
)
plt
.
close
(
f
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
sst_tools/workflow_sst.py
View file @
1867af70
...
...
@@ -92,11 +92,7 @@ def process_hour_drift_from_start_to_end(df,
day_df
=
day_df
.
dropna
(
subset
=
[
'lon'
,
'lat'
])
if
day_df
.
empty
:
day_df
=
day_df
.
assign
(
cci_sst
=
np
.
NaN
)
day_df
[
'cci_sst_2x2'
]
=
np
.
NaN
day_df
[
'cci_sst_1x1'
]
=
np
.
NaN
day_df
=
day_df
.
assign
(
sst_z_mean
=
np
.
NaN
)
day_df
[
'age'
]
=
day_df
[
'date'
].
apply
(
lambda
x
:
age
.
get
(
x
.
strftime
(
'%Y-%m-%d'
)))
pass
else
:
# It is important when using interp that you convert to xarray!
yy
=
xr
.
DataArray
(
day_df
.
lat
.
values
,
dims
=
'z'
)
...
...
@@ -137,8 +133,8 @@ def process_hour_drift_from_start_to_end(df,
day_df
[
'age'
]
=
day_df
[
'date'
].
apply
(
lambda
x
:
age
.
get
(
x
.
strftime
(
'%Y-%m-%d'
)))
# Save all in a dictionary lead by date
d
[
date
.
strftime
(
'%Y-%m-%d'
)].
append
(
day_df
)
return
d
d
[
date
.
strftime
(
'%Y-%m-%d'
)].
append
(
day_df
)
return
d
def
compute_coarsen
(
data
,
resolution
):
...
...
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