def getSites(self): self._ids = AvnParser.getAllSiteIds() for ident in self._ids['taf']: info = AvnParser.getTafSiteCfg(ident) if info is None: continue lat = float(info['geography']['lat']) lon = float(info['geography']['lon']) d = {'id': ident, 'lat': lat, 'lon': lon} self._tafinfo.append(d)
def __init__(self, inqueue, outqueue, info): self.inqueue = inqueue self.outqueue = outqueue self.name = info['name'] self.nhours = int(info['nhours']) self.info = info.copy() del self.info['name'] del self.info['nhours'] del self.info['module'] self.siteinfo = AvnParser.getAllSiteIds()
def __getSites(self): ids = AvnParser.getAllSiteIds() self.sitelist = [] for ident in ids['taf']: info = AvnParser.getTafSiteCfg(ident) if info is None: continue d = {'id': ident, \ 'lat': float(info['geography']['lat']), \ 'lon': float(info['geography']['lon'])} self.sitelist.append(d) if not self.sitelist: _Logger.debug('Cannot get site list') raise SystemExit
def __getSites(self): ids = AvnParser.getAllSiteIds() dlat = math.degrees(self.distance/3959.0) self.sitelist = [] self.sitedata = {} for ident in ids['taf']: info = AvnParser.getTafSiteCfg(ident) if info is None: continue lat = float(info['geography']['lat']) lon = float(info['geography']['lon']) dlon = dlat/math.cos(math.radians(lat)) d = {'id': ident, 'lat': (lat-dlat, lat+dlat) , \ 'lon': (lon-dlon, lon+dlon)} self.sitelist.append(d) self.sitedata[ident] = [] # list of lightnings if not self.sitelist: raise SystemExit
def __getSites(self): ids = AvnParser.getAllSiteIds() dlat = math.degrees(self.distance / 3959.0) self.sitelist = [] self.sitedata = {} for ident in ids['taf']: info = AvnParser.getTafSiteCfg(ident) if info is None: continue lat = float(info['geography']['lat']) lon = float(info['geography']['lon']) dlon = dlat / math.cos(math.radians(lat)) d = {'id': ident, 'lat': (lat-dlat, lat+dlat) , \ 'lon': (lon-dlon, lon+dlon)} self.sitelist.append(d) self.sitedata[ident] = [] # list of lightnings if not self.sitelist: raise SystemExit
def __init__(self, parent, **kw): AvnDialog.Dialog.__init__(self, parent, **kw) self.title('Trigger Editor') self.wm_iconname(newName='TEditor') # from AvnDialog self.createMessageBar(self.interior(), True) self.__getAfosIds() self.__getTriggerFile() self.ids = AvnParser.getAllSiteIds() # add CCFP entries self.ids.update({'ccfp': ['01', '02', '03']}) numrows = max([len(self.ids.get(tag, [])) for tag in self.Items]) + 10 interior = self.interior() frame = Frame(interior, relief='ridge', bd=2) bbox = Pmw.ButtonBox(frame) btn = bbox.add('Update', command=self.__update) Balloon().bind(btn, 'Updates missing values using the afos2awips file') btn = bbox.add('Make', command=self.__make) Balloon().bind(btn, 'Creates trigger file and updates watchwarn table') btn = bbox.add('Close', command=self.close) Balloon().bind(btn, 'Closes this dialog') btn = bbox.add('Help', command=Avn.curry(self.showHelp, _Help)) Balloon().bind(btn, 'Shows help') bbox.alignbuttons() bbox.grid(row=0, column=0, columnspan=len(self.Items), sticky='news') self.item = dict.fromkeys(self.Items) validator = {'validator': 'alphanumeric', 'min': 8, 'max': 9, \ 'minstrict': 0} for n, tag in enumerate(self.Items): sf = Pmw.ScrolledFrame(frame, labelpos='n', label_text=tag.upper(), horizflex='elastic', ) self.item[tag] = [] for k in range(numrows): entry = Pmw.EntryField(sf.interior(), labelpos='w', label_text='', label_anchor='e', label_width=6, entry_width=9, validate=validator, ) entry.grid(row=k, column=0, sticky='news') self.item[tag].append(entry) w = entry.component('entry').winfo_reqwidth() + \ entry.component('label').winfo_reqwidth() + \ sf.component('vertscrollbar').winfo_reqwidth() sf.configure(clipper_width=w) sf.grid(row=1, column=n, sticky='news') frame.pack(side='top', expand='yes', fill='x') self.initialiseoptions(Editor) self.setGeometry()
# History: # Revision 2 (DELIVERED) # Created: 31-OCT-2008 09:29:34 OBERFIEL # Updated to work around awful GFESuite code # # Revision 1 (DELIVERED) # Created: 03-JUN-2008 12:51:20 OBERFIEL # New routine for generating command line arguments for # ifpText program. # # Change Document History: # 1: # Change Document: GFS1-NHD_SPR_7420 # Action Date: 29-DEC-2008 15:09:10 # Relationship Type: In Response to # Status: NEXTRELEASE # Title: AvnFPS: Use of ifpServerText to get Edit Areas negatively impacts ifpServer # # if __name__ == '__main__': """Get all TAFs configured in AvnFPS""" import os, AvnParser # # The temporary file contains all ifpServer edit areas. try: os.chdir(os.environ.get('TOP_DIR','/awips/adapt/avnfps')) for site in AvnParser.getAllSiteIds()['taf']: print site except: raise