obspy.io.gse2.bulletin.Unpickler

class Unpickler(inventory, default_network_code, default_location_code, default_channel_code, res_id_prefix, fields, event_point_separator, agency)[source]

Bases: object

De-serialize a GSE2.0 string into an ObsPy Catalog object.

Public Methods

load

Read GSE2.0 file into ObsPy catalog object.

Private Methods

Warning

Private methods are mainly for internal/developer use and their API might change without notice.

Unpickler._add_line_nb(message)[source]

Add line number at the end of a str message.

Parameters:

message (str) – Message for warnings or exceptions.

Return type:

str

Returns:

Message with line number.

Unpickler._check_header(first_line)[source]

Just check some stuff in header.

Parameters:

first_line (str) – First line of header.

Unpickler._comment(text)[source]
Unpickler._deserialize()[source]
Unpickler._find_magnitude_by_type(event, origin_res_id, magnitude_type)[source]
Unpickler._get_channel(station, time)[source]

Use inventory to retrieve channel and location code.

Parameters:
  • station (str) – Station code

  • time (UTCDateTime) – Only use channel active at given point in time.

Return type:

str, Channel

Returns:

Network code, channel retrieved.

Unpickler._get_creation_info()[source]
Unpickler._get_res_id(ident, parent=None, parent_res_id=None)[source]

Create a ResourceIdentifier object.

Parameters:
Return type:

ResourceIdentifier

Returns:

 ResourceIdentifier object.

Unpickler._parse_arrivals(event, origin, origin_res_id)[source]
Unpickler._parse_event(first_line)[source]

Parse an event.

Parameters:

first_line (str) – First line of an event block, which contains the event id.

Return type:

Event

Returns:

The parsed event or None.

Unpickler._parse_first_line_origin(line, event, magnitudes)[source]

Parse the first line of origin data.

Parameters:
  • line (str) – Line to parse.

  • event (Event) – Event of the origin.

  • magnitudes (list of Magnitude) – Store magnitudes in a list to keep their positions.

Return type:

Origin, ResourceIdentifier

Returns:

Parsed origin or None, resource identifier of the origin.

Unpickler._parse_origin(event)[source]

Parse an origin.

Parameters:

event (Event) – Event of the origin.

Return type:

Origin, ResourceIdentifier

Returns:

Parsed origin or None, resource identifier of the origin.

Unpickler._parse_region_name(line, event)[source]
Unpickler._parse_second_line_origin(line, event, origin, magnitudes)[source]
Unpickler._skip_empty_lines()[source]
Unpickler._warn(message)[source]

Display a warning message with the line number.

Parameters:

message (str) – Message to be displayed

Special Methods

Unpickler.__delattr__(name, /)

Implement delattr(self, name).

Unpickler.__dir__()

Default dir() implementation.

Unpickler.__eq__(value, /)

Return self==value.

Unpickler.__format__(format_spec, /)

Default object formatter.

Unpickler.__ge__(value, /)

Return self>=value.

Unpickler.__getattribute__(name, /)

Return getattr(self, name).

Unpickler.__gt__(value, /)

Return self>value.

Unpickler.__hash__()

Return hash(self).

Unpickler.__init__(inventory, default_network_code, default_location_code, default_channel_code, res_id_prefix, fields, event_point_separator, agency)[source]
Unpickler.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

Unpickler.__le__(value, /)

Return self<=value.

Unpickler.__lt__(value, /)

Return self<value.

Unpickler.__ne__(value, /)

Return self!=value.

Unpickler.__new__(**kwargs)
Unpickler.__reduce__()

Helper for pickle.

Unpickler.__reduce_ex__(protocol, /)

Helper for pickle.

Unpickler.__repr__()

Return repr(self).

Unpickler.__setattr__(name, value, /)

Implement setattr(self, name, value).

Unpickler.__sizeof__()

Size of object in memory, in bytes.

Unpickler.__str__()

Return str(self).

Unpickler.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).