Skip to content
Snippets Groups Projects
Commit 91361307 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

markdownlint fix

parent 3377ba10
No related branches found
No related tags found
1 merge request!10Pipeline
# GeoPhys ![Shear-wave velocity model in the LA area, looking north. Color scale is 100 to 1000 m/s Vs30 on the top and 100 to 5000 m/s shear-wave velocity on the sides. Vertical exageration is a factor of 10.](images/LACrossSectionVelocitySmall.png)
This set of utilities is used to extract geophysical information from the NCM (Boyd, 2020)
including, for example, S-wave, P-wave, and density profiles, as well as attributes for ground
motions models including *V*S30, *Z*1.0, and *Z*2.5. Running the code in either MATLAB or
This set of utilities is used to extract geophysical information from the NCM (Boyd, 2020)
including, for example, S-wave, P-wave, and density profiles, as well as attributes for ground
motions models including *V*S30, *Z*1.0, and *Z*2.5. Running the code in either MATLAB or
Python requires all of the NCM databases:
[GeoPhys](https://code.usgs.gov/ghsc/nshmp/ncm/GeoPhys)
* NCM_AuxData.nc (https://doi.org/10.5066/P9GO3CP8)
* NCM_AuxData.nc (<https://doi.org/10.5066/P9GO3CP8>)
[GeoFram](https://code.usgs.gov/ghsc/nshmp/ncm/GeoFram)
......@@ -21,19 +23,23 @@ Python requires all of the NCM databases:
* MineralPhysicsDatabase.nc
These codes are part of an effort to produce a three dimensional national crustal model for use with seismic hazard studies. (https://doi.org/10.5066/P9T96Q67)
These codes are part of an effort to produce a three dimensional national crustal model for use with seismic hazard studies. (<https://doi.org/10.5066/P9T96Q67>)
## Python
See the [README](geophys/README.md) file in the [geophys](geophys) directory for instructions
on installing the database and running in Python.
## Matlab
See the [README](matlab/README.md) file in the [matlab](matlab) directory for running in MATLAB.
## Help
Any questions regarding the code can be directed to olboyd@usgs.gov.
## References
*Boyd, O.S., 2020, Calibration of the U.S. Geological Survey
National Crustal Model: U.S. Geological Survey Open-File
Report 2020–1052, 23 p., https://doi.org/10.3133/ofr20201052*
Report 2020–1052, 23 p., <https://doi.org/10.3133/ofr20201052>*
# GeoPhys Python routines ![Shear-wave velocity model in the LA area, looking north. Color scale is 100 to 1000 m/s Vs30 on the top and 100 to 5000 m/s shear-wave velocity on the sides. Vertical exageration is a factor of 10.](../images/LACrossSectionVelocitySmall.png)
This set of utilities is used to extract geophysical profiles from the NCM (Boyd, 2020). Running the code requires the NCM Calibration dataset (https://doi.org/10.5066/P9GO3CP8), NCM Geologic Framework databases (https://doi.org/10.5066/P9SBQENM), NCM thermal model, NCM_TemperatureGrids.nc (https://doi.org/10.5066/P935DT1G), and the NCM Petrologic and Mineral Physics database (https://doi.org/10.5066/P9HN170G). These codes and datasets are part of an effort to produce a three dimensional national crustal model for use with seismic hazard studies. (https://doi.org/10.5066/P9T96Q67)
This set of utilities is used to extract geophysical profiles from the NCM (Boyd, 2020). Running the code requires the NCM Calibration dataset (<https://doi.org/10.5066/P9GO3CP8>), NCM Geologic Framework databases (<https://doi.org/10.5066/P9SBQENM>), NCM thermal model, NCM_TemperatureGrids.nc (<https://doi.org/10.5066/P935DT1G>), and the NCM Petrologic and Mineral Physics database (<https://doi.org/10.5066/P9HN170G>). These codes and datasets are part of an effort to produce a three dimensional national crustal model for use with seismic hazard studies. (<https://doi.org/10.5066/P9T96Q67>)
Profiles can be returned from roughly -126 degrees to -100 degrees longitude and 22 to 53 degrees latitude. If the requested location is outside of the bounds of the NCM, a message to that effect will be returned.
......@@ -9,19 +10,23 @@ Profiles can be returned from roughly -126 degrees to -100 degrees longitude and
* [Poetry](https://python-poetry.org/) Python dependency manager
### Poetry Install
See [Poetry installation](https://python-poetry.org/docs/) instructions for more.
#### osx / linux / bashonwindows install instructions
```bash
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
```
#### windows powershell install instructions
```bash
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
```
#### pip
```bash
pip install --user poetry
```
......@@ -29,22 +34,27 @@ pip install --user poetry
## Usage
### Install Dependenices
```bash
poetry install
```
### Install GeoPhys Database
The following will install the GeoPhys database only:
```bash
poetry run database --GeoPhys
```
To download all databases:
```bash
poetry run database
```
The output directory for the database can be specified using the `--output` argument:
```bash
poetry run database --output="/path/to/database"
......@@ -52,8 +62,9 @@ poetry run database --output="/path/to/database"
poetry run database --output="~/NCM_DATA"
```
The output directory can additionally be specified using the environmental variable
The output directory can additionally be specified using the environmental variable
`NCM_DATABASE_PATH`:
```bash
export NCM_DATABASE_PATH="/path/to/database"
......@@ -62,13 +73,16 @@ export NCM_DATABASE_PATH="~/NCM_DATA"
```
### Remove Database
To remove database directory:
```bash
poetry run database --clean
```
### Examples
Geophysical profile at a latitude and longitude of 36, -118 from the
Geophysical profile at a latitude and longitude of 36, -118 from the
surface to 30 m depth in increments of 1 m.
```bash
......@@ -82,6 +96,7 @@ poetry run geophys -f geophys/resources/example.Input
```
### Help
Please see or query the code for help.
```bash
......@@ -90,32 +105,39 @@ poetry run help
Any questions regarding the code and data can be directed to olboyd@usgs.gov.
# Development
## Development
### Git Hooks
The GeoPhys project contains githooks on pre-commit and pre-push that
will check the Python code format using [Black](https://github.com/psf/black),
check the import sorting using [isort](https://github.com/timothycrosley/isort), and
check the import sorting using [isort](https://github.com/timothycrosley/isort), and
lints the code using [Flake8](https://gitlab.com/pycqa/flake8).
The GitHooks are configured with:
```
```bash
poetry run setup
```
### Checking the Format
To check the format of the code against Black and isort run:
```
```bash
poetry run format_check
```
### Formatting the Code
To automatically format the code using Black and isort run:
```bash
poetry run format
```
## References
*Boyd, O.S., 2020, Calibration of the U.S. Geological Survey
National Crustal Model: U.S. Geological Survey Open-File
Report 2020–1052, 23 p., https://doi.org/10.3133/ofr20201052*
Report 2020–1052, 23 p., <https://doi.org/10.3133/ofr20201052>*
# GeoPhys MATLAB routines ![Shear-wave velocity model in the LA area, looking north. Color scale is 100 to 1000 m/s Vs30 on the top and 100 to 5000 m/s shear-wave velocity on the sides. Vertical exageration is a factor of 10.](images/LACrossSectionVelocitySmall.png)
This program is used to extract geophysical profiles from the NCM (Boyd, 2020). Running the code requires the NCM Calibration dataset (https://doi.org/10.5066/P9GO3CP8), NCM Geologic Framework databases (https://doi.org/10.5066/P9SBQENM), NCM thermal model, NCM_TemperatureGrids.nc (https://doi.org/10.5066/P935DT1G), and the NCM Petrologic and Mineral Physics database (https://doi.org/10.5066/P9HN170G). These codes and datasets are part of an effort to produce a three dimensional national crustal model for use with seismic hazard studies. (https://doi.org/10.5066/P9T96Q67)
This program is used to extract geophysical profiles from the NCM (Boyd, 2020). Running the code requires the NCM Calibration dataset (<https://doi.org/10.5066/P9GO3CP8>), NCM Geologic Framework databases (<https://doi.org/10.5066/P9SBQENM>), NCM thermal model, NCM_TemperatureGrids.nc (<https://doi.org/10.5066/P935DT1G>), and the NCM Petrologic and Mineral Physics database (<https://doi.org/10.5066/P9HN170G>). These codes and datasets are part of an effort to produce a three dimensional national crustal model for use with seismic hazard studies. (<https://doi.org/10.5066/P9T96Q67>)
Profiles can be returned from roughly -126 degrees to -100 degrees longitude and 22 to 53 degrees latitude. If the requested location is outside of the bounds of the NCM, a message to that effect will be returned.
## Installation
Within matlab, add to your path the location of the GeoPhys matlab scripts. The LoadNCMData.m script assumes that the databases (mentioned above) are installed in NCMBase/database where NCMBase is ../../(Location of LoadNCMData.m). For example, GeoPhys.m might be located in Path/NCM/GeoPhys/matlab. The database directory would then be in Path/NCM/database. LoadNCMData.m can be edited to allow for a different location of the database.
## Example
See example.m for an example.
## Help
Please see or query the code for help.
**matlab>> help GeoPhys**
......@@ -17,6 +21,7 @@ Please see or query the code for help.
Any questions regarding the code and data can be directed to olboyd@usgs.gov.
## References
*Boyd, O.S., 2020, Calibration of the U.S. Geological Survey
National Crustal Model: U.S. Geological Survey Open-File
Report 2020–1052, 23 p., https://doi.org/10.3133/ofr20201052*
Report 2020–1052, 23 p., <https://doi.org/10.3133/ofr20201052>*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment