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

Numpy array for data in patch? #12

Closed
ArthurRodgers opened this issue Mar 28, 2018 · 4 comments
Closed

Numpy array for data in patch? #12

ArthurRodgers opened this issue Mar 28, 2018 · 4 comments

Comments

@ArthurRodgers
Copy link

ArthurRodgers commented Mar 28, 2018

Hi Shahar -

I want to use pySW4 to access, manipulate and output image data. Is there a way to access the regular 2D raster data of a patch object? For example the values of topo, gridz, vs, mag at the surface (z=0) or cross-section (not intersected by mesh refinement).

I can read SW4 image files into Image objects, but is there an attribute for the array of data that makes up the image, something like patch.data ?

@ArthurRodgers
Copy link
Author

I think I found it:

topo.patches[0].data

@shaharkadmiel
Copy link
Owner

Hi Artie,

Yes, indeed. In pySW4 we followed the Obspy data model:

Stream . traces [list]
          |--> Trace . data [numpy array]
          |     |--> .  stats
          |     |--> ...
          |
          |--> Trace ...

In pySW4 this would be:

Image . patches [list]
          |--> Patch . data [numpy array]
          |     |--> .  header
          |     |--> ...
          |
          |--> Patch ...

If you want to contribute a nice example of this functionality you are more than welcome.

Cheers

@ArthurRodgers
Copy link
Author

ArthurRodgers commented Mar 28, 2018 via email

@megies
Copy link
Collaborator

megies commented Apr 9, 2018

Looks like this one can be closed..

@megies megies closed this as completed Apr 9, 2018
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

3 participants