Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions pysatModels/utils/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from __future__ import unicode_literals

import numpy as np
import pandas as pds
import scipy.interpolate as interpolate

import pandas as pds
import pysat.utils as pyutils

import pysatModels as ps_mod
Expand Down Expand Up @@ -743,11 +743,12 @@ def extract_modelled_observations(inst, model, inst_name, mod_name,
if i > 0]

# Find relevent dimensions for cycling and slicing
ind_dims = [k for k, kk in enumerate(inst_name)
if kk in idim_names]
ind_dims = [k for k, iname in enumerate(inst_name)
if iname in idim_names]
imod_dims = [k for k in ind_dims
if mod_name[k] in dims]
ind_dims = [inst.data.coords.keys().index(inst_name[k])
coord_keys = [ckey for ckey in inst.data.coords.keys()]
ind_dims = [coord_keys.index(inst_name[k])
for k in imod_dims]

# Set the number of cycles
Expand Down
12 changes: 10 additions & 2 deletions pysatModels/utils/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

Routines
--------
load_model_xarray
collect_inst_model_pairs

"""
Expand All @@ -16,12 +17,14 @@
from __future__ import unicode_literals

import datetime as dt
import logging
import numpy as np
from os import path
from pandas import (DateOffset, date_range)

from pandas import (DateOffset, date_range)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are tuples of methods part of a style recommendation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't recall, I normally don't use them.

import pysat

import pysatModels
from pysatModels.utils import extract


Expand Down Expand Up @@ -208,7 +211,12 @@ def collect_inst_model_pairs(start, stop, tinc, inst, inst_download_kwargs={},
istart = start
while start < stop:
# Load the model data for each time
mdata = model_load_rout(start, **model_load_kwargs)
try:
mdata = model_load_rout(start, **model_load_kwargs)
except (IOError, ValueError) as err:
pysatModels.logger.info(
'unable to load model data at {:}\n{:}'.format(start, err))
mdata = None

if mdata is not None:
# Get the range for model longitude
Expand Down