本文整理汇总了Python中gnome.outputters.Renderer.zoom方法的典型用法代码示例。如果您正苦于以下问题:Python Renderer.zoom方法的具体用法?Python Renderer.zoom怎么用?Python Renderer.zoom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnome.outputters.Renderer
的用法示例。
在下文中一共展示了Renderer.zoom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_model
# 需要导入模块: from gnome.outputters import Renderer [as 别名]
# 或者: from gnome.outputters.Renderer import zoom [as 别名]
def make_model(images_dir=os.path.join(base_dir, 'images')):
print 'initializing the model'
start_time = datetime(2013, 5, 18, 0)
model = Model(start_time=start_time, duration=timedelta(days=8),
time_step=4 * 3600, uncertain=False)
mapfile = get_datafile(os.path.join(base_dir, 'mariana_island.bna'))
print 'adding the map'
model.map = MapFromBNA(mapfile, refloat_halflife=6) # hours
#
# Add the outputters -- render to images, and save out as netCDF
#
print 'adding renderer'
rend = Renderer(mapfile,
images_dir,
size=(800, 600),
draw_map_bounds=True
)
rend.draw_raster_map()
model.outputters += rend
# draw_back_to_fore=True)
# print "adding netcdf output"
# netcdf_output_file = os.path.join(base_dir,'mariana_output.nc')
# scripting.remove_netcdf(netcdf_output_file)
# model.outputters += NetCDFOutput(netcdf_output_file, which_data='all')
#
# Set up the movers:
#
rend.zoom(0.5)
rend.zoom(2)
print 'adding a RandomMover:'
model.movers += RandomMover(diffusion_coef=10000)
print 'adding a simple wind mover:'
model.movers += constant_wind_mover(7, 90, units='m/s')
print 'adding a current mover:'
# # # this is HYCOM currents
# curr_file = get_datafile(os.path.join(base_dir, 'HYCOM.nc'))
# model.movers += GridCurrentMover(curr_file,
# num_method=numerical_methods.euler);
# #
# # Add some spills (sources of elements)
# #
print 'adding four spill'
model.spills += point_line_release_spill(num_elements=NUM_ELEMENTS // 4,
start_position=(146, 15.25,
0.0),
release_time=start_time)
model.spills += point_line_release_spill(num_elements=NUM_ELEMENTS // 4,
start_position=(146, 15.125,
0.0),
release_time=start_time)
model.spills += point_line_release_spill(num_elements=NUM_ELEMENTS // 4,
start_position=(146, 15.0,
0.0),
release_time=start_time)
model.spills += point_line_release_spill(num_elements=NUM_ELEMENTS // 4,
start_position=(146, 14.875,
0.0),
release_time=start_time)
return model