Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymistral
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Aaron Spring
pymistral
Commits
bbad7210
Commit
bbad7210
authored
5 years ago
by
Aaron Spring
Browse files
Options
Downloads
Patches
Plain Diff
outpath
parent
de8265c9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pymistral/cdo_post.py
+7
-5
7 additions, 5 deletions
pymistral/cdo_post.py
with
7 additions
and
5 deletions
pymistral/cdo_post.py
+
7
−
5
View file @
bbad7210
...
...
@@ -18,7 +18,7 @@ expid = 'asp_esmControl_PMassim_3014_TSDICALK_over_3170'
exppath
=
'
/work/bm1124/m300524/experiments
'
year
=
3171
# year to get output labels from
outpath
=
os
.
path
.
expanduser
(
'
~/pymistral/
'
)
# folder to save output_df to
outpath
=
'
.
'
def
find_all_outdatatypes_in_exp
(
expid
=
expid
,
exppath
=
exppath
,
year
=
1990
):
"""
Find all outdatatypes (tracer,atm,data_2d,...) from experiment `expid`
...
...
@@ -54,7 +54,7 @@ def find_all_outdatatypes_in_exp(expid=expid, exppath=exppath, year=1990):
def
read_all_outdatatype_files_to_ds
(
outdatatypes
,
expid
=
expid
,
exppath
=
exppath
,
year
=
year
,
outpath
=
'
~/.
'
outdatatypes
,
expid
=
expid
,
exppath
=
exppath
,
year
=
year
,
outpath
=
'
~/.
'
,
table_path
=
None
,
):
"""
Read all outdatatypes from experiment `expid` from path `exppath` of a
given `year` and return xr.Dataset.
"""
...
...
@@ -78,8 +78,10 @@ def read_all_outdatatype_files_to_ds(
):
options
+=
'
-t echam6
'
else
:
if
table_path
is
None
:
table_path
=
f
'
{
exppath
}
/
{
expid
}
/log
'
table
=
(
f
'
{
exppath
}
/
{
expid
}
/log
/
'
f
'
{
table_path
}
/
'
+
f
'
{
expid
}
_
{
model
}
_
{
outdatatype
[
:
2
]
}
*.codes
'
)
options
+=
'
-t
'
+
table
...
...
@@ -124,7 +126,7 @@ def create_dataframe_of_output_info(ds, outpath=outpath):
def
generate_output_df
(
expid
=
expid
,
exppath
=
exppath
,
year
=
year
,
outpath
=
outpath
,
recalc
=
False
expid
=
expid
,
exppath
=
exppath
,
year
=
year
,
outpath
=
outpath
,
recalc
=
False
,
table_path
=
None
):
"""
Combine all functions above to generate output from `expid` or just load
if not `recalc`.
"""
...
...
@@ -141,7 +143,7 @@ def generate_output_df(
expid
=
expid
,
exppath
=
exppath
,
year
=
year
)
ds
=
read_all_outdatatype_files_to_ds
(
outdatatypes
,
expid
=
expid
,
exppath
=
exppath
,
year
=
year
,
outpath
=
outpath
outdatatypes
,
expid
=
expid
,
exppath
=
exppath
,
year
=
year
,
outpath
=
outpath
,
table_path
=
table_path
)
output_df
=
create_dataframe_of_output_info
(
ds
,
outpath
=
outpath
)
return
output_df
...
...
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