poets.web package — poets 0.3.2 documentation

# poets.web package

## Submodules

## poets.web.app module

`poets.web.app.` `about`()

  Creates the about page.

`poets.web.app.` `curpath`()

  Gets the current path of the module.

  pth : str
    Path of the module.

`poets.web.app.` `download_ts`(**kwargs)

  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)

  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)

  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)

  Creates image for OpenLayers overlay.

  StringIO
    Image in StringIO.

`poets.web.app.` `request_legend`(**kwargs)

  Creates Legend for OpenLayers overlay.

  StringIO
    Legend in StringIO.

`poets.web.app.` `start`(poet, host='127.0.0.1', port=5000, debug=False)

  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.
  debug : bool, optional
    Starts app in debug mode if set True, defaults to False.

`poets.web.app.` `to_dygraph_format`(self)

  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)

  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