Metadata-Version: 2.1
Name: openhsi
Version: 0.0.5
Summary: Library to calibrate, trigger and capture data cubes for the open source hyperspectral camera.
Home-page: https://github.com/openhsi/docs/tree/master/
Author: Yiwei Mao, et al.
Author-email: yiwei.mao@sydney.edu.au
License: Creative Commons Attribution 3.0 Australia License
Keywords: Open Hyperspectral Imager
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: ximea (>="4.21.02")
Requires-Dist: numpy (>="^1.13.3")
Requires-Dist: scipy (>="^1.4.1")
Requires-Dist: matplotlib (>="^2.1.1")
Requires-Dist: astropy (>="^4.0")
Requires-Dist: minilog (>="^1.5")
Requires-Dist: fastprogress
Requires-Dist: h5py

# Open Source DIY Hyperspectral Imager Library
> Library to calibrate, trigger and capture data cubes for the open source DIY hyperspectral camera. 


<a rel="license" href="http://creativecommons.org/licenses/by/3.0/au/"><img alt="Creative Commons Licence" style="border-width:0" src="https://i.creativecommons.org/l/by/3.0/au/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/au/">Creative Commons Attribution 3.0 Australia License</a>.

Documentation can be found here: [https://openhsi.github.io/openhsi/](https://openhsi.github.io/openhsi/).

## Install

`pip install openhsi`

## Requirements

- Python 3.6+
- Ximea SDK (See https://www.ximea.com/support/wiki/apis/Python)

## How to use

### Taking a single picture

```
from openhsi.capture import *

try:
    take_show()
except:
    print('No devices found. Camera not connected.')
```

    No devices found. Camera not connected.


### Changing the Exposure and Gain

```
try:
    with OpenHSI(xbinwidth=896,xbinoffset=528,exposure_ms=1000,gain=0) as cam:
        cam.exposure    = 100
        cam.gain        = 5

        img = cam.start().get_img()
        plt.imshow(img)
        plt.xlabel('Wavelength (nm)')
        plt.ylabel('Line pixels')
        plt.show()
except:
    print('No devices found. Camera not connected.')
```

    No devices found. Camera not connected.


### Calibration

```
from openhsi.calibrate import *
result = fit_arc_lines2(arc_file = "cal_files/arc.hdf5", wave_save_file = None, skip = 1, show = True)
```

    Fit arc lines for each spatial pixel




<div>
    <style>
        /* Turns off some styling */
        progress {
            /* gets rid of default border in Firefox and Opera. */
            border: none;
            /* Needs to be in here for Safari polyfill so background images work as expected. */
            background-size: auto;
        }
        .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {
            background: #F44336;
        }
    </style>
  <progress value='0' class='' max='896' style='width:300px; height:20px; vertical-align: middle;'></progress>

</div>




![svg](docs/images/output_10_2.svg)



