shakemap.utils.utils¶
-
shakemap.utils.utils.
migrate_gmpe
(old_gmpe, config=None)[source]¶ Return the GMPE that should be used to replace SM3.5 GMPE
By default, this uses the migrate.conf file found in the ShakeMap repository. Users can optionally pass in their own config.
-
shakemap.utils.utils.
get_network_name
(netid)[source]¶ Return a string representing a name of a network given its ID.
Note: Uses an internet connection to ComCat.
-
shakemap.utils.utils.
get_object_from_config
(obj, section, cfg, *args)[source]¶ Helper function for things (ipe, gmice, ccf) that don’t have a fromConfig() constructor yet. Instantiates an instance of a class from config entry, ‘name’, that has a corresponding ‘name’_module dictionary of class name, module path.
- Parameters:
obj (str) – Name of the parameter in the config file that specifies the object to be instantiated.
section (str) – The section of the config in which ‘obj’ resides.
cfg (dict) – The configuration file in which ‘obj’ and the module definitions reside.
args – Additional arguments that will be passed to the constructor of the thing being instantiated.
- Returns:
- An instance of the object specified by the ‘obj’ parameter
in the config file..
- Return type: