Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebased: - Fixed to work with both Python 2 and Python 3 - Added Work Tape Normal reader - Added Work Tape High reader - Changed the maximum line length to 78 characters - Added URL list for unittest - Removed unnecessary backslash - Separated definition and added PSE tape structure - Checked PEP8 using flake8 and updated - Renamed class names and function names considering accessibility - Added docs module skeleton - Fixed bug of PSE new format processing - Fixed bug of time skipping - Fixed frame rate bug - Frame rate is always the same because slow rate sent a half ALSEP words. - Added test code for file with many time skipping - Fixed a bug of dictionary key check in WTN process - Removed unnecessary test codes - Added year overwrite option in _pse_read - Added date validation code - Fixed unexpected changes - Fixed unexpected changes - Added sync pattern barker code validation - Used collections.deque instead of list for speeding up
- Loading branch information
1 parent
3ffa320
commit 4db5c69
Showing
23 changed files
with
1,657 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.. currentmodule:: obspy.io.alsep | ||
.. automodule:: obspy.io.alsep | ||
|
||
.. comment to end block | ||
Modules | ||
------- | ||
.. autosummary:: | ||
:toctree: autogen | ||
:nosignatures: | ||
|
||
assign | ||
core | ||
define | ||
utils | ||
|
||
.. comment to end block |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
obspy.io.alsep - Apollo seismic data support for ObsPy | ||
====================================================== | ||
This module provides read support for the seismic data obtained by | ||
Apollo Lunar Surface Experiments Package (ALSEP). | ||
.. seealso:: | ||
The format detail is shown in the `UTIG Technical Report No. 118 | ||
<http://www-udc.ig.utexas.edu/external/yosio/PSE/catsrepts/TechRept118.pdf>`_. | ||
The ALSEP seismic data is downloadable from `DARTS website | ||
<http://darts.isas.jaxa.jp/planet/seismology/apollo/>`_. | ||
:author: | ||
Yukio Yamamoto (yukio@planeta.sci.isas.jaxa.jp) Nov. 15, 2018 | ||
:copyright: | ||
The ObsPy Development Team (devs@obspy.org) & Yukio Yamamoto | ||
:license: | ||
GNU Lesser General Public License, Version 3 | ||
(https://www.gnu.org/copyleft/lesser.html) | ||
Reading | ||
------- | ||
There are three types of ALSEP tape: PSE, WTN, and WTH. They are handled by | ||
using ObsPy's standard:func:`~obspy.core.stream.read` function. The format is | ||
detected automatically. | ||
>>> from obspy import read | ||
>>> st = read("http://darts.isas.jaxa.jp/pub/apollo/pse/p15s/pse.a15.1.2") | ||
>>> st #doctest: +ELLIPSIS | ||
<obspy.core.stream.Stream object at 0x...> | ||
>>> st_spz = st.select(id='XA.S15..SPZ') | ||
>>> print(st_spz) #doctest: +ELLIPSIS | ||
7 Trace(s) in Stream: | ||
XA.S15..SPZ | 1971-08-01T18:52:00.515000Z - ... | 53.0 Hz, 903296 samples | ||
... | ||
XA.S15..SPZ | 1971-08-02T13:35:53.520000Z - ... | 53.0 Hz, 1009920 samples | ||
""" | ||
from __future__ import (absolute_import, division, print_function, | ||
unicode_literals) | ||
from future.builtins import * # NOQA | ||
|
||
|
||
if __name__ == '__main__': | ||
import doctest | ||
doctest.testmod(exclude_empty=True) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Assign ALSEP words to each channel | ||
""" | ||
from __future__ import (absolute_import, division, print_function, | ||
unicode_literals) | ||
from future.builtins import * # NOQA | ||
|
||
from .util import interp | ||
from .define import FORMAT_ALSEP_PSE_OLD, FORMAT_ALSEP_WTN | ||
|
||
|
||
def assign_alsep_words(alsep_word, apollo_station, format_type, frame_count, | ||
prev_values): | ||
data = {} | ||
# spz (Apollo 11,12,14,15,16) or lsg(Apollo 17) | ||
if format_type == FORMAT_ALSEP_PSE_OLD and apollo_station != 17: | ||
spz = [None] * 32 | ||
for i in range(32): | ||
spz[i] = alsep_word[(i + 1) * 2] | ||
if prev_values is None: | ||
spz[0] = spz[1] | ||
else: | ||
spz[0] = interp(prev_values[0], prev_values[1], spz[1], spz[2]) | ||
if apollo_station == 15: | ||
spz[11] = interp(spz[9], spz[10], spz[12], spz[13]) | ||
if apollo_station != 14: | ||
spz[22] = interp(spz[20], spz[21], spz[23], spz[24]) | ||
spz[27] = interp(spz[25], spz[26], spz[28], spz[29]) | ||
data['spz'] = spz | ||
elif apollo_station == 17: | ||
lsg = [None] * 32 | ||
for i in range(32): | ||
lsg[i] = 511 - alsep_word[(i + 1) * 2] | ||
if prev_values is None: | ||
lsg[0] = lsg[1] | ||
else: | ||
lsg[0] = interp(prev_values[0], prev_values[1], lsg[1], lsg[2]) | ||
data['lsg'] = lsg | ||
data['lsg_tide'] = [511 - alsep_word[25]] | ||
data['lsg_free'] = [511 - alsep_word[27]] | ||
data['lsg_temp'] = [511 - alsep_word[29]] | ||
# lpx/lpy/lpz | ||
lpx = [None] * 4 | ||
lpy = [None] * 4 | ||
lpz = [None] * 4 | ||
for i in range(4): | ||
lpx[i] = alsep_word[16 * i + 9] | ||
lpy[i] = alsep_word[16 * i + 11] | ||
lpz[i] = alsep_word[16 * i + 13] | ||
data['lpx'] = lpx | ||
data['lpy'] = lpy | ||
data['lpz'] = lpz | ||
# TidalX/TidalY/TidalZ/Inst_temp | ||
if frame_count % 2 == 0: | ||
data['tdx'] = [alsep_word[35]] | ||
data['tdy'] = [alsep_word[37]] | ||
else: | ||
data['tdz'] = [alsep_word[35]] | ||
data['inst_temp'] = [alsep_word[37]] | ||
# LSM | ||
if format_type == FORMAT_ALSEP_WTN: | ||
if apollo_station in [12, 15, 16]: | ||
lsm = [None] * 6 | ||
lsm[0] = alsep_word[17] | ||
lsm[1] = alsep_word[19] | ||
lsm[2] = alsep_word[21] | ||
lsm[3] = alsep_word[49] | ||
lsm[4] = alsep_word[51] | ||
lsm[5] = alsep_word[53] | ||
data['lsm'] = lsm | ||
data['lsm_status'] = [alsep_word[5]] | ||
# House Keeping (HK) | ||
data['hk'] = [alsep_word[33]] | ||
# Command Verification (CV) | ||
if apollo_station == 14: | ||
data['cv'] = [(alsep_word[5] >> 1)] | ||
else: | ||
data['cv'] = [(alsep_word[46] >> 1)] | ||
|
||
return data |
Oops, something went wrong.