pyGrav_main.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:pyGrav 作者: basileh 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号