oasislmf.pytools.data_layer.footprint_layer =========================================== .. py:module:: oasislmf.pytools.data_layer.footprint_layer Attributes ---------- .. autoapisummary:: oasislmf.pytools.data_layer.footprint_layer.POINTER_PATH oasislmf.pytools.data_layer.footprint_layer.TCP_IP oasislmf.pytools.data_layer.footprint_layer.TCP_PORT oasislmf.pytools.data_layer.footprint_layer.PROCESSES_SUPPORTED oasislmf.pytools.data_layer.footprint_layer.MODEL_LOG_PATH Classes ------- .. autoapisummary:: oasislmf.pytools.data_layer.footprint_layer.OperationEnum oasislmf.pytools.data_layer.footprint_layer.FootprintLayer oasislmf.pytools.data_layer.footprint_layer.FootprintLayerClient Functions --------- .. autoapisummary:: oasislmf.pytools.data_layer.footprint_layer.main Module Contents --------------- .. py:data:: POINTER_PATH .. py:data:: TCP_IP :value: '127.0.0.1' .. py:data:: TCP_PORT :value: 8080 .. py:data:: PROCESSES_SUPPORTED :value: 100 .. py:data:: MODEL_LOG_PATH .. py:class:: OperationEnum Bases: :py:obj:`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. .. py:attribute:: GET_DATA .. py:attribute:: GET_NUM_INTENSITY_BINS .. py:attribute:: REGISTER .. py:attribute:: UNREGISTER .. py:attribute:: POLL_DATA .. py:class:: 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') 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 .. py:attribute:: storage .. py:attribute:: ignore_file_type :type: Set[str] .. py:attribute:: file_data :type: Optional[oasislmf.pytools.getmodel.footprint.Footprint] :value: None .. py:attribute:: socket :type: Optional[socket.socket] :value: None .. py:attribute:: count :type: int :value: 0 .. py:attribute:: total_expected :type: int .. py:attribute:: total_served :type: int :value: 0 .. py:attribute:: df_engine .. py:method:: listen() -> None Fires off the process with an event loop serving footprint data. Returns: None .. py:class:: FootprintLayerClient This class is responsible for connecting to the footprint server via TCP. .. py:method:: poll() -> bool :classmethod: Checks to see if data server is running. Returns: (bool) .. py:method:: register() -> None :classmethod: Registers the client with the server. Returns: None .. py:method:: unregister() -> None :classmethod: Unregisters the client with the data server. Returns: None .. py:method:: get_number_of_intensity_bins() -> int :classmethod: Gets the number of intensity bins from the footprint data. Returns: (int) the number of intensity bins .. py:method:: get_event(event_id: int) -> numpy.array :classmethod: 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 .. py:function:: main() -> None