def translate(self, site_record): ''' runs the actual translation of the file from some native format into rinex (output to standard rinex file name) ''' #ensure we have meta info... if not self.meta_info: self.meta() #figure out what receiver we are translating format_code = const.TEQC_format_translation_map[self.meta_info[const.TEQC_f_format]] #make rinex filenames file_base = "%s%s%s.%s" % ( site_record.site_id.lower(), self.meta_info[const.TEQC_f_start].strftime("%j"), self.get_hour_logged(), self.meta_info[const.TEQC_f_start].strftime("%y")) rnx_file = file_base + "o" nav_file = file_base + "n" subprocess.call("teqc "+ format_code+" "+ self.obs_string+" "+ self.sv_string+" "+ "-week %d " % self.meta_info[const.GPSweek] + "+nav %s " % nav_file + "-O.mo %s " % site_record.site_id.upper() + "-O.mn %s " % site_record.site_id.upper() + "-O.rt '%s' " % site_record.rcx_type + "-O.rn %s " % site_record.rcx_sn + "-O.at '%s' " % site_record.ant_type + "-O.an %s " % site_record.ant_sn + "-O.pe %f %f %f " % (site_record.vert_ht, site_record.ant_east, site_record.ant_north) + "-O.o '%s' " % site_record.operator + "-O.ag '%s' " % site_record.agency + self.comment_string() + self.__raw_file__ +" > %s " % rnx_file, shell=True) subprocess.call("gzip -f "+ rnx_file, shell=True) subprocess.call("gzip -f "+ nav_file, shell=True) Logger.info("Info: created `%s.gz' and `%s.gz'" % (rnx_file, nav_file))
if opt in ("-h", "--help"): usage() sys.exit(2) elif opt in ("-s", "--site"): site_id = arg.upper() #EVENT elif opt in ("-f", "--file"): raw_file = str(arg) #quite elif opt in ("-q", "--quiet"): Logger.off() #unknown else: assert False, "unhandled option: `%s'" % opt Logger.info("-"*80) Logger.info("Info: Working on file `%s' for site `%s'" % (raw_file, site_id)) #+# create station.info interface sta_db = None try: sta_db = StationDB() except CleanShutdownRequest: print "Aborting." sys.exit() #+# create teqc object teqc = None try: