oasislmf.pytools.data_layer.footprint_layer

Module Contents

Classes

OperationEnum

Defines the different types of operations supported via bytes. To be passed through TCP port first to tell the

FootprintLayer

This class is responsible for accessing the footprint data via TCP ports.

FootprintLayerClient

This class is responsible for connecting to the footprint server via TCP.

Functions

main(→ None)

Attributes

oasislmf.pytools.data_layer.footprint_layer.POINTER_PATH[source]
oasislmf.pytools.data_layer.footprint_layer.TCP_IP = '127.0.0.1'[source]
oasislmf.pytools.data_layer.footprint_layer.TCP_PORT = 8080[source]
oasislmf.pytools.data_layer.footprint_layer.PROCESSES_SUPPORTED = 100[source]
oasislmf.pytools.data_layer.footprint_layer.MODEL_LOG_PATH[source]
class oasislmf.pytools.data_layer.footprint_layer.OperationEnum[source]

Bases: enum.Enum

Defines the different types of operations supported via bytes. To be passed through TCP port first to tell the server what type of operation is required.

GET_DATA[source]
GET_NUM_INTENSITY_BINS[source]
REGISTER[source]
UNREGISTER[source]
POLL_DATA[source]
class oasislmf.pytools.data_layer.footprint_layer.FootprintLayer(storage: oasis_data_manager.filestore.backends.base.BaseStorage, total_expected: int, ignore_file_type: Set[str] = set(), df_engine='oasis_data_manager.df_reader.reader.OasisPandasReader')[source]

This class is responsible for accessing the footprint data via TCP ports.

Attributes:

static_path (str): path to the static file to load the data ignore_file_type (Set[str]): collection of file types to ignore when loading file_data (Optional[Footprint]): footprint object to load socket (Optional[socket.socket]): the TCP socket in which data is sent count (int): the number of processes currently relying on the server total_expected (int): the total number of reliant processes expected total_served (int): the total number of processes that have ever registered through the server’s lifetime

listen() None[source]

Fires off the process with an event loop serving footprint data.

Returns: None

class oasislmf.pytools.data_layer.footprint_layer.FootprintLayerClient[source]

This class is responsible for connecting to the footprint server via TCP.

classmethod poll() bool[source]

Checks to see if data server is running.

Returns: (bool)

classmethod register() None[source]

Registers the client with the server.

Returns: None

classmethod unregister() None[source]

Unregisters the client with the data server.

Returns: None

classmethod get_number_of_intensity_bins() int[source]

Gets the number of intensity bins from the footprint data.

Returns: (int) the number of intensity bins

classmethod get_event(event_id: int) numpy.array[source]

Gets the footprint data from the footprint based off the event_id.

Args:

event_id: (int) the event ID of the data required

Returns: (np.array) footprint data based off the event_id

oasislmf.pytools.data_layer.footprint_layer.main() None[source]