Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbetchkal/nmsim-python
A Python-based wrapper for Noise Model Simulation (NMSIM). Eases the creation of input files and joining data from GIS databases.
https://github.com/dbetchkal/nmsim-python
acoustics aircraft-noise gis noise noise-model sound-propagation sound-propagation-modeling
Last synced: about 2 months ago
JSON representation
A Python-based wrapper for Noise Model Simulation (NMSIM). Eases the creation of input files and joining data from GIS databases.
- Host: GitHub
- URL: https://github.com/dbetchkal/nmsim-python
- Owner: dbetchkal
- License: gpl-2.0
- Created: 2020-11-06T18:20:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T19:00:13.000Z (9 months ago)
- Last Synced: 2024-07-30T18:45:31.176Z (5 months ago)
- Topics: acoustics, aircraft-noise, gis, noise, noise-model, sound-propagation, sound-propagation-modeling
- Language: Jupyter Notebook
- Homepage:
- Size: 28.7 MB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NMSIM-Python
A Python-based wrapper for Noise Model Simulation (NMSIM). Eases the creation of input files and joining data from GIS databases. Improves overall flexibility of the tool for diverse applications.- [Purpose](##Purpose)
- [Files Associated With NMSIM](##Files-Associated-With-NMSIM)
- [User-Provided Inputs](###User-Provided-Inputs)
- [Intermediary Inputs](###Intermediary-Inputs-[as-facilitated-by-this-library)
- [Outputs](###Outputs)
- [Site-Based Paradigm Example](##Site-Based-Paradigm-Example)
- [1. Initialize an NMSIM project from study area](###1-initialize)
- [2. Create a site file (.sit) from metadata](###2-receiver)
- [3. Create flight trajectory (.trj) from the overflights database](###3-path)
- [4. Compile model to create site-specific analysis (.tis)](###4-putting-it-all-together)
- [5. Review the results by comparing to acoustic measurements](###5-comparing-theory-to-obs)
- [Public domain](##public-domain)## Purpose
>*“The Purpose of a System is What it Does.”*
>-- Stafford Beer, 2001This repository provides a scripting toolkit for the development of acoustic propagation models with [Noise Model Simulation (NMSIM) software](https://www.blueridgeresearch.com/noise-models). At the request of the National Park Service, NMSIM was updated in 2014 to use the [Nord2000 propagation algorithm](https://forcetechnology.com/en/innovation/completed-projects/nord2000-noise-calculation-method-auralisation), *"an advanced ray-tracing noise model that includes refraction by the atmosphere and diffraction around terrain."* The primary purpose of `NMSIM-Python` is to sidestep NMSIM's arcane Graphical User Interface (GUI) while continuing to leverage Nord2000's extensive functionality, [standardization](https://www.iso.org/standard/20649.html), speed, and physical accuracy.
The eventual goal of `NMSIM-Python` is to provide an overarching `NMSIM` class corresponding to the **Control File** (see Figure 1, *.nms*) which describes the parameters for an acoustic propagation model scenario. In this vision, a `NMSIM` object allows the user to gracefully implement inter-related modelling scenarios. By modifying input parameters, users can generate a specific sequence of acoustic propagation predictions. Such a tool enables the user to iterate over whichever dimension(s) of a civic problem are in question (e.g., properties of the noise source, trajectory, receiver location, etc.). Such focus could greatly expedite mitigation work, ground-truthing or experiments in perception.
For now, though, this repository exists only as:
>**(1)** a set of loosely-connected python modules
>**(2)** a few select `Jupyter` notebooks
>**(3)** an `arcpy` toolbox meant for use with ArcGIS ProYou can think of `NMSIM-Python` as an “exploded view” of the modelling process, with functions to actualize each *input*, *intermediary*, or *output* filetype used by the software (Figure 1). Current design favors scripters working in a project-driven, maximally-flexible environment. The `Jupyter` notebooks demonstrate this style of flexible use *[note: they are only truly functional for National Park Service employees due to data-sharing issues. Please contact me if you would like to try them - I can figure out how to send you the appropriate data.]* For a rich example of `NMSIM-Python` in use, see [Kirby Heck's work with `DENA-overflights`](https://github.com/dbetchkal/DENA-overflights).
*Figure 1.) An "exploded view" the NMSIM modelling process as an information flow graph. The fundamental architecture is colored in blue. Useful output types are colored in amber, their respective raw NMSIM outputs in yellow, and input or intermediary file types in beige. Jupyter notebooks are green. Arcpy toolboxes are red.*The second purpose of `NMSIM-Python` is to promote records retention for models used in planning or compliance processes. Ideally, public models are publicly available alongside the documents that implement them. Thus, `NMSIM-Python` aims to support the storage of model objects for future reuse (i.e., as a `pickle` or other filetype).
Note: `NMSIM-Python` is a library in active development and therefore should be considered an unstable tool. For the same reason it would greatly benefit from the contributions of open-source programmers. It could also benefit from curious physicists/geographers/ecologists who have an interest in software testing and application. True batching (i.e., flexible compilation of batch files) should also be implemented, but currently isn’t. Batching isn’t purposeful for models containing sequences of isolated events, but as soon as overlapping events feature in a simulation batching *is required.* However, a batching routine would subsume the `NMSIM` Class, so writing it will have to wait until the class is available first!
---
## Files Associated With NMSIM
NMSIM models represent three coupled systems:
>**(1)** the **landscape and atmosphere** which
>**(2)** **noise sources** move over/through
>**(3)** apprehended by **the ear** that hears: be in animal, human, or metalConsidering the [multiphysics](https://en.wikipedia.org/wiki/Multiphysics) involved -- and the RAM-limited era in which NMSIM was originally developed -- there are lots of files required to operate the software. This section attempts to provide a brief list of every file type shown in Figure 1. Such knowledge is key to scripting in `NMSIM-Python` as well as understanding limitations of the toolkit.
### User-Provided Inputs
- **NPS Unit Information**: the 4-letter alpha code for the park unit in question can provide a quick reference for looking up larger rasters. It also provides a handy lookup for administrative metadata used in automatic labelling/titles/filenames.
- **Site metadata**: microphone/observer coordinates (WGS84), microphone/observer height (meters).
- **Study Area polygon** (*.shp*) usually rectangular, but can be any shape.
- **Sound source data** represented in the form of one-to-many sound hemispheres (.avg) and their operational metadata (.src) mapped along a control [read: ‘power’] parameter.
- **Elevation rasters** (16-bit *.tif*) large regional-scale rasters clipped to within 20 km of park boundaries.
- ~~**Impedance raster** (16-bit .tif)~~ *not implemented!*
- *OPTIONAL* **GPS points** for creation of flight (or ground) trajectories. The alternative is to use NMSIM’s built-in `FlightTrackBuilder.exe` module, which is geometrically arcane (and therefore extremely tedious.)
### Intermediary Inputs [as facilitated by this library]
- **Standardized project directory** (or a blank project directory).
- **Focused elevation raster** (*.flt*, but also importantly *.tif*) clipped from wider extent. The grid float file (*.flt*) will be ingested by NMSIM. The geotiff raster (*.tif*) is used in scenarios where external GPS data or other covariates are included in the model. Regardless, it is always created for mapping convenience.
- ~~**Focused impedance raster** (.flt)~~ *not implemented!*
- **Trajectory** [read: ‘source positions'] (*.trj*) which can be from a previously-constructed file or generated from GPS coordinates + elevation raster.
- **Site file** [read: ‘receiver’] (*.sit*) microphone/observer position from coordinates and height.
- **Source files** [read: ‘source’ acoustic properties] (*.avg*, *.src*) hemispherical spectral sources and their associated metadata. NOTE: ISN'T SHOWN ON FIGURE 1.
- **Control file** (*.nms*) which integrates all NMSIM inputs.
- **Batch file** (*.txt*) which allows the model to be run from the Command Line Interface (CLI) program.
- *OPTIONAL* **Weather file** (*.wea*) overrides the standard weather parameters prescribed by [ISO 9613-2:1996](https://www.iso.org/standard/20649.html) which is useful for studying inversions, wind shear, turbulence or other atmospheric effects.### Outputs
- **Site-based Model** [read: 3D spectrogram representation] (*.tis*) resulting from control file. One use of these data could be time-aligning model spectrograms with GPS data or acoustic measurements. Further description is outside of the scope of this README, but site-based models provide a much-needed recourse for the validation of field studies or compliance efforts.- **Grid-based Model** [read: 4D spectral raster representation] (*.tig*) resulting from control file. Reducing the dimensionality of the 4D spectral raster into a 2D metric raster is required for mapping (or basically any) purpose. Dimensionality reduction is identical to summarizing any one-third octave band acoustic time-series record with a simpler metric.
---
## Site-Based Paradigm Example
The following section demonstrates use of `NMSIM-Python` to model within a site-based paradigm. In this example there is a single receiver which 'observes' the acoustic morphology of a propeller aircraft as it transits the landscape along a specific trajectory. The model results in a spectrogram (i.e., 2D representation of sound in time and frequency).
*Figure 2.) NMSIM modelling via a site-based paradigm. Like Figure 1, the process is represented as an information flow graph. User-based inputs are shown as green arrows on the left margin. These lead to intermediary inputs, which are finally organized together into the fundamental NMSIM Control File for this model. In turn, the Control File is referenced by the Batch File, which is ultimately used by NMSIM.*### 1. Initialize an NMSIM project from study area
```
```
### 2. Create a site file (.sit) from metadata
### 3. Create flight trajectory (.trj) from the overflights database
### 4. Compile model to create site-specific analysis (.tis)
### 5. Review the results by comparing to acoustic measurements---
## Public domain
This project is in the worldwide [public domain](LICENSE.md). As stated in [CONTRIBUTING](CONTRIBUTING.md):
> This project is in the public domain within the United States,
> and copyright and related rights in the work worldwide are waived through the
> [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/).
>
> All contributions to this project will be released under the CC0 dedication.
> By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.