Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Tom Rink
python
Commits
bd2bae81
Commit
bd2bae81
authored
5 months ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
f35d2783
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/util/acspo_validate.py
+106
-0
106 additions, 0 deletions
modules/util/acspo_validate.py
with
106 additions
and
0 deletions
modules/util/acspo_validate.py
+
106
−
0
View file @
bd2bae81
...
...
@@ -111,3 +111,109 @@ def acspo_validate(oper_file, cspp_file, rel_tol=0.001, outfile_nc=None):
h5f_cspp
.
close
()
return
sst_cspp_2d
,
sst_oper_2d
def
analyze_plot
():
import
h5py
h5f_a
=
h5py
.
File
(
'
/Users/tomrink/20241107055000.nc
'
,
'
r
'
)
h5f_b
=
h5py
.
File
(
'
/Users/tomrink/20241107072000.nc
'
,
'
r
'
)
h5f_c
=
h5py
.
File
(
'
/Users/tomrink/20241107073000.nc
'
,
'
r
'
)
h5f_d
=
h5py
.
File
(
'
/Users/tomrink/20241107170000.nc
'
,
'
r
'
)
h5f_e
=
h5py
.
File
(
'
/Users/tomrink/20241107171000.nc
'
,
'
r
'
)
h5f_f
=
h5py
.
File
(
'
/Users/tomrink/20241107202000.nc
'
,
'
r
'
)
h5f_g
=
h5py
.
File
(
'
/Users/tomrink/20241107203000.nc
'
,
'
r
'
)
import
numpy
as
np
sst_cspp_all
=
np
.
concatenate
([
h5f_a
[
'
sst_cspp
'
][
0
,
:],
h5f_b
[
'
sst_cspp
'
][
0
,
:],
h5f_c
[
'
sst_cspp
'
][
0
,
:],
h5f_d
[
'
sst_cspp
'
][
0
,
:],
h5f_e
[
'
sst_cspp
'
][
0
,
:],
h5f_f
[
'
sst_cspp
'
][
0
,
:],
h5f_g
[
'
sst_cspp
'
][
0
,
:]])
sst_cspp_all
.
shape
sst_oper_all
=
np
.
concatenate
([
h5f_a
[
'
sst_oper
'
][
0
,
:],
h5f_b
[
'
sst_oper
'
][
0
,
:],
h5f_c
[
'
sst_oper
'
][
0
,
:],
h5f_d
[
'
sst_oper
'
][
0
,
:],
h5f_e
[
'
sst_oper
'
][
0
,
:],
h5f_f
[
'
sst_oper
'
][
0
,
:],
h5f_g
[
'
sst_oper
'
][
0
,
:]])
sst_oper_all
.
shape
diff
=
sst_cspp_all
-
sst_oper_all
import
matplotlib.pyplot
as
plt
plt
.
hist
(
diff
,
bins
=
40
)
plt
.
yscale
(
'
log
'
)
plt
.
title
(
'
ACSPO SST (CSPP - OPER)
'
)
import
h5py
h5f_a
=
h5py
.
File
(
'
/Users/tomrink/20241107055000.nc
'
,
'
r
'
)
h5f_b
=
h5py
.
File
(
'
/Users/tomrink/20241107072000.nc
'
,
'
r
'
)
h5f_c
=
h5py
.
File
(
'
/Users/tomrink/20241107073000.nc
'
,
'
r
'
)
h5f_d
=
h5py
.
File
(
'
/Users/tomrink/20241107170000.nc
'
,
'
r
'
)
h5f_e
=
h5py
.
File
(
'
/Users/tomrink/20241107171000.nc
'
,
'
r
'
)
h5f_f
=
h5py
.
File
(
'
/Users/tomrink/20241107202000.nc
'
,
'
r
'
)
h5f_g
=
h5py
.
File
(
'
/Users/tomrink/20241107203000.nc
'
,
'
r
'
)
import
numpy
as
np
sst_cspp_all
=
np
.
concatenate
([
h5f_a
[
'
sst_cspp
'
][
0
,
:],
h5f_b
[
'
sst_cspp
'
][
0
,
:],
h5f_c
[
'
sst_cspp
'
][
0
,
:],
h5f_d
[
'
sst_cspp
'
][
0
,
:],
h5f_e
[
'
sst_cspp
'
][
0
,
:],
h5f_f
[
'
sst_cspp
'
][
0
,
:],
h5f_g
[
'
sst_cspp
'
][
0
,
:]])
sst_oper_all
=
np
.
concatenate
([
h5f_a
[
'
sst_oper
'
][
0
,
:],
h5f_b
[
'
sst_oper
'
][
0
,
:],
h5f_c
[
'
sst_oper
'
][
0
,
:],
h5f_d
[
'
sst_oper
'
][
0
,
:],
h5f_e
[
'
sst_oper
'
][
0
,
:],
h5f_f
[
'
sst_oper
'
][
0
,
:],
h5f_g
[
'
sst_oper
'
][
0
,
:]])
diff
=
sst_cspp_all
-
sst_oper_all
import
matplotlib.pyplot
as
plt
plt
.
hist
(
diff
,
bins
=
40
)
plt
.
yscale
(
'
log
'
)
plt
.
xlabel
(
'
SST (
\u00b0
K)
'
)
plt
.
title
(
'
ACSPO SST (CSPP - OPER), Clear Sky, 2024-11_07
'
)
import
numpy
as
np
c_a
=
np
.
isclose
(
sst_cspp_all
,
sst_oper_all
,
rtol
=
0.001
)
c_a
.
shape
sst_cspp_all
.
shape
c_a_i
=
np
.
invert
(
c_a
)
plt
.
scatter
(
sst_cspp_all
[
c_a_i
],
diff
[
c_a_i
])
plt
.
close
()
plt
.
scatter
(
sst_cspp_all
[
c_a_i
],
diff
[
c_a_i
],
s
=
1
)
plt
.
title
(
'
ACSPO SST (CSPP-OPER) > rel_tol=0.001 vs SST
'
)
plt
.
xlabel
(
'
SST (
\u00b0
K)
'
)
plt
.
ylabel
(
'
SST (
\u00b0
K)
'
)
plt
.
show
()
import
h5py
h5f_a
=
h5py
.
File
(
'
/Users/tomrink/20241107055000.nc
'
,
'
r
'
)
h5f_b
=
h5py
.
File
(
'
/Users/tomrink/20241107072000.nc
'
,
'
r
'
)
h5f_c
=
h5py
.
File
(
'
/Users/tomrink/20241107073000.nc
'
,
'
r
'
)
h5f_d
=
h5py
.
File
(
'
/Users/tomrink/20241107170000.nc
'
,
'
r
'
)
h5f_e
=
h5py
.
File
(
'
/Users/tomrink/20241107171000.nc
'
,
'
r
'
)
h5f_f
=
h5py
.
File
(
'
/Users/tomrink/20241107202000.nc
'
,
'
r
'
)
h5f_g
=
h5py
.
File
(
'
/Users/tomrink/20241107203000.nc
'
,
'
r
'
)
import
numpy
as
np
sst_cspp_all
=
np
.
concatenate
(
[
h5f_a
[
'
sst_cspp
'
][
0
,
:],
h5f_b
[
'
sst_cspp
'
][
0
,
:],
h5f_c
[
'
sst_cspp
'
][
0
,
:],
h5f_d
[
'
sst_cspp
'
][
0
,
:],
h5f_e
[
'
sst_cspp
'
][
0
,
:],
h5f_f
[
'
sst_cspp
'
][
0
,
:],
h5f_g
[
'
sst_cspp
'
][
0
,
:]])
sst_cspp_all
.
shape
sst_oper_all
=
np
.
concatenate
(
[
h5f_a
[
'
sst_oper
'
][
0
,
:],
h5f_b
[
'
sst_oper
'
][
0
,
:],
h5f_c
[
'
sst_oper
'
][
0
,
:],
h5f_d
[
'
sst_oper
'
][
0
,
:],
h5f_e
[
'
sst_oper
'
][
0
,
:],
h5f_f
[
'
sst_oper
'
][
0
,
:],
h5f_g
[
'
sst_oper
'
][
0
,
:]])
sst_oper_all
.
shape
diff
=
sst_cspp_all
-
sst_oper_all
import
matplotlib.pyplot
as
plt
plt
.
hist
(
diff
,
bins
=
40
)
plt
.
yscale
(
'
log
'
)
plt
.
title
(
'
ACSPO SST (CSPP - OPER)
'
)
import
h5py
h5f_a
=
h5py
.
File
(
'
/Users/tomrink/20241107055000.nc
'
,
'
r
'
)
h5f_b
=
h5py
.
File
(
'
/Users/tomrink/20241107072000.nc
'
,
'
r
'
)
h5f_c
=
h5py
.
File
(
'
/Users/tomrink/20241107073000.nc
'
,
'
r
'
)
h5f_d
=
h5py
.
File
(
'
/Users/tomrink/20241107170000.nc
'
,
'
r
'
)
h5f_e
=
h5py
.
File
(
'
/Users/tomrink/20241107171000.nc
'
,
'
r
'
)
h5f_f
=
h5py
.
File
(
'
/Users/tomrink/20241107202000.nc
'
,
'
r
'
)
h5f_g
=
h5py
.
File
(
'
/Users/tomrink/20241107203000.nc
'
,
'
r
'
)
import
numpy
as
np
sst_cspp_all
=
np
.
concatenate
(
[
h5f_a
[
'
sst_cspp
'
][
0
,
:],
h5f_b
[
'
sst_cspp
'
][
0
,
:],
h5f_c
[
'
sst_cspp
'
][
0
,
:],
h5f_d
[
'
sst_cspp
'
][
0
,
:],
h5f_e
[
'
sst_cspp
'
][
0
,
:],
h5f_f
[
'
sst_cspp
'
][
0
,
:],
h5f_g
[
'
sst_cspp
'
][
0
,
:]])
sst_oper_all
=
np
.
concatenate
(
[
h5f_a
[
'
sst_oper
'
][
0
,
:],
h5f_b
[
'
sst_oper
'
][
0
,
:],
h5f_c
[
'
sst_oper
'
][
0
,
:],
h5f_d
[
'
sst_oper
'
][
0
,
:],
h5f_e
[
'
sst_oper
'
][
0
,
:],
h5f_f
[
'
sst_oper
'
][
0
,
:],
h5f_g
[
'
sst_oper
'
][
0
,
:]])
diff
=
sst_cspp_all
-
sst_oper_all
import
matplotlib.pyplot
as
plt
plt
.
hist
(
diff
,
bins
=
40
)
plt
.
yscale
(
'
log
'
)
plt
.
xlabel
(
'
SST (
\u00b0
K)
'
)
plt
.
title
(
'
ACSPO SST (CSPP - OPER), Clear Sky, 2024-11_07
'
)
import
numpy
as
np
c_a
=
np
.
isclose
(
sst_cspp_all
,
sst_oper_all
,
rtol
=
0.001
)
c_a
.
shape
sst_cspp_all
.
shape
c_a_i
=
np
.
invert
(
c_a
)
plt
.
scatter
(
sst_cspp_all
[
c_a_i
],
diff
[
c_a_i
])
plt
.
close
()
plt
.
scatter
(
sst_cspp_all
[
c_a_i
],
diff
[
c_a_i
],
s
=
1
)
plt
.
title
(
'
ACSPO SST (CSPP-OPER) > rel_tol=0.001 vs SST
'
)
plt
.
xlabel
(
'
SST (
\u00b0
K)
'
)
plt
.
ylabel
(
'
SST (
\u00b0
K)
'
)
plt
.
show
()
\ No newline at end of file
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