def set_verbose(log_level='info'): """ Set the logging system to dump to the console -- you can see much more what's going on with the model as it runs :param log_level='info': the level you want your log to show. options are, in order of importance: "debug", "info", "warning", "error", "critical". You will only get the logging messages at or above the level you set. Set to "debug" for everything. """ gnome.initialize_console_log(log_level)
# uncertain_time_delay in hours # vec_field = TriVectorField('COOPSu_CREOFS24.nc') # u_mover = UGridCurrentMover(vec_field) c_mover = GridCurrentMover(curr_file) # c_mover.uncertain_cross = 0 # default is .25 # model.movers += u_mover model.movers += c_mover model.save return model if __name__ == "__main__": # turn on the logger: gnome.initialize_console_log(level='debug') startTime = datetime.now() scripting.make_images_dir() model = make_model() print "doing full run" rend = model.outputters[0] # rend.graticule.set_DMS(True) for step in model: if step['step_num'] == 1: rend.set_viewport(((-122.9, 45.6), (-122.6, 46.0))) # rend.set_viewport(((-122.8, 48.4), (-122.6, 48.6))) # rend.set_viewport(((-123.25, 48.125), (-122.5, 48.75))) # if step['step_num'] == 18: # rend.set_viewport(((-123.1, 48.55), (-122.95, 48.65))) if step['step_num'] == 110: rend.set_viewport(((-122.8, 45.75), (-122.75, 45.85)))
from gnome import scripting from gnome.basic_types import datetime_value_2d from gnome.utilities.projections import GeoProjection from gnome.environment import Wind from gnome.model import Model from gnome.spill import point_line_release_spill from gnome.movers import RandomMover, WindMover from gnome.outputters import Renderer, NetCDFOutput, KMZOutput, ShapeOutput # let's get the console log working: gnome.initialize_console_log() # define base directory base_dir = os.path.dirname(__file__) def make_model(images_dir=os.path.join(base_dir, 'images')): # create the maps: start_time = datetime(2013, 3, 12, 10, 0) # 15 minutes in seconds # Default to now, rounded to the nearest hour model = Model(time_step=60 * 60, start_time=start_time,