:py:mod:`gnome.outputters.image` ================================ .. py:module:: gnome.outputters.image .. autoapi-nested-parse:: image outputters These will output images for use in the Web client / OpenLayers NOTE: doesn't seem to be tested -- and may not be used anyway. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: gnome.outputters.image.IceImageOutput .. py:class:: IceImageOutput(ice_movers=None, image_size=(800, 600), projection=None, viewport=None, **kwargs) Bases: :py:obj:`gnome.outputters.Outputter` Class that outputs ice data as an image for each ice mover. The image is PNG encoded, then Base64 encoded to include in a JSON response. :param ice_movers: ice_movers associated with this outputter. :type ice_movers: An ice_mover object or sequence of ice_mover objects. Use super to pass optional kwargs to base class __init__ method .. py:attribute:: _schema .. py:method:: set_gradient_colors(gradient_name, color_range=((0, 0, 127), (0, 255, 255)), scale=(0.0, 10.0), num_colors=16) Add a color gradient to our palette representing the colors we will use for our ice thickness :param gradient_name: The name of the gradient. :type gradient_name: str :param color_range: The colors we will build our gradient with. :type color_range: A 2 element sequence of 3-tuples containing 8-bit RGB values. :param scale: A range of values representing the low and high end of our gradient. :type scale: A 2 element sequence of float :param num_colors: The number of colors to use for the gradient. :type num_colors: Number .. py:method:: add_gradient_to_canvas(color_range, color_prefix, num_colors) Add a color gradient to our palette NOTE: Probably not the most efficient way to do this. :param color_range: The colors that we would like to use to generate our gradient :type color_range: A sequence of 2 or more 3-tuples :param color_prefix: The prefix that will be used in the naming of the colors in the gradient :type color_prefix: str :param num_colors: The number of gradient colors to generate :type num_colors: Number .. py:method:: lookup_gradient_color(gradient_name, values) .. py:method:: write_output(step_num, islast_step=False) Generate image from data .. py:method:: get_sample_image() This returns a base 64 encoded PNG image for testing, just so we have something This should be removed when we have real functionality .. py:method:: render_images(model_time) render the actual images This uses the MapCanvas code to do the actual rendering returns: thickness_image, concentration_image .. py:method:: ice_movers_to_dict() a dict containing 'obj_type' and 'id' for each object in list/collection