ROBelgium / MSNoise

A Python Package for Monitoring Seismic Velocity Changes using Ambient Seismic Noise | http://www.msnoise.org
European Union Public License 1.1
178 stars 83 forks source link

question about stretching with MSNoise #376

Open imme-w opened 4 weeks ago

imme-w commented 4 weeks ago

Hello Thomas,

I have a question about using the stretching technique to calculate velocity variations with MSNoise. I have used the command msnoise cc dvv compute_stretching and this seems to be working as new folders _STR2/01/1d1d/ZZ/ are created which contain csv files corresponding to the station combinations I have. But then if I try to run msnoise cc dvv plot dvvs I get this:

Usage: msnoise cc dvv plot [OPTIONS] COMMAND [ARGS]...
Try 'msnoise cc dvv plot --help' for help.

Error: No such command 'dvvs'.

I found the commands in this list because the documentation on stretching seems to missing?

I have tried determining which version of MSNoise I am using by using pip show msnoise and it says Version: 0.0.0+202405021339 but I'm not exactly sure what that means.

Do you have any idea what I could be doing wrong?

Thanks!

ThomasLecocq commented 4 weeks ago

Hi, I believe your version of the dev version is a little too old, make sure to install the latest version which matches the documentation (still in progress, as always, it's the most difficult to get done...)

imme-w commented 3 weeks ago

Hi, thanks your reply! How can I install the dev version using conda? Because I am working on a cluster and I cannot use pip? Thank you

imme-w commented 3 weeks ago

Nevermind I got that part! Will try to see if msnoise cc dvv plot dvvs works now, might take some time..

imme-w commented 2 weeks ago

Hi again, if I have updated my msnoise dev version by reinstalling it. I scanned my archive and did the cross-correlations (msnoise cc compute_cc) and the stacking (msnoise cc stack -r, msnoise reset STACK, msnoise cc stack -m) but now if I run msnoise cc dvv compute_stretching I get this error:

2024-11-05 09:45:37.727874 msnoise [pid 3866832][INFO]: *** Starting: Compute Stretching ***
2024-11-05 09:45:40.668208 msnoise [pid 3866832][INFO]: There are MWCS (stretching) jobs for some days to recompute for FR.OGS1.00:FR.OGS3.00
betweeen 5.0 and 35.0
Reading STACKS2/01/1d_1d/ZZ/FR.OGS1.00_FR.OGS3.00.nc
Traceback (most recent call last):
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/bin/msnoise", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/msnoise/scripts/msnoise.py", line 1638, in run
    cli(obj={})
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/msnoise/scripts/msnoise.py", line 1170, in dvv_compute_stretching2
    main()
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/msnoise/stretch2.py", line 260, in main
    data.iloc[:,mid - int(maxlag2 * params.goal_sampling_rate)] *= 0.
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/pandas/core/indexing.py", line 1184, in __getitem__
    return self._getitem_tuple(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/pandas/core/indexing.py", line 1690, in _getitem_tuple
    tup = self._validate_tuple_indexer(tup)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/pandas/core/indexing.py", line 966, in _validate_tuple_indexer
    self._validate_key(k, i)
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/pandas/core/indexing.py", line 1592, in _validate_key
    self._validate_integer(key, axis)
  File "/mnt/contrib/all/anaconda3/envs/msnoise-python3.11/lib/python3.11/site-packages/pandas/core/indexing.py", line 1685, in _validate_integer
    raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds

Do you know what I could be doing wrong? Thanks a lot!

ThomasLecocq commented 3 days ago

looks like there is an issue with the "time lag" used for stretching. Could you check if the "distance plot" looks OK ? Could be something with the coordinates of the stations etc?