polyfemos.front.main

Frontend of polyfemos

Utilizes Flask

Functions used for different site:

See Frontend for documentation.

copyright

2019, University of Oulu, Sodankyla Geophysical Observatory

license

GNU Lesser General Public License v3.0 or later (https://spdx.org/licenses/LGPL-3.0-or-later.html)

Public Functions

polyfemos.front.main.alertheat()[source]

Creates a state of health table with every station and parameter combination. Timespan selection available for time interval anaysis.

polyfemos.front.main.csv_response(rows)[source]
Parameters

rows (list) – list of lists to be written into csv

Return type

Response

Returns

csv file as a html response

polyfemos.front.main.datacoveragebrowser()[source]

Creates the datacoveragebrowser view and edits the link which directs to the actual datacoverage image which is created according to the given parameters

polyfemos.front.main.datacoverageimage()[source]

A simple site including separately created datacoverage image.

polyfemos.front.main.generate_csv(rows)[source]
Parameters

rows (list) – list of lists to be written into csv

Return type

generator

Returns

generator yielding rows of csv file

polyfemos.front.main.get_image_data(image)[source]

Converts the images into ascii

Parameters

image (PngImageFile or Figure, or Image) –

Return type

str

Returns

image as ascii

polyfemos.front.main.get_summary(startdate='', enddate='', headerdate='', combinations=[], remove_irrationals=False, advanced_outlier_removal=False, fext='csv')[source]

The function used to get the statistical summary of station/sohpar combinations. The execution is little bit slow because the combinations are dealt separately, which means that, as all of the sohpars are in the same file, the file is opened and closed multiple times during the creation of the summary

Parameters
  • startdate (str or date) –

  • enddate (str or date) –

  • headerdate (str or date) – The header information of this date is used in calculations

  • combinations (list[tuple[str, str]]) – list containing all unique station and sohpar combinations

  • remove_irrationals (bool, optional) – defaults to False, If True, irrational values (limits defined in stf header) are removed from the data.

  • advanced_outlier_removal (bool, optional) – defaults to False. If True, advanced outlier removal is used for specific station/sohpar combination. The combinations and outlier removal are provided by summary_outlierremfuncs(), if the YAML configuration is provided.

  • fext (str, optional) – defaults to “csv”, select “stf” or “csv”, defines the datafile format which is read

Return type

list, list

Returns

rows and header, list of lists and a list.

polyfemos.front.main.home()[source]

Navigation site consisting of link library for every site available in polyfemos web.

polyfemos.front.main.index_alias(filename)[source]

Index site of the polyfemos web. In addition provides the documentation files.

polyfemos.front.main.plotbrowser()[source]

Soh plotter site, Plot Browser.

polyfemos.front.main.render_base(func_)[source]
Parameters

func_ (func) – render_template()

Return type

func

Returns

decorated function

polyfemos.front.main.sohmap()[source]

A map of the network area with stations. Alerts are sorted by their priorities. The innermost circle consists of the alerts of the highest priority.

polyfemos.front.main.sohtable()[source]

A state of health table with every station and parameter combination, incorporating current alerts and alert history.

polyfemos.front.main.summary()[source]

Creates a parameter summary table