claudiodsf / nllgrid Goto Github PK
View Code? Open in Web Editor NEWPython class for reading and writing NLLoc grid files.
License: Other
Python class for reading and writing NLLoc grid files.
License: Other
Hiya Claudio, nice to see you at work on this lately
I think there is a minor glitch in NLLGrid because I can no longer read the .hdr files properly, reading the file (e.g. grd = nllgrid.NLLGrid('P.mod')
) outputs the default values instead of the actual ones.
~ line 203
def __init__(self,
basename=None,
nx=1, ny=1, nz=1,
x_orig=0., y_orig=0., z_orig=0.,
dx=1., dy=1., dz=1.):
"""
Initialize a NLLGrid object.
If `basename` is not `None`, `read_hdr_file` and `read_buf_file`
methods are called.
"""
if basename is not None:
self.basename = self.remove_extension(basename)
self.read_hdr_file()
self.read_buf_file()
else:
self.basename = None
self.nx = nx
self.ny = ny
self.nz = nz
self.x_orig = x_orig
self.y_orig = y_orig
self.z_orig = z_orig
self.dx = dx
self.dy = dy
self.dz = dz
Seems like the last 9 lines need to be indented under the else
clause because otherwise they will always output 1, 1, 1, 0, 0 etc even if basename is not None
Hi @claudiodsf, nice helper project!
Here's some initial observations for potential improvements in the future:
plot()
parameter slice_index
is a bit awkward, I think, why not make it possible to directly specify coordinates (x, y and z) instead of indices (that you have to compute first from the coordinates and grid spacing) to use for the slices (e.g. to specify the x/y coordinates of a station, to plot the model slices going through that station)SLOW_LEN
(model) grids as seismic velocity instead?A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.