stvid/README-jupyter.md

1.7 KiB

stvid on Jupyter

This is a Jupyter notebook conversion of process_new.py and acquire.py for didadic purposes.

The main notebook learn.ipynb does each step acquiring two FITS images, which are then processed and displayed:

  • learn.ipynb --- Acquire, display image, and process one FITS.

The following other Jupyter notebooks are available.

  • acquire.ipynb --- Acquires 10 seconds of FITS. Works.
  • hacquire.ipynb --- Hakcy version, may show live view someday.
  • process_new.ipynb --- Processes one FITS file, as shown below.

Install

Set up stvid as usual.

Install jupyterlab and deps:

# Enter top repo dir
cd stvid/
source env/bin/activate
pip install -r requirements-jupyter.txt

Setup

Copy the one FITS file, you want processed to:

stvid/data/obs/jupyter/jupyter.fits

Copy over your config_new.ini and tweak to suit:

cp -p config_new.ini config_jupyter.ini

Copy over TLEs you may have used:

cp -p data/tle/*.tle data/obs/jupyter/

Run thine Jupyter

# Enter top repo dir
cd stvid/
jupyer lab

Use thine Jupyter

Go to the URL given when you run jupyter lab above, something like https://127.0.0.1.....

If you are running the acquire.py or similar on a remote device such as a Pi or Odroid, you can create a tunnel to easily access Jupyter remotely, without having to muck with Jupyter config:

ssh -N -C -L 8888:localhost:8888 odroid-n2

Then you can use the URL given, ala:

http://127.0.0.1:8888/lab?token=000000000001111111111111112222222222223333333344

Python Conversion.

I used this to convert Python to Jupyter:

pip install p2j
p2j foo.py

License

Same as upstream license, GPLv3.

© 2022, Jeff Moe