Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flex Extract
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
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
Flexpart
Flex Extract
Commits
a55ac71e
Commit
a55ac71e
authored
6 years ago
by
Anne Philipp
Browse files
Options
Downloads
Patches
Plain Diff
added docstrings for all check functions
parent
e5884c96
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
source/python/mods/checks.py
+48
-4
48 additions, 4 deletions
source/python/mods/checks.py
with
48 additions
and
4 deletions
source/python/mods/checks.py
+
48
−
4
View file @
a55ac71e
...
@@ -32,6 +32,21 @@ import _config
...
@@ -32,6 +32,21 @@ import _config
def
check_grid
(
grid
):
def
check_grid
(
grid
):
'''
Convert grid into correct Lat/Lon format. E.g.
'
0.5/0.5
'
Checks on format of original grid. Wether it is in the order of 1000 or 1.
Convert to correct grid format and substitute into
"
Lat/Lon
"
format string.
Parameters
----------
grid : :obj:`string`
Contains grid information
Return
------
grid : :obj:``string`
Contains grid in format Lat/lon. E.g. 0.1/0.1
'''
if
'
N
'
in
grid
:
if
'
N
'
in
grid
:
return
grid
return
grid
...
@@ -54,9 +69,24 @@ def check_grid(grid):
...
@@ -54,9 +69,24 @@ def check_grid(grid):
return
grid
return
grid
def
check_area
(
grid
,
area
,
upper
,
lower
,
left
,
right
):
def
check_area
(
grid
,
area
,
upper
,
lower
,
left
,
right
):
'''
'''
Defines the correct area string.
Checks on the format of the four area components. Wether it is of
the order of 1000 or 1. Also checks wether area was already set by command
line, then the four components are overwritten.
Convert to correct format of the order of magnitude
"
1
"
and sets the
area parameter (North/West/South/East).
E.g.: -5./20./10./10.
Parameters
----------
grid : :obj:`string`
Contains grid information
Return
------
grid : :obj:``string`
Contains grid in format Lat/lon. E.g. 0.1/0.1
'''
'''
if
'
N
'
in
grid
:
# Gaussian output grid
if
'
N
'
in
grid
:
# Gaussian output grid
area
=
'
G
'
area
=
'
G
'
...
@@ -95,15 +125,29 @@ def check_area(grid, area, upper, lower, left , right):
...
@@ -95,15 +125,29 @@ def check_area(grid, area, upper, lower, left , right):
return
area
return
area
def
check_levels
(
levelist
,
level
):
def
check_levels
(
levelist
,
level
):
'''
'''
Defines correct level list and guarantees that the maximum level is
one of the available maximum levels.
Parameters
Parameters
----------
----------
par : :obj:``
levelist : :obj:`string`
...
Specifies the level list.
Examples: model level: 1/to/137, pressure levels: 500/to/1000
level : :obj:`string`
Specifies the maximum level.
Return
Return
------
------
levelist : :obj:`string`
Specifies the required levels. It has to have a valid
correspondence to the selected levtype.
Examples: model level: 1/to/137, pressure levels: 500/to/1000
level : :obj:`string`
Specifies the maximum level. It has to be one of the
available maximum level number as contained in the variable
MAX_LEVEL_LIST in
"
_config
"
. E.g. [16, 19, 31, 40, 50, 60, 62, 91, 137]
'''
'''
# assure consistency of levelist and level
# assure consistency of levelist and level
...
...
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