Skip to content
Snippets Groups Projects
Commit 99caebd5 authored by Aiko Voigt's avatar Aiko Voigt
Browse files

Purely editorial changes: replaced __ with _ in prepare.py

parent 95ef2230
No related branches found
No related tags found
No related merge requests found
......@@ -15,13 +15,13 @@ import xarray as xr
def prepare_grid(model, path, file):
if model == 'ICON':
_ds_grid = __grid_icon(path+file)
_ds_grid = _grid_icon(path+file)
return _ds_grid
# implementation for ICON model
def __grid_icon(_gridfile):
def _grid_icon(_gridfile):
ds_grid = xr.open_dataset(_gridfile)
ds_grid = ds_grid[['neighbor_cell_index', 'edge_of_cell', 'edge_vertices']]
......@@ -52,19 +52,19 @@ def __grid_icon(_gridfile):
def prepare_field(model, path, file, var, threshold, cubulation):
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
def prepare_field_lev(model, path, file, var, threshold, cubulation):
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
# implementation for ICON model
# single-level data
def __field_icon(path, file, var, threshold, cubulation):
def _field_icon(path, file, var, threshold, cubulation):
# field on triangular grid
field = xr.open_dataset(path + file)[var].squeeze().values
......@@ -90,7 +90,7 @@ def __field_icon(path, file, var, threshold, cubulation):
return field, field_cube
# 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 = xr.open_dataset(path + file)[var].squeeze().values
......@@ -116,4 +116,4 @@ def __field_icon_lev(path, file, var, threshold, cubulation):
cube = entry[1] # cube coordinate
field_cube[lev, cube[0], cube[1], cube[2]] = field[lev, triangle]
return field, field_cube
return field, field_cube
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment