Git Product home page Git Product logo

stdb's People

Contributors

paudetseis avatar schaefferaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stdb's Issues

channel ranks

Thanks for making this package. I am trying to use it for first time. I have heterogeneous data: HH*, BH*, and CH*. I am getting an error related to location code for the CH* channels. Metadata on IRIS looks good. Is CH* excluded from possible options somewhere in your code? I can't figure out why else I get the error.

Example:

query_fdsn_stdb -N XP -C HH*,CH*,HDF --start="2020-03-31 00:00:00" --end="2022-01-01 00:00:00" XP.stat.list > stdb.query.log

Below is part of output to show the error I am getting. You can check BANN for example at IRIS. Seems okay in terms of the metadata. Any thoughts? I really need these CH* channels.

Search Complete: 
  22 stations in 1 networks
 
Network: XP
   Station: ATL
     Lon, Lat, Elev: -115.1266,  43.8015,   1.641
     Start Date: 2020-12-07 18:37:08
     End Date:   2021-05-28 18:50:27
     Status:     open
       Selected Channel: HH
         Locations:  00
         Start Date: 2020-12-07 18:41:59
         End Date:   2021-05-28 18:50:27
    Added as: XP.ATL

   Station: BANN
     Lon, Lat, Elev: -115.2346,  44.3033,   2.135
     Start Date: 2020-04-01 20:50:32
     End Date:   2021-05-19 00:37:25
     Status:     open
     Error: Location * not available. Skipping
   Station: BBR
     Lon, Lat, Elev: -116.1822,  43.6893,   1.063
     Start Date: 2020-04-01 02:51:56
     End Date:   2020-04-01 15:09:23
     Status:     open
     Error: Location * not available. Skipping
   Station: CREE
     Lon, Lat, Elev: -115.2111,  44.3575,   2.041
     Start Date: 2020-04-05 18:54:18
     End Date:   2020-05-30 21:31:59
     Status:     open
     Error: No Z component. Skipping
   Station: DDR
     Lon, Lat, Elev: -114.8281,  44.5886,   1.686
     Start Date: 2020-04-09 21:12:50
     End Date:   2020-10-26 18:54:04
     Status:     open
       Selected Channel: HH
         Locations:  --
         Start Date: 2020-04-09 21:13:30
         End Date:   2020-10-26 18:54:04
    Added as: XP.DDR

   Station: EPIC
     Lon, Lat, Elev: -115.1750,  44.3944,   2.000
     Start Date: 2020-04-01 23:30:34
     End Date:   2020-10-18 20:57:45
     Status:     open
     Error: Location * not available. Skipping
   Station: FOX
     Lon, Lat, Elev: -115.2781,  44.1661,   1.471
     Start Date: 2020-04-01 21:56:39
     End Date:   2021-05-19 01:21:18
     Status:     open
     Error: Location * not available. Skipping
   Station: IRON
     Lon, Lat, Elev: -114.9811,  44.2205,   1.928
     Start Date: 2020-04-02 03:14:01
     End Date:   2020-10-18 19:06:30
     Status:     open
     Error: Location * not available. Skipping
   Station: JAKE
     Lon, Lat, Elev: -115.0260,  44.2830,   2.000
     Start Date: 2020-04-13 03:15:13
     End Date:   2020-05-30 20:55:13
     Status:     open
     Error: No Z component. Skipping
   Station: LPR
     Lon, Lat, Elev: -115.9625,  43.5923,   0.944
     Start Date: 2020-04-01 04:18:00
     End Date:   2020-04-04 00:18:00
     Status:     open
     Error: Location * not available. Skipping
   Station: MFRD
     Lon, Lat, Elev: -115.2940,  44.4236,   1.935
     Start Date: 2020-04-05 19:08:24
     End Date:   2020-10-15 19:44:03
     Status:     open
     Error: Location * not available. Skipping
   Station: PARK
     Lon, Lat, Elev: -115.0190,  44.2748,   1.987
     Start Date: 2020-04-13 17:13:06
     End Date:   2020-06-13 00:41:00
     Status:     open
     Error: No Z component. Skipping
   Station: PETL
     Lon, Lat, Elev: -114.8699,  43.9866,   2.173
     Start Date: 2020-04-12 00:13:20
     End Date:   2020-10-28 19:08:30
     Status:     open
       Selected Channel: HH
         Locations:  --
         Start Date: 2020-04-12 00:14:06
         End Date:   2020-10-28 19:08:30
    Added as: XP.PETL

   Station: RDFL
     Lon, Lat, Elev: -114.9044,  44.1656,   1.987
     Start Date: 2020-04-11 22:50:00
     End Date:   2020-10-28 20:09:23
     Status:     open
       Selected Channel: HH
         Locations:  --
         Start Date: 2020-04-11 22:50:08
         End Date:   2020-10-28 20:09:23
    Added as: XP.RDFL

