Coder Social home page Coder Social logo

autostatsq's People

Contributors

dependabot[bot] avatar gesape avatar javiquinte avatar luigiacristiano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

autostatsq's Issues

Suggestion: in orientation search, use cross-correlation normalised by Z power instead of CC coefficient

The title should say it all. The justification is given in Stachnik et al . (2012):

This function [Cross-correlation coefficient] is useful because it is bounded on the interval −1
to 1, but it is difficult to find a maximum
because the autocorrelation of the radial component ($S_{rr}$ ) in
the denominator varies with the numerator. This can result in
a range of back azimuths with similar values near the maxi-
mum. Thus a second normalization is used:
$C_{z ̄r} = S{ z ̄r}/S_{zz}$
which has a well-defined maximum value and is used to select
the appropriate azimuth

The flat tops he alludes to are quite obvious in Fig. 3 of the 2019 SRL paper. It's easy to see why: an idealised Rayleigh wave with zero energy on the transverse would lead to a rectangular function of cross-correlation coefficient as dependent on trial orientation angle, ie. CC coefficient would be either -1 and 1. Using the vertical component normalisation instead leads to a more sinusoidal curve with a more clearly defined maximum (if you just pick the maximum, you could also ignore the normalisation entirely).

Hardcoded downsampling target leads to error

In the restitution step when applying to LH data (deltaT=1 s) with the following parameters

- !autostatsq.config.RestDownRotConfig
  rest_data: true
  freqlim: [0.005, 0.01, 0.2, 0.25]
  rotate_data: true
  deltat_down: 2.0

I get an error about Unavailable Decimations Rate:

INFO:Restitution: Starting restitution of data.
INFO:Restitution: Number of responses found: 1.
INFO:Restitution: Starting restitution of data, shallow subset.
Traceback (most recent call last):
  File "/home/tilmann/.local/bin/autostatsq", line 11, in <module>
    load_entry_point('autostatsq==0.1', 'console_scripts', 'autostatsq')()
  File "/home/tilmann/.local/lib/python3.8/site-packages/autostatsq-0.1-py3.8.egg/autostatsq/network_control.py", line 978, in main
    tr.downsample_to(0.1)
  File "/usr/local/lib/python3.8/dist-packages/pyrocko/trace.py", line 663, in downsample_to
    raise util.UnavailableDecimation('ratio = %g' % ratio)
pyrocko.util.UnavailableDecimation: ratio = 0.1

Looking t the code (main branch) it seems the downto_sample is hard-coded to 0.1 rather than using the configuration value, in two places within network_control.py.

Addendum: changing

tr.downsample_to(RestDownconf.deltat_down(0.1)

to

tr.downsample_to(RestDownconf.deltat_down,allow_upsample_max=3,snap=True)

seems to have solved the issue (the other parameters seemed a good idea to me after reading downsample_to documentation. [ Would send a PR but on ship internet and not so familiar with this procedure I don't have the patience now ]

grond dependency

Install instruction needs updating, or better would be to try to get it independent from grond or at least optional

Successfully installed UNKNOWN

Hi,

When I was trying to install it by the command:

sudo -H pip install master.zip

I got the following output:

Processing ./master.zip
Installing collected packages: UNKNOWN
  Running setup.py install for UNKNOWN ... done
Successfully installed UNKNOWN-0.1

fdsn download sites - add to main branch

usage of fdsn urls for sites not part of pyrocko url list currently implemented in branch allow_fdsn_urls. Should be added to main branch soon after running all code tests.

project linting

Hey Gesa,

I recommend throwing black at autostatsq. It helps to maintain a consistent style which in turn helps others to quickly dive into your code.

Also I think the dist folder can be removed.

Data request exception error

Hello!
Very often and in many stations I am facing an exception error when i am trying to download data in order to use AutostatsQ. After scouting to understand the problem, i found out that in these cases Pyrocko displays time_out error.

I solved it adding to network_control.py file: fdsn.g_timeout = 60.

Raising the timeout time, will be very helpful in order to avoid exceptions due to slow interactions with the Data Nodes.
Maybe will be useful to add this option to AutostatsQ config file in the future.

Thank you.

Step-by-Step issue

Hi,
I've installed the AutoStatQ software and I'm trying to follow the step-by-step example in the instruction pdf.
Following Step 1, regarding the Catalog generation, and running

autostatsq --config ./AutoStatsQ_settings.config --run -l INFO

I find this output raising the error at the end

" INFO:root:Checking configuration file.
INFO:root:Welcome to AutoStatsQ - a station quality control checking tool.

INFO:Run: Number of stations: 9
INFO:Catalog search:length catalog: 94
INFO:Subset events: Plotting catalog azimuthal for full catalog: deep.
INFO:root:saved ./results/catalog/catalog_global_Mgr7.0_2015-01-01-2021-12-01_deep.png
INFO:Subset events: Plotting catalog histogram for full catalog: deep.
Traceback (most recent call last):
File "/home/simone/anaconda3/envs/pyrocko/bin/autostatsq", line 33, in
sys.exit(load_entry_point('autostatsq==0.1', 'console_scripts', 'autostatsq')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/simone/anaconda3/envs/pyrocko/lib/python3.11/site-packages/autostatsq-0.1-py3.11.egg/autostatsq/network_control.py", line 401, in main
plot_catalog_hist(ev_cat, dist_array, mean_wedges_mp,
File "/home/simone/anaconda3/envs/pyrocko/lib/python3.11/site-packages/autostatsq-0.1-py3.11.egg/autostatsq/catalogplots.py", line 64, in plot_catalog_hist
ax1.hist(mean_wedges_mp, normed=False, bins=bins_hist, color='lightgrey')
File "/home/simone/anaconda3/envs/pyrocko/lib/python3.11/site-packages/matplotlib/init.py", line 1465, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/simone/anaconda3/envs/pyrocko/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 7007, in hist
p._internal_update(kwargs)
File "/home/simone/anaconda3/envs/pyrocko/lib/python3.11/site-packages/matplotlib/artist.py", line 1219, in _internal_update
return self._update_props(
^^^^^^^^^^^^^^^^^^^
File "/home/simone/anaconda3/envs/pyrocko/lib/python3.11/site-packages/matplotlib/artist.py", line 1193, in _update_props
raise AttributeError(
AttributeError: Rectangle.set() got an unexpected keyword argument 'normed' "

The code generated only two files in the result folder that are:

catalog_global_Mgr7.0_2015-01-01-2021-12-01_deep.png
catalog_Mgr7.0.txt

but no one referred to shallow events.
Do you know what is the problem and how to solve it?
Thanks,
Simone

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.