Last active
April 21, 2017 14:50
-
-
Save sanandak/87a752d3264d61cc2c6f90cf325cf5ed to your computer and use it in GitHub Desktop.
asdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import pyasdf as pa\n", | |
"import obspy" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 28, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"import urllib\n", | |
"import io" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Read in an SU dataset" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 34, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"<http.client.HTTPResponse object at 0x10d891668>\n" | |
] | |
} | |
], | |
"source": [ | |
"u = urllib.request.urlopen('https://raw.github.com/sanandak/d3-su-picker/master/testData/dip00.su')\n", | |
"#str = obspy.read('/Users/sak/Dropbox/Geopebble/JS/d3-su-picker/testData/dip00.su')\n", | |
"print(u)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"An Obspy Stream object is made up of Trace objects. Each has metadata in the `stats` field" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 35, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"rawsu = u.read()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 37, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"810000" | |
] | |
}, | |
"execution_count": 37, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"len(rawsu)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 38, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"str = obspy.read(io.BytesIO(rawsu))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 39, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
" network: \n", | |
" station: \n", | |
" location: \n", | |
" channel: \n", | |
" starttime: 1970-01-01T00:00:00.000000Z\n", | |
" endtime: 1970-01-01T00:00:05.992000Z\n", | |
" sampling_rate: 125.0\n", | |
" delta: 0.008\n", | |
" npts: 750\n", | |
" calib: 1.0\n", | |
" _format: SU\n", | |
" su: AttribDict({'trace_header': LazyTraceHeaderAttribDict({'unpacked_header': b'\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x002\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x002\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\xee\\x1f@\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00=L\\xcc\\xcd=L\\xcc\\xcd\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00', 'endian': '>', 'sample_interval_in_ms_for_this_trace': 8000, 'year_data_recorded': 0}), 'endian': '>'})\n" | |
] | |
} | |
], | |
"source": [ | |
"print(str.traces[0].stats)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The trace header is packed into `trace_header` and is accesed by header name (quite verbose and documented at\n", | |
"https://github.com/obspy/obspy/blob/master/obspy/io/segy/header.py#L53" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 40, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"50" | |
] | |
}, | |
"execution_count": 40, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"str[0].stats.su.trace_header.group_coordinate_x # str.traces[n] <==> str[n]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 41, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"shot0 = [t for t in str if t.stats.su.trace_header.source_coordinate_x == 0]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 42, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"for t in shot0:\n", | |
" t.stats['location'] = '{}'.format(t.stats.su.trace_header.group_coordinate_x)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Open an ASDF file...." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 43, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"ds = pa.ASDFDataSet('dip00.asdf')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Add all the traces as _waveforms_ to `ds`" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 44, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..50.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..100.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..150.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..200.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..250.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..300.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..350.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..400.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..450.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..500.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..550.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..600.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..650.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..700.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..750.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..800.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..850.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..900.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..950.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1000.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1050.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1100.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1150.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1200.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1250.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1300.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1350.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1400.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1450.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1500.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1550.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1600.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1650.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n" | |
] | |
}, | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1700.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1750.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1800.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1850.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1900.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..1950.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2000.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2050.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2100.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2150.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2200.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2250.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2300.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2350.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2400.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2450.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n", | |
"/Users/sak/anaconda/envs/asdf/lib/python3.6/site-packages/pyasdf/asdf_data_set.py:51: ASDFWarning: Data './..2500.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform' already exists in file. Will not be added!\n", | |
" closure_warn(self, *args, **kwargs)\n" | |
] | |
} | |
], | |
"source": [ | |
"for t in shot0:\n", | |
" ds.add_waveforms(t, tag=\"raw_waveform\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"['..100.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1000.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1050.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1100.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1150.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1200.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1250.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1300.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1350.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1400.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1450.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..150.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1500.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1550.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1600.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1650.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1700.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1750.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1800.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1850.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1900.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..1950.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..200.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2000.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2050.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2100.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2150.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2200.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2250.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2300.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2350.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2400.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2450.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..250.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..2500.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..300.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..350.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..400.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..450.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..50.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..500.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..550.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..600.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..650.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..700.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..750.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..800.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..850.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..900.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform',\n", | |
" '..950.__1970-01-01T00:00:00__1970-01-01T00:00:05__raw_waveform']" | |
] | |
}, | |
"execution_count": 12, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"ds.waveforms.list()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 45, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"ds.flush()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 46, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"0 Event(s) in Catalog:\n" | |
] | |
}, | |
"execution_count": 46, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"ds.events" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.6.1" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment