The End

Miniseed Parsing

var client = new XMLHttpRequest();
var url = 'http://service.iris.washington.edu/fdsnws/dataselect/1/query?net=UW&sta=DOSE&loc=--&cha=BHZ&start=2018-03-13T20:17:00&end=2018-03-13T20:22:00';

var div = d3.select('div.miniseed');
div.append('p').text(url);

client.open("GET", url);
client.onreadystatechange = handler;
client.responseType = "arraybuffer";
client.setRequestHeader("Accept", "application/vnd.fdsn.mseed");
client.send();

function handler() {
  if (this.readyState === this.DONE) {
    if (this.status === 200) {
console.log("resolve miniseed: ");
      resolve(this.response); }
    else { reject(this); }
  }
}

var resolve = function(arraybuf) {
var records = miniseed.parseDataRecords(arraybuf);