uwsift.view package
Submodules
uwsift.view.algebraic_config module
uwsift.view.cameras module
LayerRep.py
PURPOSE Layer representation - the “physical” realization of content to draw on the map. A layer representation can have multiple levels of detail
A factory will convert URIs into LayerReps LayerReps are managed by document, and handed off to the MapWidget as part of a LayerDrawingPlan
REFERENCES
REQUIRES
- author:
R.K.Garcia <rayg@ssec.wisc.edu>
- copyright:
2014 by University of Wisconsin Regents, see AUTHORS for more details
- license:
GPLv3, see LICENSE for more details
- class uwsift.view.cameras.PanZoomProbeCamera(*args, **kwargs)[source]
Bases:
PanZoomCamera
Camera that maps mouse presses to events for probing.
- property rect
The rectangular border of the ViewBox visible area, expressed in the coordinate system of the scene.
Note that the rectangle can have negative width or height, in which case the corresponding dimension is flipped (this flipping is independent from the camera’s
flip
property).
uwsift.view.colormap module
Colormap objects and utilities.
- class uwsift.view.colormap.AWIPSColormap(awips_file, flipped=False, interpolation='linear')[source]
Bases:
Colormap
- class uwsift.view.colormap.BlockedColormap(colors, controls, **kwargs)[source]
Bases:
Colormap
Remove gradients from colormap.
- class uwsift.view.colormap.ColormapManager(categories=None)[source]
Bases:
OrderedDict
- colormap_classes = {'.cmap': <class 'uwsift.view.colormap.AWIPSColormap'>, '.json': <class 'uwsift.view.colormap.PyQtGraphColormap'>}
- writeable_extensions = ['.json']
- class uwsift.view.colormap.FlippedColormap(colors, controls=None, **kwargs)[source]
Bases:
Colormap
Simple wrapper to flip the provided colors and colormaps.
- class uwsift.view.colormap.PyQtGraphColormap(json_file_or_pqg_cmap, **kwargs)[source]
Bases:
Colormap
- class uwsift.view.colormap.SquareRootColormap(colors=None)[source]
Bases:
BaseColormap
- colors = [(0.0, 0.0, 0.0, 1.0), (1.0, 1.0, 1.0, 1.0)]
- glsl_map = '\n vec4 sqrt_cmap(float t) {\n return mix($color_0, $color_1, sqrt(t));\n }\n '
- map(t)[source]
Return a rgba array for the requested items.
This function must be overriden by child classes.
This function doesn’t need to implement argument checking on item. It can always assume that item is a (N, 1) array of values between 0 and 1.
- Parameters:
item (ndarray) – An array of values in [0,1].
- Returns:
rgba – An array with rgba values, with one color per item. The shape should be
item.shape + (4,)
.- Return type:
ndarray
Notes
Users are expected to use a colormap with
__getitem__()
rather thanmap()
(which implements a lower-level API).
uwsift.view.colormap_editor module
uwsift.view.dataset_statistics_pane module
- class uwsift.view.dataset_statistics_pane.DatasetStatisticsPane(*args, **kwargs)[source]
Bases:
QWidget
The purpose of this class is to manage the statistic analysis pane.
In the statistical analysis pane, the corresponding statistics of the first active dataset of a selected layer are displayed.
uwsift.view.export_image module
- class uwsift.view.export_image.ExportImageDialog(parent)[source]
Bases:
QDialog
- default_filename = 'sift_screenshot.png'
- class uwsift.view.export_image.ExportImageHelper(parent, sgm, model: LayerModel)[source]
Bases:
QObject
Handle all the logic for creating screenshot images
- default_font = '/home/docs/checkouts/readthedocs.org/user_builds/sift/checkouts/latest/uwsift/data/fonts/Andale Mono.ttf'
uwsift.view.layer_details module
PURPOSE Manage the layer sets.
REFERENCES
REQUIRES
- author:
Eva Schiffer <evas@ssec.wisc.edu>
- copyright:
2015 by University of Wisconsin Regents, see AUTHORS for more details
- license:
GPLv3, see LICENSE for more details
- class uwsift.view.layer_details.SingleLayerInfoPane(*args, **kwargs)[source]
Bases:
QWidget
Shows details about one layer that is currently selected.
- selection_did_change(layers: Tuple[LayerItem])[source]
Update the displayed values only when one layer is selected.
Also reset the display to its initial state at the beginning.
- Parameters:
layers – Layers which are currently selected
uwsift.view.layer_tree_view module
uwsift.view.open_file_wizard module
- class uwsift.view.open_file_wizard.Conf(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
- SKIP = 1
- class uwsift.view.open_file_wizard.GroupingMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
- BY_GROUP_KEYS = 0
- KEEP_SEPARATE = 1
- MERGE_ALL = 2
uwsift.view.probes module
probes.py ~~~ This module holds the code which deals with the controller and view for the area probe graphs.
- author:
Eva Schiffer <evas@ssec.wisc.edu>
- copyright:
2015 by University of Wisconsin Regents, see AUTHORS for more details
- license:
GPLv3, see LICENSE for more details
Bases:
NavigationToolbar2QT
Custom matplotlib toolbar.
- class uwsift.view.probes.ProbeGraphDisplay(manager, qt_parent, workspace, layer_model: LayerModel, queue, name_str)[source]
Bases:
object
The ProbeGraphDisplay controls one tab of the Area Probe Graphs. The ProbeGraphDisplay handles generating a displaying a single graph.
- DEFAULT_NUM_BINS = 100
- MAX_SCATTER_PLOT_DATA = 10000000.0
- property checked
- plotDensityScatterplot(dataX, nameX, timeX, dataY, nameY, timeY, pointX, pointY)[source]
Make a density scatter plot for the given data :param timeX: :param timeY:
- plotHistogram(data, title, x_point, x_label, y_label, numBins=100)[source]
Make a histogram using the given data and label it with the given title
- rebuildPlot()[source]
Given what we currently know about the selection area and selected bands, rebuild our plot
Note: This should be called only when the selections change in some way.
- setRegion(polygon_points=None, select_full_data=False)[source]
Set the region for this graph as polygon selection or full data.
- class uwsift.view.probes.ProbeGraphManager(tab_widget, auto_update_checkbox, update_button, workspace, layer_model: LayerModel, queue)[source]
Bases:
QObject
The ProbeGraphManager manages the many tabs of the Area Probe Graphs.
- current_graph_set_region(polygon_points=None, select_full_data=False)[source]
Update the current region in the selected graph and rebuild its plot
- Returns:
Name of the current probe graph (‘A’, ‘B’, …)
Probably outdated comment (TODO): FUTURE, once the polygon is a layer, this signal will be unnecessary
- handleActiveProductDatasetsChanged()[source]
Used when the layer model signals that something about the layers has changed
- set_default_layer_selections(layer_uuids)[source]
Set the UUIDs for the current graph if it doesn’t have a polygon
uwsift.view.rgb_config module
UI objects for configuring RGB layers.
- class uwsift.view.rgb_config.RGBLayerConfigPane(ui, parent, model: LayerModel)[source]
Bases:
QObject
Configures RGB channel selection and ranges on behalf of document. Document in turn generates update signals which cause the SceneGraph to refresh.
- property gamma_boxes
- property line_edits
- property rgb
- property rgb_name_edit
- selection_did_change(layers: Tuple[LayerItem])[source]
Change UI elements to reflect the provided recipe.
- set_combos_to_layer_names()[source]
update combo boxes with the list of layer names and then select the right r,g,b,a layers if they’re not None :return:
- property sliders
uwsift.view.scene_graph module
Provide a SceneGraphManager to handle display of visuals.
As per http://api.vispy.org/en/latest/scene.html (abridged)
- Vispy scene graph (SG) prerequisites:
create SceneCanvas -> this object’s scene property is top level node in SG:
` vispy_canvas = scene.SceneCanvas sg_root_node = vispy_canvas.scene `
create node instances (from vispy.scene.visuals)
add node instances to scene by making them children of canvas scene, or of nodes already in the scene
REFERENCES http://api.vispy.org/en/latest/scene.html
- author:
R.K.Garcia <rayg@ssec.wisc.edu>
- copyright:
2014 by University of Wisconsin Regents, see AUTHORS for more details
- license:
GPLv3, see LICENSE for more details
- class uwsift.view.scene_graph.AnimationController[source]
Bases:
object
Basic bookkeeping object for each layer set (A, B, C, D) from the UI.
- property animating
- property animation_speed
speed in milliseconds
- connect_to_model(model: LayerModel)[source]
- class uwsift.view.scene_graph.MainMap(*args, **kwargs)[source]
Bases:
Node
Scene node for holding all of the information for the main map area.
- class uwsift.view.scene_graph.PendingPolygon(point_parent)[source]
Bases:
object
Temporary information holder for Probe Polygons.
- class uwsift.view.scene_graph.SIFTMainMapCanvas(title='VisPy canvas', size=(800, 600), position=None, show=False, autoswap=True, app=None, create_native=True, vsync=False, resizable=True, decorate=True, fullscreen=False, config=None, shared=None, keys=None, parent=None, dpi=None, always_on_top=False, px_scale=1, bgcolor='black')[source]
Bases:
SceneCanvas
High level map canvas node.
- class uwsift.view.scene_graph.SceneGraphManager(doc, workspace, queue, borders_shapefiles: list | None = None, states_shapefile=None, parent=None, texture_shape=(4, 16), center=None)[source]
Bases:
QObject
SceneGraphManager represents a document as a vispy scenegraph. When document changes, it updates to correspond. Handles animation by cycling visibility. Provides means of highlighting areas. Decides what sampling to bring data in from the workspace, in order to feed the display optimally.
- add_node_for_composite_dataset(layer: LayerItem, product_dataset: ProductDataset)[source]
- add_node_for_image_dataset(layer: LayerItem, product_dataset: ProductDataset)[source]
- add_node_for_lines_dataset(layer: LayerItem, product_dataset: ProductDataset) VisualNode [source]
- add_node_for_mc_image_dataset(layer: LayerItem, product_dataset: ProductDataset) None [source]
Create and add a new node for a multichannel images to the SceneGraphManager.
Depending on the system configuration either a node with or without tiling is created from the product_dataset and inserted as a child of the layer’s node in the scene graph.
- Parameters:
layer – LayerItem which owns the ProductDataset
product_dataset – ProductDataset to create the multichannel image for
- add_node_for_points_dataset(layer: LayerItem, product_dataset: ProductDataset) VisualNode [source]
- apply_presentation_to_image_node(image: Image, presentation: Presentation, visible: bool | None = None)[source]
Apply all relevant and set properties (not None) of the given presentation to the given image.
Visibility can be explicitly overridden, because this is (at least for now) the only property where a dataset may deviate from the layer presentation; it depends on whether the dataset is active in the layer’s timeline.
- Parameters:
image – the image node which should get the new presentation
presentation – to apply, usually the presentation of the owning layer
visible –
- change_node_for_composite_dataset(layer: LayerItem, product_dataset: ProductDataset)[source]
- colormaps = None
- datasets = None
- map_to_colors_autoscaled(colormap, values, m=2)[source]
Get a list of colors by mapping each entry in values by the given colormap.
The mapping range is adjusted automatically to m times the standard deviation from the mean. This ignores outliers in the calculation of the mapping range.
Caution: this is an expensive operation and must not be called in tight loops.
- Parameters:
colormap – the colormap to apply
values – the values to map to colors
m – factor to stretch the standard deviation around the mean to define the mapping range
- Returns:
list of mapped colors in the same order as the input values
- on_view_change(scheduler)[source]
Simple event handler for when we need to reassess image datasets.
- purge_dataset(uuid_removed: UUID)[source]
Dataset has been purged from document (no longer used anywhere) - flush it all out :param uuid_removed: UUID of the dataset that is to be removed :return:
- queue = None
- remove_layer_node(uuid_removed: UUID)[source]
Layer will be removed, but before it can be removed correctly the scene graph node has to be removed. :param uuid_removed: UUID of the layer that will be removed
- remove_polygon(name=None)[source]
Remove a polygon from the SGM or clear the pending polygon if it exists.
- texture_shape = None
- update_basic_dataset(uuid: UUID, kind: Kind)[source]
Push the data (content) of a basic dataset again to the associated scene graph node.
This method shall be called whenever the data of a basic dataset changes. :param uuid: identifier of the dataset :param kind: kind of the dataset / data content.
uwsift.view.test_visuals module
Tests for the MultiChannelImageVisual.
uwsift.view.texture_atlas module
.py
PURPOSE gloo.Program wrappers for different purposes such as tile drawing
REFERENCES
REQUIRES
- author:
R.K.Garcia <rayg@ssec.wisc.edu>
- copyright:
2015 by University of Wisconsin Regents, see AUTHORS for more details
- license:
GPLv3, see LICENSE for more details
- class uwsift.view.texture_atlas.MultiChannelGPUScaledTexture2D(data, **texture_kwargs)[source]
Bases:
object
Wrapper class around individual textures.
This helper class allows for easier handling of multiple textures that represent individual R, G, and B channels of an image.
- property clim
Get color limits used when rendering the image (cmin, cmax).
- property clim_normalized
- property internalformat
- property interpolation
- scale_and_set_data(data, offset=None, copy=False)[source]
Scale and set data for one or all sub-textures.
- Parameters:
data (list | ndarray) – Texture data in the form of a numpy array or as a list of numpy arrays. If a list is provided then it must be the same length as
num_channels
for this texture. If a numpy array is provided thenoffset
should also be provided with the first value representing which sub-texture to update. For example,offset=(1, 0, 0)
would update the entire the second (index 1) sub-texture with an offset of(0, 0)
. The list can also containNone
to not update the sub-texture at that index.offset (tuple | None) – Offset into the texture where to write the provided data. If
None
then data will be written with no offset (0). If provided as a 2-element tuple then that offset will be used for all sub-textures. If a 3-element tuple then the first offset index represents the sub-texture to update.
- property textures
- class uwsift.view.texture_atlas.MultiChannelTextureAtlas2D(data, **texture_kwargs)[source]
Bases:
MultiChannelGPUScaledTexture2D
Helper texture for working with RGB images in SIFT.
uwsift.view.tile_calculator module
Supports calculations used throughout the library and application.
- class uwsift.view.tile_calculator.TileCalculator(name, image_shape, ul_origin, pixel_rez, tile_shape=(512, 512), texture_shape=(2, 16), projection='+proj=merc +datum=WGS84 +ellps=WGS84 +over', wrap_lon=False)[source]
Bases:
object
Common calculations for geographic image tile groups in an array or file
Tiles are identified by (iy,ix) zero-based indicators.
- OVERSAMPLED = 'oversampled'
- UNDERSAMPLED = 'undersampled'
- WELLSAMPLED = 'wellsampled'
- calc_stride(visible, texture=None)[source]
given world geometry and sampling as a ViewBox or Resolution tuple calculate a conservative stride value for rendering a set of tiles :param visible: ViewBox or Resolution with world pixels per screen pixel :param texture: ViewBox or Resolution with texture resolution as world pixels per screen pixel
- calc_texture_coordinates(ttile_idx, factor_rez, offset_rez, tessellation_level=1)[source]
Get texture coordinates for one tile as a quad.
- Parameters:
ttile_idx – int, texture 1D index that maps to some internal texture tile location
- calc_tile_fraction(tiy, tix, stride)[source]
Calculate the fractional components of the specified tile
- Returns:
- Two Resolution objects stating the relative size
of the tile compared to a whole tile and the offset from the origin of a whole tile.
- Return type:
(factor, offset)
- calc_tile_slice(tiy, tix, stride)[source]
Calculate the slice needed to get data.
The returned slice assumes the original image data has already been reduced by the provided stride.
- calc_vertex_coordinates(tiy, tix, stridey, stridex, factor_rez, offset_rez, tessellation_level=1)[source]
- visible_tiles(visible_geom, stride=None, extra_tiles_box=None) IndexBox [source]
Get box of tile indexes for visible tiles that should be drawn.
Box indexes should be iterated with typical Python start:stop style (inclusive start index, exclusive stop index). Tiles are expected to be indexed (iy, ix) integer pairs. The
extra_tiles_box
value specifies how many extra tiles to include around each edge.
- uwsift.view.tile_calculator.calc_stride(v_dx, v_dy, t_dx, t_dy, overview_stride_y, overview_stride_x)[source]
- uwsift.view.tile_calculator.calc_texture_coordinates(tiy, tix, factor_rez_dy, factor_rez_dx, tessellation_level, texture_size_y, texture_size_x, tile_shape_y, tile_shape_x, quads)[source]
- uwsift.view.tile_calculator.calc_tile_fraction(tiy, tix, stride_y, stride_x, image_y, image_x, tile_y, tile_x)[source]
- uwsift.view.tile_calculator.calc_tile_slice(tiy, tix, stride_y, stride_x, image_shape, tile_shape)[source]
- uwsift.view.tile_calculator.calc_vertex_coordinates(tiy, tix, stridey, stridex, factor_rez_dy, factor_rez_dx, offset_rez_dy, offset_rez_dx, tessellation_level, p_dx, p_dy, tile_shape_y, tile_shape_x, image_center_y, image_center_x, quads)[source]
- uwsift.view.tile_calculator.calc_view_extents(image_extents_box: Box, canvas_point, image_point, canvas_size, dx, dy) Box [source]
- uwsift.view.tile_calculator.get_reference_points(img_cmesh, img_vbox)[source]
Get two image reference point indexes.
This function will return the two nearest reference points to the center of the viewed canvas. The first argument img_cmesh is all valid image mesh points that were successfully transformed to the view projection. The second argument img_vbox is these same mesh points, but in the original image projection units.
- Parameters:
img_cmesh – (N, 2) array of valid points across the image space
img_vbox – (N, 2) array of valid points across the image space
- Returns:
(reference array index 1, reference array index 2)
- Raises:
ValueError if not enough valid points to create two reference points
- uwsift.view.tile_calculator.isclose(a, b)[source]
Implementation of numpy.isclose() since it is currently not supported by numba.
uwsift.view.transform module
VisPy Transform objects to handle some of the more complex projections.
SIFT uses PROJ.4 to define geographic projections and these are rarely possible to implement in Matrix transforms that come with VisPy.
- class uwsift.view.transform.GLSL_Adapter(text: str)[source]
Bases:
TextExpression
TextExpression subclass for parsing Macro definitions from .glsl header files and exposing them to vispy.
This class makes macro definitions accessible to vispy’s shader code processing. Assumes .glsl code to be parsed is accessible as python string. For reading .glsl header code from a file see GLSL_FileAdapter subclass.
- Parameters:
text (str) – Actual .glsl code string.
- property expr_list: List[VariableDeclaration]
- class uwsift.view.transform.GLSL_FileAdapter(file_path: str)[source]
Bases:
GLSL_Adapter
GLSL_Adapter subclass adding the functionality to read .glsl header code from files.
- Parameters:
file_path (str) – Path to .glsl header file.
- class uwsift.view.transform.PROJ4Transform(proj4_str, inverse=False)[source]
Bases:
BaseTransform
- Isometric = False
- Linear = False
- NonScaling = False
- Orthogonal = False
- glsl_imap = None
- glsl_map = None
- imap(coords)[source]
Inverse map coordinates
- Parameters:
coords (array-like) – Coordinates to inverse map.
- property is_geographic
- class uwsift.view.transform.VariableDeclaration(name: str, text: str)[source]
Bases:
TextExpression
TextExpression subclass for exposing GLSL variables to vispy glsl interface.
uwsift.view.visuals module
visuals.py
PURPOSE Dataset representation - the “physical” realization of content to draw on the map. A dataset representation can have multiple levels of detail.
REFERENCES
REQUIRES
- author:
R.K.Garcia <rayg@ssec.wisc.edu>
- copyright:
2014 by University of Wisconsin Regents, see AUTHORS for more details
- license:
GPLv3, see LICENSE for more details
- class uwsift.view.visuals.GradientLineVisual(pos=None, color=(0.5, 0.5, 0.5, 1), width=1, arrow_size=None, connect='strip', method='gl', antialias=False)[source]
Bases:
LineVisual
Gradient line visual
- Parameters:
pos (array) – Array of shape (…, 2) or (…, 3) specifying vertex coordinates.
color (Color, tuple, or array) – The color to use when drawing the line. If an array is given, it must be of shape (…, 4) and provide one rgba color per vertex. Can also be a colormap name, or appropriate Function.
width – The width of the line in px. Line widths > 1px are only guaranteed to work when using ‘agg’ method.
connect (str or array) –
Determines which vertices are connected by lines.
”strip” causes the line to be drawn with each vertex connected to the next.
”segments” causes each pair of vertices to draw an independent line segment
numpy arrays specify the exact set of segment pairs to connect.
method (str) –
Mode to use for drawing.
”agg” uses anti-grain geometry to draw nicely antialiased lines with proper joins and endcaps.
”gl” uses OpenGL’s built-in line rendering. This is much faster, but produces much lower-quality results and is not guaranteed to obey the requested line width or join/endcap styles.
antialias (bool) – Enables or disables antialiasing. For method=’gl’, this specifies whether to use GL’s line smoothing, which may be unavailable or inconsistent on some platforms.
- class uwsift.view.visuals.LinesVisual(arrows: ndarray, colors: ndarray | None = None)[source]
Bases:
TipAlignedArrowVisual
- default_colors = {'green': (0.0, 1.0, 0.0, 1.0), 'red': (1.0, 0.0, 0.0, 1.0)}
- class uwsift.view.visuals.MultiChannelImageVisual(data_arrays, clim='auto', gamma=1.0, **kwargs)[source]
Bases:
ImageVisual
Visual subclass displaying an image from three separate arrays.
Note this Visual uses only GPU scaling, unlike the ImageVisual base class which allows for CPU or GPU scaling.
- Parameters:
data (list) – A 3-element list of numpy arrays with 2 dimensons where the arrays are sorted by (R, G, B) order. These will be put together to make an RGB image. The list can contain
None
meaning there is no value for this channel currently, but it may be filled in later. In this case the underlying GPU storage is still allocated, but pre-filled with NaNs. Note that each channel may have different shapes.cmap (str | Colormap) – Unused by this Visual, but is still provided to the ImageVisual base class.
clim (str | tuple | list | None) – Limits of each RGB data array. If provided as a string it must be “auto” and the limits will be computed on the fly. If a 2-element tuple then it will be considered the color limits for all channel arrays. If provided as a 3-element list of 2-element tuples then they represent the color limits of each channel array.
gamma (float | list) – Gamma to use during colormap lookup. Final value will be computed
val**gamma
for each RGB channel array. If provided as a float then it will be used for each channel. If provided as a 3-element tuple then each value is used for the separate channel arrays. Default is 1.0 for each channel.**kwargs (dict) – Keyword arguments to pass to
ImageVisual
. Note that this Visual does not allow fortexture_format
to be specified and is hardcoded tor32f
internal texture format.
- property clim
Get color limits used when rendering the image (cmin, cmax).
- property cmap
Get the colormap object applied to luminance (single band) data.
- property gamma
Get the gamma used when rendering the image.
- property size
Get size of the image (width, height).
- class uwsift.view.visuals.NEShapefileLinesVisual(filepath, double=False, **kwargs)[source]
Bases:
ShapefileLinesVisual
Visual class for handling shapefiles from Natural Earth.
http://www.naturalearthdata.com/
There should be no difference in the format of the file, but some assumptions can be made with data from Natural Earth about filenaming, data resolution, fields and other record information that is normally included in most Natural Earth files.
- class uwsift.view.visuals.PrecomputedIsocurveVisual(verts, connects, level_indexes, levels, **kwargs)[source]
Bases:
IsocurveVisual
IsocurveVisual that can use precomputed paths.
- property clim
- property zoom_level
- class uwsift.view.visuals.RGBCompositeImageVisual(data, origin_x, origin_y, cell_width, cell_height, **image_kwargs)[source]
Bases:
SIFTMultiChannelTiledGeolocatedMixin
,TiledGeolocatedImageVisual
,MultiChannelImageVisual
- class uwsift.view.visuals.SIFTMultiChannelTiledGeolocatedMixin(data, *area_params, tile_shape=(512, 512), texture_shape=(2, 16), wrap_lon=False, projection='+proj=merc +datum=WGS84 +ellps=WGS84 +over', **visual_kwargs)[source]
Bases:
SIFTTiledGeolocatedMixin
- class uwsift.view.visuals.SIFTTiledGeolocatedMixin(data, *area_params, tile_shape=(512, 512), texture_shape=(2, 16), wrap_lon=False, projection='+proj=merc +datum=WGS84 +ellps=WGS84 +over', **visual_kwargs)[source]
Bases:
object
- get_view_box()[source]
Calculate shown portion of image and image units per pixel
This method utilizes a precomputed “mesh” of relatively evenly spaced points over the entire image space. This mesh is transformed to the canvas space (-1 to 1 user-viewed space) to figure out which portions of the image are currently being viewed and which portions can actually be projected on the viewed projection.
While the result of the chosen method may not always be completely accurate, it should work for all possible viewing cases.
- class uwsift.view.visuals.ShapefileLinesVisual(filepath, double=False, **kwargs)[source]
Bases:
LineVisual
- class uwsift.view.visuals.TextureTileState(num_tiles)[source]
Bases:
object
Object to hold the state of the current tile texture.
Terms:
itile: Image Tile, Tile in the image being shown. Coordinates are (Y, X)
lod: Level of Detail, Level of detail for the image tiles (1 highest - 5 lower)
ttile: Texture Tile, Tile in the actual GPU texture storage (0 to num_tiles)
This class is meant to be used as a bookkeeper/consultant right before taking action on the Texture Atlas.
- class uwsift.view.visuals.TiledGeolocatedImageVisual(data, origin_x, origin_y, cell_width, cell_height, **image_kwargs)[source]
Bases:
SIFTTiledGeolocatedMixin
,ImageVisual
- class uwsift.view.visuals.TipAlignedArrowVisual(pos=None, color=(0.5, 0.5, 0.5, 1), width=1, connect='strip', method='gl', antialias=False, arrows=None, arrow_type='stealth', arrow_size=None, arrow_color=(0.5, 0.5, 0.5, 1))[source]
Bases:
ArrowVisual
Almost exactly the same as vispy’s ArrowVisual except for the arrow’s head not being centered at the end of the arrow’s line but the arrows tip pointing to the coordinate of the arrow’s line.
- Parameters:
pos (array) – Array of shape (…, 2) or (…, 3) specifying vertex coordinates.
color (Color, tuple, or array) – The color to use when drawing the line. If an array is given, it must be of shape (…, 4) and provide one rgba color per vertex. Can also be a colormap name, or appropriate Function.
width – The width of the line in px. Line widths > 1px are only guaranteed to work when using ‘agg’ method.
connect (str or array) –
Determines which vertices are connected by lines.
”strip” causes the line to be drawn with each vertex connected to the next.
”segments” causes each pair of vertices to draw an independent line segment
numpy arrays specify the exact set of segment pairs to connect.
method (str) –
Mode to use for drawing.
”agg” uses anti-grain geometry to draw nicely antialiased lines with proper joins and endcaps.
”gl” uses OpenGL’s built-in line rendering. This is much faster, but produces much lower-quality results and is not guaranteed to obey the requested line width or join/endcap styles.
antialias (bool) – Enables or disables antialiasing. For method=’gl’, this specifies whether to use GL’s line smoothing, which may be unavailable or inconsistent on some platforms.
arrows (array) – A (N, 4) or (N, 6) matrix where each row contains the (x, y) or the (x, y, z) coordinate of the first and second vertex of the arrow body. Remember that the second vertex is used as center point for the arrow head, and the first vertex is only used for determining the arrow head orientation.
arrow_type (string) –
Specify the arrow head type, the currently available arrow head types are:
stealth
curved
triangle_30
triangle_60
triangle_90
angle_30
angle_60
angle_90
inhibitor_round
arrow_size (float) – Specify the arrow size
arrow_color (Color, tuple, or array) – The arrow head color. If an array is given, it must be of shape (…, 4) and provide one rgba color per arrow head. Can also be a colormap name, or appropriate Function.
Module contents
View owns the GPU and the user interface. Delegates from the Model and elsewhere provide it information it needs to react rapidly.