polyfemos.front.userdef¶
Provides config values from YAML files
See more info in Configuration
- 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.userdef.
check_network_code
(func_)[source]¶ Decorated functions check for currently selected network code. The name of the decorated function is used to extract the configuration value from the networks configuration yaml file. If the value is present in the configuration file it is passed to the
func_
asconfig_value
keyword argument.- Parameters
func_ (func) –
- Return type
func
- Returns
a decorated function
-
polyfemos.front.userdef.
datacoveragebrowser_func
(config_value='')[source]¶ - Parameters
config_value (str) –
datacoveragebrowser_func
value from yaml files- Return type
func
- Returns
see
get_datacoveragebrowser_func()
for more info.
-
polyfemos.front.userdef.
get_datacoveragebrowser_func
(function='', **kwargs)[source]¶ Available functions:
- seismic_scanner,
- Parameters
function (str) –
- Return type
func
- Returns
data coverage scanner function. If an invalid
function
is given, returnsFalse
.
-
polyfemos.front.userdef.
get_network_code
()[source]¶ Fetches the code of the currently selected network from cookies. If none is selected returns the default network code, which is the first entry in the
network_codes
list inglobal_config.yml
file.- Return type
- Returns
network code
-
polyfemos.front.userdef.
get_outlierremfunc
(function='', **kwargs)[source]¶ Available functions:
lipschitz,
lipschitz()
stalta,
stalta()
dtr,
dtr()
- Parameters
function (str) –
- Return type
func
- Returns
outlier removal function with additional
kwargs
applied to it. If an invalidfunction
is given, returnsFalse
-
polyfemos.front.userdef.
network_codes
()[source]¶ - Return type
- Returns
network_codes
list from global config yaml file
-
polyfemos.front.userdef.
secret_key
()[source]¶ A
secret_key
entry is read from the global configuration yaml file. If no secret key is given in the configuration file or the default entry is unchanged, a different random secret key is used when polyfemos web is reloaded.See
generate_secret_key()
for more info.- Return type
- Returns
secret key
-
polyfemos.front.userdef.
summary_outlierremfuncs
(station_id='', sohpar_name='', config_value={})[source]¶ - Parameters
- Return type
func
- Returns
outlier removal function corresponding
station_id
andsohpar_name
pair. User may define different outlier removal functions with differentstation_id
andsohpar_name
combinations. The key in the dict should bestation_id:sohpar_name
, e.g.FN.RANF:Vault_temperature
.
-
polyfemos.front.userdef.
ticklabels
(key, config_value={})[source]¶ If some state of health parameters require specific Y axis labeling, the custom tick labels are defined here.
keys of the ‘tl’ dictionary are names of the soh parameters. Values are JavaScript code blocks which define the tick labels. Word ‘tick’ in JS code will be interpreted as tick variable.