Skip to content
Open
9 changes: 9 additions & 0 deletions openquake/hmtk/parsers/catalogue/csv_catalogue_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class CsvCatalogueWriter(BaseCatalogueWriter):

# Because the catalogues TOTAL_ATTRIBUTE_LIST is randomly ordered,
# the preferred output order is given as a list here

OUTPUT_LIST = [
"eventID",
"Agency",
Expand All @@ -182,6 +183,12 @@ class CsvCatalogueWriter(BaseCatalogueWriter):
"magnitude",
"sigmaMagnitude",
"magnitudeType",
'str1',
'dip1',
'rake1',
'str2',
'dip2',
'rake2'
]

def write_file(self, catalogue, flag_vector=None, magnitude_table=None):
Expand Down Expand Up @@ -256,6 +263,7 @@ def apply_purging(self, catalogue, flag_vector, magnitude_table):
class CsvGCMTCatalogueWriter(CsvCatalogueWriter):
"""
Writes GCMT catalogue to csv file

"""

OUTPUT_LIST = [
Expand Down Expand Up @@ -299,6 +307,7 @@ class CsvGCMTCatalogueWriter(CsvCatalogueWriter):
"plunge_t",
]


def write_file(self, catalogue, flag_vector=None, magnitude_table=None):
"""
Writes the catalogue to file, purging events if necessary.
Expand Down
1 change: 1 addition & 0 deletions openquake/hmtk/parsers/catalogue/gcmt_ndk_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ def to_hmtk(self, use_centroid=True):
iloc
] = gcmt.hypocentre.latitude
self.catalogue.data["depth"][iloc] = gcmt.hypocentre.depth

# Moment, magnitude and relative errors
self.catalogue.data["moment"][iloc] = gcmt.moment
self.catalogue.data["magnitude"][iloc] = gcmt.magnitude
Expand Down
13 changes: 13 additions & 0 deletions openquake/hmtk/seismicity/catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ class Catalogue(object):
"depthError",
"magnitude",
"sigmaMagnitude",
'str1',
'dip1',
'rake1',
'str2',
'dip2',
'rake2'
]

INT_ATTRIBUTE_LIST = ["year", "month", "day", "hour", "minute", "flag"]
Expand Down Expand Up @@ -110,6 +116,13 @@ class Catalogue(object):
"magnitude",
"sigmaMagnitude",
"magnitudeType",
'str1',
'dip1',
'rake1',
'str2',
'dip2',
'rake2'

]

def __init__(self):
Expand Down
Loading