Skip to content

Commit

Permalink
Merge pull request #3 from noaa-ocs-modeling/develop
Browse files Browse the repository at this point in the history
update README.md and examples
  • Loading branch information
zacharyburnett authored Mar 9, 2021
2 parents b45a5bc + 36ac0c4 commit 9bbd66f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 9 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,35 @@
[![style](https://sourceforge.net/p/oitnb/code/ci/default/tree/_doc/_static/oitnb.svg?format=raw)](https://sourceforge.net/p/oitnb/code)

parses seabed descriptions from https://www.ngdc.noaa.gov/geosamples/surveydisplay.jsp

## Usage

#### retrieve a list of surveys from the NGBC web page

```python
from seabed import NGDCSeabedDescriptions

surveys = NGDCSeabedDescriptions.all_surveys()
```

#### get seabed descriptions for specific surveys, within specified bounds

```python
import numpy

from seabed import NGDCSeabedDescriptions

# define bounds
bounds = numpy.array([[-77, 39], [-75, 40]])

# retrieve a list of the first 5 surveys
first_5_surveys = NGDCSeabedDescriptions.all_surveys()[:5]

# intialize a Seabed Description object with specific surveys and bounds
seabed_descriptions = NGDCSeabedDescriptions(surveys=first_5_surveys, bounds=bounds)

print(f'surveys: {seabed_descriptions.surveys}')
print(f'bounds: {seabed_descriptions.bounds}')
print(f'descriptions: {seabed_descriptions.descriptions}')
print(f'data: {seabed_descriptions.data}')
```
11 changes: 6 additions & 5 deletions examples/descriptions_within_bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
# retrieve a list of the first 5 surveys
first_5_surveys = NGDCSeabedDescriptions.all_surveys()[:5]

# get surveys within specific bounds
seabed_object = NGDCSeabedDescriptions(surveys=first_5_surveys, bounds=bounds)
surveys_within_bounds = seabed_object.surveys
# intialize a Seabed Description object with specific surveys and bounds
seabed_descriptions = NGDCSeabedDescriptions(surveys=first_5_surveys, bounds=bounds)

print(f'all surveys: {first_5_surveys}')
print(f'surveys within transformed bounds: {surveys_within_bounds}')
print(f'surveys: {seabed_descriptions.surveys}')
print(f'bounds: {seabed_descriptions.bounds}')
print(f'descriptions: {seabed_descriptions.descriptions}')
print(f'data: {seabed_descriptions.data}')
9 changes: 5 additions & 4 deletions examples/descriptions_within_transformed_bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
# retrieve a list of the first 5 surveys
first_5_surveys = NGDCSeabedDescriptions.all_surveys()[:5]

# get surveys within specific bounds
# intialize a Seabed Description object with specific surveys and bounds
seabed_object = NGDCSeabedDescriptions(surveys=first_5_surveys, bounds=transformed_bounds, crs=transformed_crs)
surveys_within_bounds = seabed_object.surveys

print(f'all surveys: {first_5_surveys}')
print(f'surveys within transformed bounds: {surveys_within_bounds}')
print(f'surveys: {seabed_object.surveys}')
print(f'bounds: {seabed_object.bounds}')
print(f'descriptions: {seabed_object.descriptions}')
print(f'data: {seabed_object.data}')
1 change: 1 addition & 0 deletions seabed/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .ngdc import NGDCSeabedDescriptions

0 comments on commit 9bbd66f

Please sign in to comment.