def readMCGraviOutputfiles(self,datafordriftadj,output_root_dir,pattern="mix*",output_file_pattern="*.gra"):
"""
Read output files *.lst files from the mix_ folders outputs from mcgravi
populate output_dic dictionnary from each survey.
At station numbers keys of this dictionary, one finds the following tuple:
(station, gravity, std)
"""
for survid,surv in datafordriftadj.survey_dic.iteritems():
if surv.keepitem==1:
survdir=output_root_dir+os.sep+surv.name
#identify every folders matching the given pattern
folders=glob.glob(survdir+os.sep+pattern)
#sort the folder list (mcgravi outputs folder names with prog execution date...)
folders.sort()
#get the last one
folder=folders.pop()
mcgravi_filename=glob.glob(folder+os.sep+output_file_pattern)
#fill in the survey object:
self.campaigndata.survey_dic[survid].read_from_mcgravi_output_file(mcgravi_filename[0])
print "For survey: %s"%(num2date(survid))
print "Station , g (mgal), SD (mgal)"
for tupid,tup in self.campaigndata.survey_dic[survid].output_dic.iteritems():
print "%d, %7.4f, %7.4f"%(tup)
评论列表
文章目录