def es(self,parent): gui_busy.busyStart( self, parent ) vars = gui_wk.get_vars(parent) doc = thermo.Es.__doc__ if len(vars)!=1: gui_message.error('This computation requires one variable only\n%s' % doc) gui_busy.busyEnd( self, parent ) return try: es =thermo.Es(vars[0]) gui_user_menus.user_menus_put( "saturated_pressure_from_%s" % vars[0].id,es) except Exception,err : gui_message.error('Error computing Es:\n%s\n%s' % (err,doc)) gui_busy.busyEnd( self, parent ) return
def ws(self,parent): gui_busy.busyStart( self, parent ) vars = gui_wk.get_vars(parent) doc = thermo.Ws.__doc__ if len(vars)!=2: gui_message.error('This computation requires 2 variables\n%s' % doc) gui_busy.busyEnd( self, parent ) return try: es =thermo.Ws(vars[0],vars[1]) gui_user_menus.user_menus_put( "saturated_mixing_ratio_from_%s_and_%s" % (vars[0].id,vars[1].id),es) except Exception,err: gui_message.error('Error computing Ws:\n%s\n%s' % (err,doc)) gui_busy.busyEnd( self, parent ) return
def dewpoint(self,parent): gui_busy.busyStart( self, parent ) vars = gui_wk.get_vars(parent) doc = thermo.Dewpoint.__doc__ if len(vars)!=2: gui_message.error('This computation requires 2 variables\n%s' % doc) gui_busy.busyEnd( self, parent ) return try: es = thermo.Dewpoint(vars[0],vars[1]) gui_user_menus.user_menus_put( "dewpoint_from_%s_%s" % (vars[0].id,vars[1].id),es) except Exception,err: gui_message.error('Error computing Dewpoint:\n%s\n%s' % (err,doc)) gui_busy.busyEnd( self, parent ) return
def lapse(self,parent): gui_busy.busyStart( self, parent ) vars = gui_wk.get_vars(parent) doc = thermo.gammaw.__doc__ if len(vars)!=3: gui_message.error('This computation requires 3 variables\n%s' % doc) gui_busy.busyEnd( self, parent ) return try: es = thermo.gammaw(vars[0],vars[1],vars[2]) gui_user_menus.user_menus_put( "moist_adiabatic_lapse_rate_from_%s_%s_%s" % (vars[0].id,vars[1].id,vars[2].id),es) except Exception,err: gui_message.error('Error computing lapse rate:\n%s\n%s' % (err,doc)) gui_busy.busyEnd( self, parent ) return
def lift(self,parent): gui_busy.busyStart( self, parent ) vars = gui_wk.get_vars(parent) doc = thermo.gammaw.__doc__ if len(vars)!=3: gui_message.error('This computation requires 3 variables\n%s' % doc) gui_busy.busyEnd( self, parent ) return try: T,P = thermo.LiftWet(vars[0],vars[1],vars[2]) gui_user_menus.user_menus_put( "%s_lifted_moist_adiabatically_from_%s_to_%s" % (vars[0].id,vars[1].id,vars[2].id),T) gui_user_menus.user_menus_put( "%s_lifted_moist_adiabatically_from_%s_to_%s_pressures" % (vars[0].id,vars[1].id,vars[2].id),P) except Exception,err: gui_message.error('Error computing lapse rate:\n%s\n%s' % (err,doc)) gui_busy.busyEnd( self, parent ) return
def dewpoint(self, parent): gui_busy.busyStart(self, parent) vars = gui_wk.get_vars(parent) doc = thermo.Dewpoint.__doc__ if len(vars) != 2: gui_message.error('This computation requires 2 variables\n%s' % doc) gui_busy.busyEnd(self, parent) return try: es = thermo.Dewpoint(vars[0], vars[1]) gui_user_menus.user_menus_put( "dewpoint_from_%s_%s" % (vars[0].id, vars[1].id), es) except Exception, err: gui_message.error('Error computing Dewpoint:\n%s\n%s' % (err, doc)) gui_busy.busyEnd(self, parent) return
def es(self, parent): gui_busy.busyStart(self, parent) vars = gui_wk.get_vars(parent) doc = thermo.Es.__doc__ if len(vars) != 1: gui_message.error('This computation requires one variable only\n%s' % doc) gui_busy.busyEnd(self, parent) return try: es = thermo.Es(vars[0]) gui_user_menus.user_menus_put( "saturated_pressure_from_%s" % vars[0].id, es) except Exception, err: gui_message.error('Error computing Es:\n%s\n%s' % (err, doc)) gui_busy.busyEnd(self, parent) return
def lapse(self, parent): gui_busy.busyStart(self, parent) vars = gui_wk.get_vars(parent) doc = thermo.gammaw.__doc__ if len(vars) != 3: gui_message.error('This computation requires 3 variables\n%s' % doc) gui_busy.busyEnd(self, parent) return try: es = thermo.gammaw(vars[0], vars[1], vars[2]) gui_user_menus.user_menus_put( "moist_adiabatic_lapse_rate_from_%s_%s_%s" % (vars[0].id, vars[1].id, vars[2].id), es) except Exception, err: gui_message.error('Error computing lapse rate:\n%s\n%s' % (err, doc)) gui_busy.busyEnd(self, parent) return
def ws(self, parent): gui_busy.busyStart(self, parent) vars = gui_wk.get_vars(parent) doc = thermo.Ws.__doc__ if len(vars) != 2: gui_message.error('This computation requires 2 variables\n%s' % doc) gui_busy.busyEnd(self, parent) return try: es = thermo.Ws(vars[0], vars[1]) gui_user_menus.user_menus_put( "saturated_mixing_ratio_from_%s_and_%s" % (vars[0].id, vars[1].id), es) except Exception, err: gui_message.error('Error computing Ws:\n%s\n%s' % (err, doc)) gui_busy.busyEnd(self, parent) return
def lift(self, parent): gui_busy.busyStart(self, parent) vars = gui_wk.get_vars(parent) doc = thermo.gammaw.__doc__ if len(vars) != 3: gui_message.error('This computation requires 3 variables\n%s' % doc) gui_busy.busyEnd(self, parent) return try: T, P = thermo.LiftWet(vars[0], vars[1], vars[2]) gui_user_menus.user_menus_put( "%s_lifted_moist_adiabatically_from_%s_to_%s" % (vars[0].id, vars[1].id, vars[2].id), T) gui_user_menus.user_menus_put( "%s_lifted_moist_adiabatically_from_%s_to_%s_pressures" % (vars[0].id, vars[1].id, vars[2].id), P) except Exception, err: gui_message.error('Error computing lapse rate:\n%s\n%s' % (err, doc)) gui_busy.busyEnd(self, parent) return