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

File name input in meca does not accept top comments #2613

Closed
SeismoFelix opened this issue Jul 21, 2023 · 4 comments
Closed

File name input in meca does not accept top comments #2613

SeismoFelix opened this issue Jul 21, 2023 · 4 comments
Labels
wontfix This will not be worked on

Comments

@SeismoFelix
Copy link

Description of the problem

Probably this is a minor thing, so sorry for the inconvenience and I hope it was useful for someone like me that is trying to migrate from pure GMT to PyGMT.

I installed PyGMT on Mar 25, 2022. However, I needed to use the meca feature including the option cmap and I realized that this is a recent improvement . Unfortunately, the same code that used to work with the old PyGMT version is not working with the new version unless I remove the top comment from the input file given in spec (using convention = "mt").

Text input file used to be and work:

Moment tensor list
#1: 2023_07_05_07_46
-22.19872 63.9277 6 -1.841e+22 1.235e+22 6.058e+21 -1.914e+22 1.27e+22 3.9e+22 1 0 0
#2: 2023_07_05_08_20
-22.19574 63.93407 6 -1.489e+22 2.587e+22 -1.098e+22 -2.85e+22 1.706e+22 4.669e+22 1 0 0
#3: 2023_07_05_09_49
-22.1753 63.93252 6 -6.451e+21 5.499e+21 9.525e+20 -6.693e+21 3.644e+21 1.318e+22 1 0 0

**The new PyGMT imposes removing the top comments or adding a "#" in front of the comment:

#1: 2023_07_05_07_46
-22.19872 63.9277 6 -1.841e+22 1.235e+22 6.058e+21 -1.914e+22 1.27e+22 3.9e+22 1 0 0
#2: 2023_07_05_08_20
-22.19574 63.93407 6 -1.489e+22 2.587e+22 -1.098e+22 -2.85e+22 1.706e+22 4.669e+22 1 0 0
#3: 2023_07_05_09_49
-22.1753 63.93252 6 -6.451e+21 5.499e+21 9.525e+20 -6.693e+21 3.644e+21 1.318e+22 1 0 0

Although the message is a warning the focal mechanisms are not plotted.

Minimal Complete Verifiable Example

fig.meca(
    spec='TXT/MT_sorted_by_time_colortime_version.txt',
    scale='0.5c',
    convention="mt",
    #cmap=True
)

Full error message

meca [WARNING]: No data records provided

System information

New:
PyGMT information:
  version: v0.9.0
System information:
  python: 3.8.17 | packaged by conda-forge | (default, Jun 16 2023, 07:11:34)  [Clang 14.0.6 ]
  executable: /Users/felix/opt/anaconda3/envs/mtuq_j/bin/python
  machine: macOS-10.16-x86_64-i386-64bit
Dependency information:
  numpy: 1.24.4
  pandas: 2.0.3
  xarray: 2022.11.0
  netCDF4: 1.6.4
  packaging: 23.1
  contextily: None
  geopandas: None

  ghostscript: 9.54.0
GMT library information:
  binary version: 6.4.0
  cores: 16
  grid layout: rows
  image layout: 
  library path: /Users/felix/opt/anaconda3/envs/mtuq_j/lib/libgmt.dylib
  padding: 2
  plugin dir: /Users/felix/opt/anaconda3/envs/mtuq_j/lib/gmt/plugins
  share dir: /Users/felix/opt/anaconda3/envs/mtuq_j/share/gmt
  version: 6.4.0

Old:
PyGMT information:
  version: v0.7.0
System information:
  python: 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:05:47)  [Clang 12.0.1 ]
  executable: /Users/felix/opt/anaconda3/envs/mtuq/bin/python
  machine: macOS-10.16-x86_64-i386-64bit
Dependency information:
  numpy: 1.23.1
  pandas: 1.4.3
  xarray: 2022.3.0
  netCDF4: 1.6.0
  packaging: 21.3
  geopandas: None
  ghostscript: 9.54.0
  gmt: 6.4.0
GMT library information:
  binary dir: /Users/felix/opt/anaconda3/envs/mtuq/bin
  cores: 16
  grid layout: rows
  library path: /Users/felix/opt/anaconda3/envs/mtuq/lib/libgmt.dylib
  padding: 2
  plugin dir: /Users/felix/opt/anaconda3/envs/mtuq/lib/gmt/plugins
  share dir: /Users/felix/opt/anaconda3/envs/mtuq/share/gmt
  version: 6.4.0
@SeismoFelix SeismoFelix added the bug Something isn't working label Jul 21, 2023
@welcome
Copy link

welcome bot commented Jul 21, 2023

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.

@seisman
Copy link
Member

seisman commented Jul 22, 2023

Sorry, I don't fully understand your issue. Do you mean the following input file doesn't work?

#1: 2023_07_05_07_46
-22.19872 63.9277 6 -1.841e+22 1.235e+22 6.058e+21 -1.914e+22 1.27e+22 3.9e+22 1 0 0
#2: 2023_07_05_08_20
-22.19574 63.93407 6 -1.489e+22 2.587e+22 -1.098e+22 -2.85e+22 1.706e+22 4.669e+22 1 0 0
#3: 2023_07_05_09_49
-22.1753 63.93252 6 -6.451e+21 5.499e+21 9.525e+20 -6.693e+21 3.644e+21 1.318e+22 1 0 0

@SeismoFelix
Copy link
Author

Sorry for the late reply. Yes the file you showed works. I meant if you put a comment on top without # then it does not work. Like this:

Moment tensor list
#1: 2023_07_05_07_46
-22.19872 63.9277 6 -1.841e+22 1.235e+22 6.058e+21 -1.914e+22 1.27e+22 3.9e+22 1 0 0
#2: 2023_07_05_08_20
-22.19574 63.93407 6 -1.489e+22 2.587e+22 -1.098e+22 -2.85e+22 1.706e+22 4.669e+22 1 0 0
#3: 2023_07_05_09_49
-22.1753 63.93252 6 -6.451e+21 5.499e+21 9.525e+20 -6.693e+21 3.644e+21 1.318e+22 1 0 0

Of course, is a minor thing and I can either add a # character or simply delete the comment. Still, in the previous version of PyGMT having a top comment without # was not inconvenient. Thanks

@seisman
Copy link
Member

seisman commented Aug 1, 2023

Sorry for the late reply. Yes the file you showed works. I meant if you put a comment on top without # then it does not work. Like this:

Moment tensor list
#1: 2023_07_05_07_46
-22.19872 63.9277 6 -1.841e+22 1.235e+22 6.058e+21 -1.914e+22 1.27e+22 3.9e+22 1 0 0
#2: 2023_07_05_08_20
-22.19574 63.93407 6 -1.489e+22 2.587e+22 -1.098e+22 -2.85e+22 1.706e+22 4.669e+22 1 0 0
#3: 2023_07_05_09_49
-22.1753 63.93252 6 -6.451e+21 5.499e+21 9.525e+20 -6.693e+21 3.644e+21 1.318e+22 1 0 0

Of course, is a minor thing and I can either add a # character or simply delete the comment. Still, in the previous version of PyGMT having a top comment without # was not inconvenient. Thanks

The file you posted should not work with any GMT or PyGMT versions. If it worked, then it's a bug. So closing the issue.

@seisman seisman closed this as completed Aug 1, 2023
@seisman seisman added wontfix This will not be worked on and removed bug Something isn't working labels Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants