Commit 107cec70 authored by Woude, Auke van der's avatar Woude, Auke van der
Browse files

specify dir with obs; specify what species to use

parent 92a90305
......@@ -150,17 +150,12 @@ class RINGOObservations(Observations):
continue
# For integrated samples, we have to expand the samples list with every time that is in the integration
if spcs[n] == 'c14_integrated' and not np.isnan(obs[n]):
print('expanding samples')
self.expand_integrated_sample(ncf)
strategy = 'integrated'
# simulated HPHR flag lat strategy
# ID, dates, datasetname, observed, resid mdm height lon, evn, species, stdev, fromfile
self.datalist.append(MoleFractionSample(ids[n], dates[n], datasetname, obs[n], 0.0, 0.0, 0.0, 0.0, 0, alts[n], lats[n], lons[n], '001', spcs[n].upper(), strategy, 0.0, infile))
ncf.close()
self.datalist.sort(key = lambda x: x.species) # Sort on the species, site and date, with date being the most important ergo last one.
self.datalist.sort(key = lambda x: x.code, reverse=True)
self.datalist.sort(key = lambda x: x.xdate)
logging.debug('Observations list sorted')
logging.info("Observations list now holds %d values" % len(self.datalist))
......@@ -379,7 +374,6 @@ class RINGOObservations(Observations):
site_incalt[identifier.strip()] = (int(incalt))
datalist_new = []
for obs in self.datalist: # loop over all available data points
obs.mdm = 1000.0 # default is very high model-data-mismatch, until explicitly set by script
......@@ -432,10 +426,18 @@ class RINGOObservations(Observations):
logging.warning("Observation location for (%s, %d), is moved by %3.2f meters in altitude" % (identifier, obs.id, incalt))
datalist_new = []
for obs in self.datalist:
if not obs.flag == 99:
datalist_new.append(obs)
logging.debug('Removed {} items from the datalist.'.format(len(self.datalist)-len(datalist_new)))
elif obs.samplingstrategy == 'pseudointegratedsample':
datalist_new.append(obs)
self.datalist = datalist_new
logging.debug('superfluous samples removed from the datalist')
self.datalist.sort(key = lambda x: x.species) # Sort on the species, site and date, with date being the most important ergo last one.
self.datalist.sort(key = lambda x: x.code, reverse=True)
self.datalist.sort(key = lambda x: x.xdate)
logging.debug('Observations list sorted')
# Add site_info dictionary to the Observations object for future use
self.site_info = site_info
......
......@@ -765,7 +765,6 @@ class STILTObservationOperator(ObservationOperator):
ff_increase = self.calc_concentrations(sample)
# Store the calculate ffCO2
self.c14_dict[site][datepoint]['ff'] = ff_increase[:] - self.get_background_orig('CO2')
print('fossil fuel emissions calculated')
# Now, we have all things needed to calculate the C14. We do this by using this very funciton
# And pretend the species is C14.
......
......@@ -6,11 +6,11 @@ inputdir : /projects/0/ctdas/RINGO/inversions/ffdas/input/
obs.input.id : obsfiles.csv
! number of observation sites included; number of species included and to be used in inversion
obs.input.nr : 100
obs.spec.nr : 2
obs.dir : obsfiles1a
do.co : 1
do.c14integrated: 1
do.c14targeted: 1
obs.spec.nr : 1
obs.dir : obsfiles1b
do.co : 0
do.c14integrated: 0
do.c14targeted: 0
obs.spec.name : CO2,CO
! number of emission categories defined in the emission model
obs.cat.nr : 14
......
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