poets.web package

Submodules

poets.web.app module

poets.web.app.about()[source]

Creates the about page.

poets.web.app.curpath()[source]

Gets the current path of the module.

pth : str
Path of the module.
poets.web.app.download_ts(**kwargs)[source]

Initiates download time series (anomaly) in comma separated values format.

jsonified str
Time series (anomaly) in Dygraphs compatible json format.
poets.web.app.get_ts(**kwargs)[source]

Gets time series for selected location, gets anomaly of time series if anom parameter is passed.

jsonified str
Time series (anomaly) in Dygraphs compatible json format.
poets.web.app.index(**kwargs)[source]

Renders main page of the web application. Generates image arguments needed for OpenLayers overlay if parameters reg and var are set, renders entry page if not set.

poets.web.app.request_image(**kwargs)[source]

Creates image for OpenLayers overlay.

StringIO
Image in StringIO.
poets.web.app.request_legend(**kwargs)[source]

Creates Legend for OpenLayers overlay.

StringIO
Legend in StringIO.
poets.web.app.request_variables(**kwargs)[source]
poets.web.app.start(poet, host='127.0.0.1', port=5000, r_host=None, r_port=None, debug=False)[source]

Starts application and sets global variables.

poet : Poet()
Instance of Poet class.
host : str, optional
Host that is used by the app, defaults to 127.0.0.1.
port : int, optional
Port where app runs on, defaults to 50000.
r_host : str, optional
IP of router that is between host and internet.
r_port : int, optional
Port of router that is between host and internet.
debug : bool, optional
Starts app in debug mode if set True, defaults to False.
poets.web.app.to_dygraph_format(self)[source]

Transforms pandas DataFrame to Dygraphs compatible format.

labels : list of str
Labels of the Dygraphs array.
values : list
Values of the Dygraphs array.

poets.web.overlays module

This modules provides functions used while creating image overlays.

poets.web.overlays.bounds(country, shapefile=None)[source]

Returns the bounding box, center coordinates and zoom level for web overlay purposes.

Country : str
FIPS country code (https://en.wikipedia.org/wiki/FIPS_country_code)
lon_min : int
Minimum longitude.
lon_max : int
Maximum longitude.
lat_min : int
Minimum latitude.
lat_max : int
Maximum latitude.
c_lat : int
Center latidute of image.
c_lon : int
Center longitude of image.
zoom : int
Zoom level for openlayers.

Module contents