Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to interpolator to allow interpolation of dry data #215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/extra/python/isca/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def delete_all_restarts(exp, exceptions=None):



def interpolate_output(infile, outfile, all_fields=True, var_names=[], p_levs = "input"):
def interpolate_output(infile, outfile, all_fields=True, var_names=[], p_levs = "input", dry=False):
"""Interpolate data from sigma to pressure levels. Includes option to remove original file.

This is a very thin wrapper around the plevel.sh script found in
Expand Down Expand Up @@ -170,8 +170,10 @@ def interpolate_output(infile, outfile, all_fields=True, var_names=[], p_levs =
plev = " ".join("{:.0f}".format(x) for x in reversed(sorted(levels)))
if all_fields:
interpolator = interpolator.bake('-a')
if dry:
interpolator = interpolator.bake('-0')
var_names = ' '.join(var_names)

interpolator('-i', infile, '-o', outfile, '-p', plev, var_names)


Expand Down