Commit 5621c0b5 authored by Woude, Auke van der's avatar Woude, Auke van der
Browse files

removed try-except in favour of an if

parent 3f59d0b7
......@@ -101,7 +101,7 @@ def run_STILT(dacycle, footprint, datepoint, i_species, path, i_member):
i_member : int: index of the ensemblemember
Returns:
float: the concentration increase at the respective location due to the emissions from the respective species"""
# get the date:
# get the emission data:
spatial_emissions = get_spatial_emissions(dacycle, i_member, i_species, path, datepoint)
# multiply footprint with emissions for each hour in the back trajectory. Indices: Time, Category, lat, lon
......@@ -628,10 +628,9 @@ class STILTObservationOperator(ObservationOperator):
self.c14_dict = c14_dict
concentrations = self.calc_concentrations(sample)
try: # If there is a concentration returned, add this to the calculated concentrations.
# Otherwise, keep the Nans.
if any(concentrations): calculated_concentrations[i, :] = concentrations
except: pass #calculated_concentrations = np.delete(calculated_concentrations, i, axis=0)
# If there is a concentration returned, add this to the calculated concentrations.
# Otherwise, keep the Nans.
if concentrations is not None: calculated_concentrations[i, :] = concentrations
# Set the time and site
previously_done_datepoint = datepoint
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment