Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tricco
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Climate
tricco
Commits
99caebd5
Commit
99caebd5
authored
Jun 6, 2022
by
Aiko Voigt
Browse files
Options
Downloads
Patches
Plain Diff
Purely editorial changes: replaced __ with _ in prepare.py
parent
95ef2230
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tricco/prepare.py
+7
-7
7 additions, 7 deletions
tricco/prepare.py
with
7 additions
and
7 deletions
tricco/prepare.py
+
7
−
7
View file @
99caebd5
...
@@ -15,13 +15,13 @@ import xarray as xr
...
@@ -15,13 +15,13 @@ import xarray as xr
def
prepare_grid
(
model
,
path
,
file
):
def
prepare_grid
(
model
,
path
,
file
):
if
model
==
'
ICON
'
:
if
model
==
'
ICON
'
:
_ds_grid
=
_
_grid_icon
(
path
+
file
)
_ds_grid
=
_grid_icon
(
path
+
file
)
return
_ds_grid
return
_ds_grid
# implementation for ICON model
# implementation for ICON model
def
_
_grid_icon
(
_gridfile
):
def
_grid_icon
(
_gridfile
):
ds_grid
=
xr
.
open_dataset
(
_gridfile
)
ds_grid
=
xr
.
open_dataset
(
_gridfile
)
ds_grid
=
ds_grid
[[
'
neighbor_cell_index
'
,
'
edge_of_cell
'
,
'
edge_vertices
'
]]
ds_grid
=
ds_grid
[[
'
neighbor_cell_index
'
,
'
edge_of_cell
'
,
'
edge_vertices
'
]]
...
@@ -52,19 +52,19 @@ def __grid_icon(_gridfile):
...
@@ -52,19 +52,19 @@ def __grid_icon(_gridfile):
def
prepare_field
(
model
,
path
,
file
,
var
,
threshold
,
cubulation
):
def
prepare_field
(
model
,
path
,
file
,
var
,
threshold
,
cubulation
):
if
model
==
'
ICON
'
:
if
model
==
'
ICON
'
:
_field
,
_field_cube
=
_
_field_icon
(
path
,
file
,
var
,
threshold
,
cubulation
)
_field
,
_field_cube
=
_field_icon
(
path
,
file
,
var
,
threshold
,
cubulation
)
return
_field
,
_field_cube
return
_field
,
_field_cube
def
prepare_field_lev
(
model
,
path
,
file
,
var
,
threshold
,
cubulation
):
def
prepare_field_lev
(
model
,
path
,
file
,
var
,
threshold
,
cubulation
):
if
model
==
'
ICON
'
:
if
model
==
'
ICON
'
:
_field
,
_field_cube
=
_
_field_icon_lev
(
path
,
file
,
var
,
threshold
,
cubulation
)
_field
,
_field_cube
=
_field_icon_lev
(
path
,
file
,
var
,
threshold
,
cubulation
)
return
_field
,
_field_cube
return
_field
,
_field_cube
# implementation for ICON model
# implementation for ICON model
# single-level data
# single-level data
def
_
_field_icon
(
path
,
file
,
var
,
threshold
,
cubulation
):
def
_field_icon
(
path
,
file
,
var
,
threshold
,
cubulation
):
# field on triangular grid
# field on triangular grid
field
=
xr
.
open_dataset
(
path
+
file
)[
var
].
squeeze
().
values
field
=
xr
.
open_dataset
(
path
+
file
)[
var
].
squeeze
().
values
...
@@ -90,7 +90,7 @@ def __field_icon(path, file, var, threshold, cubulation):
...
@@ -90,7 +90,7 @@ def __field_icon(path, file, var, threshold, cubulation):
return
field
,
field_cube
return
field
,
field_cube
# data on multiple levels
# data on multiple levels
def
_
_field_icon_lev
(
path
,
file
,
var
,
threshold
,
cubulation
):
def
_field_icon_lev
(
path
,
file
,
var
,
threshold
,
cubulation
):
# field on triangular grid
# field on triangular grid
field
=
xr
.
open_dataset
(
path
+
file
)[
var
].
squeeze
().
values
field
=
xr
.
open_dataset
(
path
+
file
)[
var
].
squeeze
().
values
...
...
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