https://github.com/claudiodsf/nllgrid

Python class for reading and writing NLLoc grid files.

https://github.com/claudiodsf/nllgrid

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

3d-models earthquakes research seismology

Keywords from Contributors

observatory archival interactive projection sequences web-service ecosystem-modeling hacking shellcodes modular
Last synced: 10 months ago · JSON representation

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
3d-models earthquakes research seismology
Created about 9 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.md

NLLGrid

Python class for reading and writing NonLinLoc grid files.

(c) 2015-2025 Claudio Satriano, Natalia Poiata, Robert Pickle

changelog-badge cf-badge PyPI-badge license-badge docs-badge

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

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

All Time
  • Total Commits: 137
  • Total Committers: 3
  • Avg Commits per committer: 45.667
  • Development Distribution Score (DDS): 0.029
Past Year
  • Commits: 32
  • Committers: 2
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.031
Top Committers
Name Email 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
dependencies (2)

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

  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 133 Last month
Rankings
Forks count: 9.8%
Dependent packages count: 10.1%
Stargazers count: 11.6%
Average: 16.4%
Dependent repos count: 21.6%
Downloads: 29.1%
Maintainers (1)
Last synced: 10 months ago
conda-forge.org: nllgrid

Python class for reading and writing NonLinLoc grid files.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Forks count: 40.0%
Average: 42.2%
Stargazers count: 43.7%
Dependent packages count: 51.2%
Last synced: 10 months ago

Dependencies

docs/requirements.txt pypi
  • autoclasstoc *
  • sphinx_autodoc_typehints *
setup.py pypi
  • numpy >=1.0
  • pyproj *
  • scipy >=0.16
.github/workflows/github-deploy.yml actions
  • actions/checkout v1 composite
  • actions/download-artifact v2 composite
  • actions/upload-artifact v2 composite
  • pypa/gh-action-pypi-publish v1.4.2 composite
.github/workflows/release.yml actions
  • actions/checkout v2 composite
  • lsegal/github-release-from-changelog-action latest composite
pyproject.toml pypi
  • numpy >=1.0
  • pyproj *
  • scipy >=0.16