Errors running server.bat

I'm trying to run server.bat but I'm getting numerous errors and I'm not sure how to fix these issues. Attached is the error file that is generated when I try to run server.bat

STDB Error File.odt

Convert between StDb and inventory

New features of StDb should include:

  • Provide method to convert from StDb object to ObsPy.inventory object

  • Plot database using Cartopy

Can't import Stdb due to lack of PyQt files

Problem:
I ran into an error when trying to import Stdb in OrientPy.

Evironment:
Fedora 31(5.8.6-101.fc31.x86_64), python=3.7

Situation:

conda create -n stdb python=3.7 obspy -c conda-forge
conda activate stdb
pip install stdb
import stdb

Error:

>>> import stdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/chen/.conda/envs/stdb/lib/python3.7/site-packages/stdb/__init__.py", line 118, in <module>
    from .gui import EditMsgBox
  File "/home/chen/.conda/envs/stdb/lib/python3.7/site-packages/stdb/gui.py", line 33, in <module>
    from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QPushButton, QAction, QLineEdit, QMessageBox
ImportError: /lib64/libQt5Core.so.5: version `Qt_5.15' not found (required by /home/chen/.conda/envs/stdb/lib/python3.7/site-packages/PyQt5/QtWidgets.abi3.so)

Conda list:

# packages in environment at /home/chen/.conda/envs/stdb:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
brotlipy                  0.7.0           py37h5e8e339_1001    conda-forge
ca-certificates           2020.12.5            ha878542_0    conda-forge
certifi                   2020.12.5        py37h89c1867_1    conda-forge
cffi                      1.14.5           py37hc58025e_0    conda-forge
chardet                   4.0.0            py37h89c1867_1    conda-forge
cryptography              3.4.6            py37h5d9358c_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
decorator                 4.4.2                      py_0    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
future                    0.18.2           py37h89c1867_3    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
kiwisolver                1.3.1            py37h2527ec5_1    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.35.1               hea4e1c9_2    conda-forge
libblas                   3.9.0                8_openblas    conda-forge
libcblas                  3.9.0                8_openblas    conda-forge
libffi                    3.3                  h58526e2_2    conda-forge
libgcc-ng                 9.3.0               h2828fa1_18    conda-forge
libgfortran-ng            9.3.0               hff62375_18    conda-forge
libgfortran5              9.3.0               hff62375_18    conda-forge
libgomp                   9.3.0               h2828fa1_18    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0                8_openblas    conda-forge
libopenblas               0.3.12          pthreads_h4812303_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libstdcxx-ng              9.3.0               h6de172a_18    conda-forge
libtiff                   4.2.0                hdc55705_0    conda-forge
libwebp-base              1.2.0                h7f98852_0    conda-forge
libxml2                   2.9.10               h72842e0_3    conda-forge
libxslt                   1.1.33               h15afd5d_2    conda-forge
lxml                      4.6.2            py37h77fd288_1    conda-forge
lz4-c                     1.9.3                h9c3ff4c_0    conda-forge
matplotlib-base           3.3.4            py37h0c9df89_0    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
numpy                     1.20.1           py37haa41c4c_0    conda-forge
obspy                     1.2.2            py37h03ebfcd_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openssl                   1.1.1j               h7f98852_0    conda-forge
pillow                    8.1.2            py37h4600e1f_0    conda-forge
pip                       21.0.1             pyhd8ed1ab_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyqt5                     5.15.4                   pypi_0    pypi
pyqt5-qt5                 5.15.2                   pypi_0    pypi
pyqt5-sip                 12.8.1                   pypi_0    pypi
pysocks                   1.7.1            py37h89c1867_3    conda-forge
python                    3.7.10          hffdb5ce_100_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
readline                  8.0                  he28a2e2_2    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
scipy                     1.6.0            py37h14a347d_0    conda-forge
setuptools                49.6.0           py37h89c1867_3    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
sqlalchemy                1.3.23           py37h5e8e339_0    conda-forge
sqlite                    3.34.0               h74cdb3f_0    conda-forge
stdb                      0.2.0                    pypi_0    pypi
tk                        8.6.10               h21135ba_1    conda-forge
tornado                   6.1              py37h5e8e339_1    conda-forge
urllib3                   1.26.4             pyhd8ed1ab_0    conda-forge
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge
zstd                      1.4.9                ha95c52a_0    conda-forge

Solution:
This situation is resulted from the wrong import path. I uninstalled pyqt5 and install conda install -c anaconda pyqt fixed this issue. It's the same problem like #18. Thanks for help.

Querying client...Exception: Cannot complete query or no data in query...

I want to create the station database from Haiti region: http://ds.iris.edu/mda/AY/NQTMS/?starttime=2012-07-18&endtime=2599-12-31

I use query_fdsn_stdb -N AY -S NQTMS NQTMS

But it prints:
Output Files: NQTMS.csv and NQTMS.pkl
Initializing Client (IRIS)...Done'
Querying client...Exception: Cannot complete query or no data in query..

One more query: Is there any other way to get station database in .pkl format? Like can we create the database from set of .SAC waveforms of that station?

gen_stdb.py polarity and azcorr problem

Maybe raising an issue isn't the best way to ask about it, but in the line

location=loc, latitude=lat, longitude=lon, elevation=elev, polarity=1., \

instead of "polarity=1." shouldn't be "polarity=pol" ?
And in the next line:
"azcorr=0" => "azcorr=azcor"

With the current version of the software the azimuthal correction will be always 0 in the database.

Upgrade to obspy=1.2

StDb used to work fine with ObsPy version <= 1.1. However, with the new StationXML version, the station start dates and end dates obtained in query_fdsn_stdb.py are incorrect:

conda create -n stdb python=3.7 obspy -c conda-forge
conda activate stdb
conda list obspy
# packages in environment at /Users/pascalaudet/anaconda3/envs/stdb:
#
# Name                    Version                   Build  Channel
obspy                     1.2.1            py38h65ad66c_1    conda-forge
pip install stdb
query_fdsn_stdb.py -C HH? -S TGTN TGTN
Warning: one of lat,lon,minr,maxr were not set. All values reset to None. 
 
Warning: No Time Range Specified for Search
 
Station/Channel Search Parameters:
   Network:  *
   Stations: TGTN
   Channels: HH?
   Channel Rank: LH,BH,HH
 
Output Files: TGTN.csv and TGTN.pkl
 
Initializing Client (IRIS)...Done

Querying client...Done

Search Complete: 
  1 stations in 1 networks
 
Network: NY
   Station: TGTN
     Lon, Lat, Elev: -128.2727,  61.5267,   0.000
     Start Date: 2013-07-01 00:00:00
Traceback (most recent call last):
  File "/Users/pascalaudet/anaconda3/envs/stdb/bin/query_fdsn_stdb.py", line 512, in <module>
    print ("     End Date:   {0:s}".format(eddt.strftime("%Y-%m-%d %H:%M:%S")))
AttributeError: 'NoneType' object has no attribute 'strftime'

However, when installing obspy=1.1 from the beginning, the problem is slightly different:

conda create -n stdb python=3.7 obspy=1.1 -c conda-forge
conda activate stdb
conda list obspy
# packages in environment at /Users/pascalaudet/anaconda3/envs/stdb:
#
# Name                    Version                   Build  Channel
obspy                     1.1.1            py37h917ab60_1    conda-forge
pip install stdb
query_fdsn_stdb.py -C HH? -S TGTN TGTN
Warning: one of lat,lon,minr,maxr were not set. All values reset to None. 
 
Warning: No Time Range Specified for Search
 
Station/Channel Search Parameters:
   Network:  *
   Stations: TGTN
   Channels: HH?
   Channel Rank: LH,BH,HH
 
Output Files: TGTN.csv and TGTN.pkl
 
Initializing Client (IRIS)...Done

/Users/pascalaudet/anaconda3/envs/stdb/lib/python3.7/site-packages/obspy/io/stationxml/core.py:84: UserWarning: The StationXML file has version 1.1, ObsPy can deal with version 1.0. Proceed with caution.
  root.attrib["schemaVersion"], SCHEMA_VERSION))
Querying client...Done

Search Complete: 
  1 stations in 1 networks
 
Network: NY
   Station: TGTN
     Lon, Lat, Elev: -128.2727,  61.5267,   0.000
     Start Date: 2013-07-01 00:00:00
Traceback (most recent call last):
  File "/Users/pascalaudet/anaconda3/envs/stdb/bin/query_fdsn_stdb.py", line 512, in <module>
    print ("     End Date:   {0:s}".format(eddt.strftime("%Y-%m-%d %H:%M:%S")))
AttributeError: 'NoneType' object has no attribute 'strftime'

It looks like the StationXML version 1.1 is the problem, although I am not sure how to deal with this. We might have to re-write part of StDb to deal with the new obspy and stationxml versions.

Fix location codes

This issue was raised in SplitPy: paudetseis/SplitPy#8 and concerns the handling of location codes in the script query_fdsn_stdb.py.

The issue was partially fixed by adding an argument -L to specify the location code of interest. For example, query_fdsn_stdb.py -N IU -S ANMO -L 00 db. The code currently only handles one location code as argument (no comma-separated values). See commit f7d880d

In (partially) fixing this issue, a new one came up where the default chnrank option gets superseded by the sorting done in the inventory object. So even though the chnrank has first item 'LH' by default, the first channel available in the inventory object is 'BH'.

To do:

  • Fix code to use a list of location codes (will have to fix the station keys in that case to use a long form) as input
  • Fix the sorting of channels in inventory to use 'chnrank`

PyQt files not found by Stdb

I run into an error when trying to import StDb on my institution's cluster (running CentOS 7 with Python 3.7 and Anaconda 4.4.0). I perform the following steps:

conda create -n stdb python=3.7 obspy -c conda-forge
conda activate stdb
pip install stdb
import stdb

which produces

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jtbryan/.local/lib/python3.7/site-packages/stdb/__init__.py", line 118, in <module>
    from .gui import EditMsgBox
  File "/home/jtbryan/.local/lib/python3.7/site-packages/stdb/gui.py", line 33, in <module>
    from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QPushButton, QAction, QLineEdit, QMessageBox
ImportError: /home/software/anaconda3/4.4.0/lib/libQt5Core.so.5: version `Qt_5.15' not found (required by /home/jtbryan/.local/lib/python3.7/site-packages/PyQt5/QtWidgets.abi3.so)

I think it might be a version issue. I look in /home/software/anaconda4/4.4.0/lib/ and see only .so files up to PyQt version 5.6.2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.