def get_record(self, site_id, start_time, end_time): ''' Reads station.info file, finds site, creates record ''' p1 = subprocess.Popen(["grep", "^ "+site_id, self.sta_db], stdout=subprocess.PIPE) output,err = p1.communicate() #Error Checking if len(output) == 0: Logger.error("Couldn't find %s in %s" % (site_id, self.sta_db), 4) if err != None: Logger.error(err, 3) for l in output.splitlines(): rec = StationRecord(l) #return the record that covers the current start time if start_time >= rec.sess_start and end_time <= rec.sess_end: return rec Logger.warning("Could not find an entry for site %s between %s - %s in station db %s ." % (site_id, start_time, end_time, self.sta_db))
def add_observables_string(self, obs_string): if self.__obs_match__(obs_string): self.obs_string = obs_string else: Logger.warning("`%s' not supported by teqc, check `teqc -help'. Using default `%s' " % (obs_string, self.obs_string))
def add_sv_string(self, sv_string): if self.__sv_match__(sv_string): self.sv_string = sv_string else: Logger.warning("`%s' not supported by teqc, check `teqc -help'. Using default `%s' " % (sv_string, self.sv_string))