Commit 51a698e1 authored by karolina's avatar karolina
Browse files

removed "oldstyle" and "newstyle" checkings from write_obs_to_file (it was...

removed "oldstyle" and "newstyle" checkings from write_obs_to_file (it was added for debugging purposes at some point...)
parent 4face3de
......@@ -314,14 +314,14 @@ class CtObservations(Observation):
self.SiteInfo = SiteInfo
def write_obs_to_file(self,filenam="oldstyle"):
def write_obs_to_file(self):
"""
Write selected information contained in the Observation object to a file.
"""
import da.tools.io4 as io
outfile = os.path.join(self.DaCycle['dir.output'], 'sampleinfo_%s__%s.nc' % (self.DaCycle['time.sample.stamp'], filenam))
outfile = os.path.join(self.DaCycle['dir.output'], 'sampleinfo_%s.nc' % (self.DaCycle['time.sample.stamp']))
f = io.CT_CDF(outfile, method='create')
logging.debug('Creating new Sample output file for postprocessing (%s)' % outfile)
......
......@@ -360,14 +360,14 @@ class ObsPackObservations(Observation):
logging.debug("Added Model Data Mismatch to all samples ")
def write_obs_to_file(self,filenam="oldstyle"):
def write_obs_to_file(self):
"""
Write selected information contained in the Observation object to a file.
"""
import da.tools.io4 as io
outfile = os.path.join(self.DaCycle['dir.output'], 'sampleinfo_%s__%s.nc' % (self.DaCycle['time.sample.stamp'], filenam))
outfile = os.path.join(self.DaCycle['dir.output'], 'sampleinfo_%s.nc' % (self.DaCycle['time.sample.stamp']))
f = io.CT_CDF(outfile, method='create')
logging.debug('Creating new Sample output file for postprocessing (%s)' % outfile)
......
......@@ -87,7 +87,7 @@ def start_job(DaCycle, DaSystem, DaPlatForm, StateVector, Samples, ObsOperator):
DaSystem.validate() #LU tylko sprawdza needed rc items in the file
DaCycle.DaSystem = DaSystem #LU przypisuje dacyclowi liste parametrow
DaCycle.DaPlatForm = DaPlatForm #LU przypisuje cyklowi platforme (tez liste parametrow)
DaCycle.initialize() #LU nastepnie cykl zostaje inicjalizowany...bardzo logiczne
DaCycle.initialize() #LU setup file structure etc
StateVector.DaCycle = DaCycle # also embed object in StateVector so it can access cycle information for I/O etc #LU cykl zostaje przypisany state vectorowi
Samples.DaCycle = DaCycle # also embed object in Samples object so it can access cycle information for I/O etc #LU cykl zostaje przypisany probkom
ObsOperator.DaCycle = DaCycle # also embed object in ObsOperator object so it can access cycle information for I/O etc #LU cykl zostaje przypisany obsoperatorowi
......@@ -112,7 +112,7 @@ def prepare_state(DaCycle, StateVector):
# Fill each week from n=1 to n=nlag with a new ensemble
nlag = StateVector.nlag #LU dla kazdego od zera do dlugosc(cykl) wyznaczamy date oraz znajdujemy kowariancje i robimy nowa ensemble.
for n in range(0, nlag):
for n in range(nlag):
date = DaCycle['time.start'] + datetime.timedelta(days=(n + 0.5) * int(DaCycle['time.cycle'])) #LU ta data jest tutaj potrzebna tylko do znalezienia odpowiedniego pliku z kowariancja.
cov = StateVector.get_covariance(date)
StateVector.make_new_ensemble(n + 1, cov)
......@@ -131,7 +131,6 @@ def prepare_state(DaCycle, StateVector):
# Finally, also write the StateVector to a file so that we can always access the a-priori information
filename = os.path.join(DaCycle['dir.output'], 'savestate.nc')
StateVector.write_to_file(filename) # write prior info because StateVector.Isoptimized == False for now
def sample_state(DaCycle, Samples, StateVector, ObservationOperator):
......@@ -293,8 +292,8 @@ def advance(DaCycle, Samples, StateVector, ObservationOperator):
DaCycle.OutputFileList.append(DaCycle['ObsOperator.inputfile'])
logging.debug("Appended Observation filename to DaCycle for collection ")
#LU tego nie ma w oryginalnym kodzie
Samples.write_obs_to_file("newstyle")
Samples.write_obs_to_file()
def save_and_submit(DaCycle, StateVector):
......
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