DbInventory

class mss_dataserver.geometry.db_inventory.DbInventory(project, name='db_inventory')[source]

Bases: mss_dataserver.geometry.inventory.Inventory

The database inventory.

Parameters
  • project (mss_dataserver.core.project.Project) – The project used to get the database connection and database session.

  • name (str) – The name of the inventory.

  • db_session (sqlalchemy.orm.Session) – The session used to communicate with the database.

Methods

__init__(project[, name])

Initialize the instance.

add_array(array)

Add a new array to the database inventory.

add_network(network)

Add a new network to the database inventory.

add_recorder(recorder)

Add a recorder to the inventory.

add_sensor(sensor)

Add a sensor to the inventory.

add_station(network_name, station_to_add)

Add a station to the inventory.

as_dict([style])

Convert the inventory to a dictionary.

clear()

Clear all elements in the inventory.

close()

Close the inventory database connection.

commit()

Commit the database changes.

compute_utm_coordinates()

Compute the UTM coordinates of all stations in the inventory.

from_db_inventory(db_inventory)

Not yet implemented.

from_dict(d)

Create an inventory from a dictionary.

from_inventory_instance(name, project, inventory)

Create a DbInventory instance from a mss_data_server.geometry.inventory.Inventory instance.

get_array(**kwargs)

Get an array from the inventory.

get_channel(**kwargs)

Get a chennel from the inventory.

get_channel_from_stream([start_time, end_time])

Get the channels to which a stream is assigned to.

get_component(**kwargs)

Get a component of a sensor from the inventory.

get_network(**kwargs)

Get a network from the inventory.

get_recorder(**kwargs)

Get a recorder from the inventory.

get_sensor(**kwargs)

Get a sensor from the inventory.

get_station(**kwargs)

Get a station from the inventory.

get_stream(**kwargs)

Get a stream of a recorder from the inventory.

get_utm_epsg()

Compute a the epsg code of the best fitting UTM coordinate system.

has_changed()

Check if any element in the inventory has been changed.

import_from_xml(filename)

Read the inventory from a XML file.

load()

Load the inventory from the database.

load_arrays()

Load the arrays from the database.

load_inventory(project)

Load an inventory from the database.

load_networks()

Load the networks from the database.

load_recorders()

Load the recorders from the database.

load_sensors()

Load the sensors from the database.

merge(merge_inventory)

Merge two inventories.

refresh_recorders()

Refresh the inventory recorders.

remove_network(name)

Remove a network from the database inventory.

remove_network_by_instance(network_to_remove)

Remove a network instance from the inventory.

remove_recorder_by_instance(recorder)

Remove a recorder from the inventory.

remove_sensor_by_instance(sensor_to_remove)

Remove a sensor from the inventory.

remove_station(nsl)

Remove a station from the inventory.

update_networks()

Refresh the inventory networks.

Inheritence diagram

Inheritance diagram of mss_dataserver.geometry.db_inventory.DbInventory