Skip to content

Instantly share code, notes, and snippets.

View jkmacc-LANL's full-sized avatar

jkmacc-LANL

  • Los Alamos National Laboratory
  • X @jkmacc
View GitHub Profile
@jkmacc-LANL
jkmacc-LANL / jsonizer.py
Last active January 28, 2017 01:23
JSONVisitor
import json
from parsimonious import Grammar, NodeVisitor
class JSONVisitor(NodeVisitor):
"""
A simple JSON serializer for Parsimonious parse trees.
"""
def generic_visit(self, node, children):
@jkmacc-LANL
jkmacc-LANL / miniseed2wfdisc.py
Created November 3, 2016 14:50
miniseed to css wfdisc
import os
import glob
from obspy import read
from pisces.tables.css3 import Wfdisc
with open('wfdiscfile.wfdisc', 'w') as wfdiscfile:
for ifile in glob.glob('*.mseed'):
pathname, ext = os.path.splitext(ifile)
newname = pathname + '.w'