https://github.com/claudiodsf/nllgrid
Python class for reading and writing NLLoc grid files.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.7%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Python class for reading and writing NLLoc grid files.
Basic Info
- Host: GitHub
- Owner: claudiodsf
- License: gpl-3.0
- Language: Python
- Default Branch: main
- Size: 175 KB
Statistics
- Stars: 37
- Watchers: 6
- Forks: 13
- Open Issues: 3
- Releases: 15
Topics
Metadata Files
README.md
NLLGrid
Python class for reading and writing NonLinLoc grid files.
(c) 2015-2025 Claudio Satriano, Natalia Poiata, Robert Pickle
Installation
Using Anaconda
If you use Anaconda, the latest release of nllgrid is available via conda-forge.
To install, simply run:
conda install -c conda-forge nllgrid
Using pip and PyPI
The latest release of nllgrid is available on the Python Package Index.
You can install it easily through pip:
pip install nllgrid
From nllgrid GitHub releases
Download the latest release from the
releases page,
in zip or tar.gz format, then:
pip install nllgrid-X.Y.zip
or
pip install nllgrid-X.Y.tar.gz
Where, X.Y is the version number (e.g., 1.3).
You don't need to uncompress the release files yourself.
Installing a development snapshot
If you need a recent feature that is not in the latest release (see the
unreleased section in CHANGELOG), you want to use the
more recent development snapshot from the
nllgrid GitHub repository.
Using pip
The easiest way to install the most recent development snapshot is to download
and install it through pip, using its builtin git client:
pip install git+https://github.com/claudiodsf/nllgrid.git
Run this command again, from times to times, to keep NLLGrid updated with the development version.
Cloning the NLLGrid GitHub repository
If you want to take a look at the source code (and possibly modify it 😉),
clone the project using git:
git clone https://github.com/claudiodsf/nllgrid.git
or, using SSH:
git clone git@github.com:claudiodsf/nllgrid.git
(avoid using the "Download ZIP" option from the green "Code" button, since version number is lost).
Then, go into the nllgrid main directory and install the code in "editable
mode" by running:
pip install -e .
You can keep your local NLLGrid repository updated by running git pull
from times to times. Thanks to pip's "editable mode", you don't need to
reinstall NLLGrid after each update.
Getting Started
Reading a NLL grid
A NLL grid is composed of two files (.hdr and .buf).
To read a NLL grid, do:
```python
from nllgrid import NLLGrid grd = NLLGrid('somegrid.hdr') ```
or, using the .buf filename:
```python
grd = NLLGrid('somegrid.buf') ```
or even without any extension:
```python
grd = NLLGrid('somegrid') ```
A grid description can be obtained by:
```python
print(grd) ```
The grid data array is accessed by grd.array.
The grid can be plotted doing:
```python
grd.plot() ```
Use Python introspection (e.g. dir(grd)) to see all the available
methods and attributes.
Creating a NLL grid
Suppose that you have a 3D data array stored into a NumPy array
called mydata.
First, create an empty NLL grid object:
```python
from nllgrid import NLLGrid grd = NLLGrid() ```
then, add the data array and information on grid sampling and grid origin, e.g.:
```python
grd.array = mydata grd.dx = 0.5 #km grd.dy = 0.5 #km grd.dz = 0.5 #km grd.xorig = -10 #km grd.yorig = -20. #km grd.z_orig = -1. #km ```
Optionally, add a grid type and/or a geographic transformation:
```python
grd.type = 'VELOCITY' grd.origlat = 40.63 grd.origlon = 15.80 grd.projname = 'LAMBERT' grd.firststdparal = 38. grd.secondstdparal = 42. grd.projellipsoid = 'WGS-84' ```
Finally, give a basename and write to disk:
```python
grd.basename = 'mygrid' grd.writehdrfile() grd.writebuffile() ```
This will create the two files mygrid.hdr and mygrid.buf.
If you want to save your grid in double precision (required for
instance by NLDiffLoc), change grd.float_type to 'DOUBLE' before
saving the grid (default is 'FLOAT'):
```python
grd.float_type = 'DOUBLE' ```
Note that if you want to use your grid as input for NonLinLoc
Grid2Time code, the grid type has to be SLOW_LEN and your grid
array has to be transformed into slowness (in s/km) and multiplied
by the grid step (in km).
Owner
- Name: Claudio Satriano
- Login: claudiodsf
- Kind: user
- Location: Paris, France
- Company: @IPGP
- Website: https://www.ipgp.fr/~satriano
- Twitter: claudiodsf
- Repositories: 13
- Profile: https://github.com/claudiodsf
Seismologist, Continuous Learner
GitHub Events
Total
- Release event: 1
- Watch event: 1
- Issue comment event: 2
- Push event: 7
- Pull request event: 1
- Fork event: 2
Last Year
- Release event: 1
- Watch event: 1
- Issue comment event: 2
- Push event: 7
- Pull request event: 1
- Fork event: 2
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Claudio Satriano | s****o@g****m | 133 |
| filefolder | r****e@g****m | 3 |
| dependabot[bot] | 4****] | 1 |
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 4
- Total pull requests: 5
- Average time to close issues: 5 days
- Average time to close pull requests: 5 days
- Total issue authors: 4
- Total pull request authors: 2
- Average comments per issue: 1.75
- Average comments per pull request: 3.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 2
- Pull requests: 2
- Average time to close issues: 10 days
- Average time to close pull requests: about 8 hours
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 2.5
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- filefolder (1)
- ZLS92 (1)
- loicbachelot (1)
- megies (1)
Pull Request Authors
- filefolder (5)
- dependabot[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 133 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 1
(may contain duplicates) - Total versions: 12
- Total maintainers: 1
pypi.org: nllgrid
Python class for reading and writing NonLinLoc grid files
- Homepage: https://github.com/claudiodsf/nllgrid
- Documentation: https://nllgrid.readthedocs.io/
- License: GNU General Public License v3 or later (GPLv3+)
-
Latest release: 1.5.3
published over 1 year ago
Rankings
Maintainers (1)
conda-forge.org: nllgrid
Python class for reading and writing NonLinLoc grid files.
- Homepage: https://github.com/claudiodsf/nllgrid
- License: GPL-3.0-or-later
-
Latest release: 1.4.2
published over 4 years ago
Rankings
Dependencies
- autoclasstoc *
- sphinx_autodoc_typehints *
- numpy >=1.0
- pyproj *
- scipy >=0.16
- actions/checkout v1 composite
- actions/download-artifact v2 composite
- actions/upload-artifact v2 composite
- pypa/gh-action-pypi-publish v1.4.2 composite
- actions/checkout v2 composite
- lsegal/github-release-from-changelog-action latest composite
- numpy >=1.0
- pyproj *
- scipy >=0.16