Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about stretching with MSNoise #376

Closed
imme-w opened this issue Oct 28, 2024 · 6 comments
Closed

question about stretching with MSNoise #376

imme-w opened this issue Oct 28, 2024 · 6 comments

Comments

@imme-w
Copy link

imme-w commented Oct 28, 2024

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/1d_1d/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
Copy link
Member

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
Copy link
Author

imme-w commented Oct 29, 2024

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
Copy link
Author

imme-w commented Oct 29, 2024

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

@imme-w
Copy link
Author

imme-w commented Nov 5, 2024

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
Copy link
Member

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?

@imme-w
Copy link
Author

imme-w commented Nov 29, 2024

Hi, you were right, I made a mistake with the time lag, which was longer than my correlation duration.. Both the stretching and the plotting works now, thank you!

@imme-w imme-w closed this as completed Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants