Skip to content

Commit

Permalink
Sat Feb 24 16:03:10 MST 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Buscombe committed Feb 24, 2018
1 parent f82ebe6 commit cffc932
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 13 deletions.
57 changes: 47 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,49 @@ Bed observation data from Patricia Bay are digitized from data presented in: B.~

Bed observation data from Portsmouth (NEWBEX) are digitized from data presented in: T.~Weber, L.~and Ward. Observations of backscatter from sand and gravel seafloors between 170 and 250 kHz. Journal of the Acoustical Society of America, vol.~138, no.~4, pp.~2169 - 2180, 2015.

CRF subfunctions using the pydensecrf wrapper (https://github.com/lucasb-eyer/pydensecrf)
CRF subfunctions using the [pydensecrf wrapper](https://github.com/lucasb-eyer/pydensecrf)

## Setup

### Installing in a conda virtual env (recommended)

PriSM is designed for use with Python 3

Windows:

```
conda create --name prism_test python=3
activate prism_test
pip install numpy Cython
pip install Cython
conda install gdal rasterio shapely fiona -y
```

![win1](https://user-images.githubusercontent.com/3596509/36634602-3abda3d4-1964-11e8-9a17-970e296c807f.png)

![win2](https://user-images.githubusercontent.com/3596509/36635357-9c4b57b6-1970-11e8-88bf-272674b43222.png)

```
pip install git+https://github.com/dbuscombe-usgs/prism.git
```

![win3](https://user-images.githubusercontent.com/3596509/36634628-a567d768-1964-11e8-8d19-3e8aba9b6f03.png)

If you get an error that looks like this:

![win4](https://user-images.githubusercontent.com/3596509/36635710-3d589a64-1977-11e8-8981-632dbd40f06a.png)


it means you need to install a C++ compiler. Go to this site: http://landinghub.visualstudio.com/visual-cpp-build-tools

and download the Visual C++ Build Tools 2015. Install using the 'default' setting. It takes about 5-10 minutes to install

![win_c++](https://user-images.githubusercontent.com/3596509/36635941-4b1bfd82-197a-11e8-85d4-c85b698886ea.png)

Run the PriSM installation again and it should work:

![win5](https://user-images.githubusercontent.com/3596509/36634775-12aacffe-1967-11e8-98d0-f1b6a7732d37.png)


Linux:

```
Expand All @@ -49,14 +77,6 @@ Linux:
source deactivate
```

If you get gdal/osgeo/ogr/os errors, install GDAL (Windows only)::
1. Go to: https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
2. Download the appropriate file (for example, python 3.6, 64 bit = GDAL‑2.2.3‑cp36‑cp36m‑win32.whl )
3. install using pip:

```
pip install GDAL‑2.2.3‑cp36‑cp36m‑win32.whl
```

### Installing as a library accessible outside of virtual env

Expand Down Expand Up @@ -103,6 +123,10 @@ Then run the test ::
python -c "import prism; prism.test.dotest()"
```

![win6](https://user-images.githubusercontent.com/3596509/36634778-1683d2ec-1967-11e8-9d9e-13cd52029a99.png)

![win7](https://user-images.githubusercontent.com/3596509/36635231-da48e2c4-196e-11e8-985c-aaa0d62d95c5.png)

### Using the GUI

run the GUI ::
Expand All @@ -111,6 +135,19 @@ run the GUI ::
python -c "import prism; prism.gui_funcs.gui()"
```

![win8](https://user-images.githubusercontent.com/3596509/36635719-76f30246-1977-11e8-9cae-d2f9caf8c4fd.png)


or alternatively from within the python console like so:

![win9](https://user-images.githubusercontent.com/3596509/36635727-9184bf82-1977-11e8-82fd-ed8b9304aa5f.png)


## More info

Download the [user manual](https://daniel-buscombe.squarespace.com/s/prism_manual.pdf)


## Using prism within python scripts

A full worked example using the NEWBEX data set
Expand Down
Binary file removed doc/prism_manual.docx
Binary file not shown.
Binary file removed doc/prism_manual.pdf
Binary file not shown.
Empty file removed outputs/outputs_go_here.txt
Empty file.
13 changes: 10 additions & 3 deletions prism/gui_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,6 @@ def _plot_gmm_crf(self):
this function ...
"""
if hasattr(self, 'y_pred_gmm') and hasattr(self, 'y_pred_crf'):

in1 = self.y_pred_gmm.copy()
#in1[self.mask] = np.nan

Expand All @@ -842,7 +841,11 @@ def _plot_gmm_crf(self):
in4 = self.y_prob_crf.copy()
#in4[self.mask] = np.nan

plot_gmm_crf(self.mask, in1, in2, in3, in4, self.bs, self.bed, self.cmap, self.prefix.get())
if hasattr(self, 'cmap'):
plot_gmm_crf(self.mask, in1, in2, in3, in4, self.bs, self.bed, self.cmap, self.prefix.get())
else:
self.cmap = _get_cmap(self)
plot_gmm_crf(self.mask, in1, in2, in3, in4, self.bs, self.bed, self.cmap, self.prefix.get())

self.plot2a_btn.configure(fg='#d64161', background="white")

Expand Down Expand Up @@ -872,7 +875,11 @@ def _plot_gmm_crf_images(self):
in4 = self.y_prob_crf.copy()
#in4[self.mask] = np.nan

plot_gmm_crf_images(self.mask, in1, in2, in3, in4, self.bs, self.bed, self.cmap, self.prefix.get())
if hasattr(self, 'cmap'):
plot_gmm_crf_images(self.mask, in1, in2, in3, in4, self.bs, self.bed, self.cmap, self.prefix.get())
else:
self.cmap = _get_cmap(self)
plot_gmm_crf_images(self.mask, in1, in2, in3, in4, self.bs, self.bed, self.cmap, self.prefix.get())

self.plot4a_btn.configure(fg='#d64161', background="white")

Expand Down

0 comments on commit cffc932

Please sign in to comment.