Skip to content

Commit

Permalink
fixed bug when detecting variables from different realms at once
Browse files Browse the repository at this point in the history
  • Loading branch information
paolap committed Aug 21, 2024
1 parent 11e1c09 commit 3cef828
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mopdb/mopdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def write_intake(ctx, fpath, match, filelist, dbname, version, alias):
if fpath.is_file():
mopdb_log.error(f""" {fpath}
should be absolute or relative path to model output.
To pass a varlist or map file use --filelist/-f""")
To pass a varlist or map file use --filelist/-fl""")
elif filelist is None:
mopdb_log.debug(f"Calling write_varlist() from intake: {fpath}")
fname, vobjs, fobjs = write_varlist(conn, fpath, match, version, alias)
Expand Down
2 changes: 1 addition & 1 deletion src/mopdb/mopdb_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def write_varlist(conn, indir, match, version, alias):
if fpattern in patterns:
continue
patterns.append(fpattern)
fobj = FPattern(fpattern, Path(indir))
fobj = FPattern(fpattern, fpath.parent)
#pattern_list = list_files(indir, f"{fpattern}*")
nfiles = len(fobj.files)
mopdb_log.debug(f"File pattern, number of files: {fpattern}, {nfiles}")
Expand Down
2 changes: 1 addition & 1 deletion src/mopdb/mopdb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def check_realm_units(conn, var):

def get_realm(version, ds):
'''Try to retrieve realm if using path failed'''

realm = 'NArealm'
mopdb_log = logging.getLogger('mopdb_log')
if version == 'AUS2200':
realm = 'atmos'
Expand Down
4 changes: 3 additions & 1 deletion src/mopper/calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,11 @@ def get_plev(ctx, levnum):
@click.pass_context
def plevinterp(ctx, var, pmod, levnum):
"""Interpolating var from model levels to pressure levels
_extended_summary_
Based on function from Dale Roberts (currently ANU)
Parameters
----------
var : Xarray DataArray
Expand Down

0 comments on commit 3cef828

Please sign in to comment.