In [1]:
import pickle
import pandas as pd

In [2]:
schema = \
    {"Attributes": 
         {"year":    {"dtype": int, 
                      "format": "%4d", 
                      "null": -999,
                      "width": 4},
          "month":   {"dtype": int, 
                      "format": "%02d",
                      "null": -9,
                      "width": 2},
          "day":     {"dtype": int, 
                      "format": "%02d", 
                      "null": -9,
                      "width": 2},
          "hour":    {"dtype": int, 
                      "format": "%02d", 
                      "null": -9,
                      "width": 2},
          "minute":  {"dtype": int, 
                      "format": "%02d", 
                      "null": -9,
                      "width": 2},
          "second":  {"dtype": float, 
                      "format": "%5.2f", 
                      "null": -9.99,
                      "width": 5},
          "lat_deg": {"dtype": int, 
                      "format": "%3d", 
                      "null": -99,
                      "width": 3},
          "lat_min": {"dtype": float, 
                      "format": "%5.2f", 
                      "null": -9.99,
                      "width": 5},
          "lon_deg": {"dtype": int, 
                      "format": "%4d",
                      "null": -999,
                      "width": 4},
          "lon_min": {"dtype": float, 
                      "format": "%5.2f",
                      "null": -9.99,
                      "width": 5},
          "qual":    {"dtype": str,
                      "format": "%1s", 
                      "null": "-",
                      "width": 1},
          "mag":     {"dtype": float, 
                      "format": "%3.1f",
                      "null": 9.9,
                      "width": 3},
          "depth":   {"dtype": float,
                      "format": "%6.2f", 
                      "null": -99.99,
                      "width": 6},
          "nph":     {"dtype": int,
                      "format": "%3d",
                      "null": -99,
                      "width": 3},
          "rms":     {"dtype": float, 
                      "format": "%5.2f",
                      "null": -9.99,
                      "width": 5},
          "eventid": {"dtype": int, 
                      "format": "%8d",
                      "null": 99999999,
                      "width": 8}
         },
     "Relations": 
         {"catalog":['year', 'month', 'day', 'hour', 'minute', 'second', 'lat_deg', 'lat_min', 'lon_deg', 'lon_min', 'qual', 'mag', 'depth', 'nph', 'rms', 'eventid']},
     "comment": "#"
    }

In [3]:
with open("../seismicity_catalog/data/schemas/scsn1.0.pkl", "wb") as outf:
    pickle.dump(schema, outf)

In [ ]: