Skip to content

Commit

Permalink
Merge pull request #94 from CroatianMeteorNetwork/master
Browse files Browse the repository at this point in the history
merge in from CMN
  • Loading branch information
markmac99 committed Apr 26, 2024
2 parents e76920a + 0e12907 commit 4896cea
Show file tree
Hide file tree
Showing 7 changed files with 873 additions and 14 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,34 @@ You will probably need some cables and connectors to connect your camera to the

---------

The code was designed to run on a RPi, but it will also run an some Linux distributions. We have tested it on Linux Mint 18 and Ubuntu 16.
The code was designed to run on a RPi, but it will also run an some Linux distributions. We have tested it on Linux Mint 20 and Ubuntu 20 and 22.

The recording **will not** run on Windows, but most of other submodules will (astrometric calibration, viewing the data, manual reduction, etc.). The problem under Windows is that for some reason the logging module object cannot be pickled when parallelized by the multiprocessing library. **We weren't able to solve this issue, but we invite people to try to take a stab at it.**


Here we provide installation instructions for the RPi, but the procedure should be the same for any Debian-based Linux distribution: [LINK](https://docs.google.com/document/d/19ImeNqBTD1ml2iisp5y7CjDrRV33wBeF9rtx3mIVjh4/edit)
Here we provide installation instructions for the RPi, but the procedure should be the same for any Debian-based Linux distribution: [LINK](https://docs.google.com/document/d/e/2PACX-1vTh_CtwxKu3_vxB6YpEoctLpsn5-v677qJgWsYi6gEr_QKacrfrfIz4lFM1l-CZO86t1HwFfk3P5Nb6/pub#h.399xr1c3jau2)

Alternatively, if you are using Anaconda Python on your Linux PC, you can install all libraries except OpenCV by running:

```
conda create --name rms python=3.9
conda activate rms
conda install -y numpy scipy gitpython cython matplotlib
conda install -y -c conda-forge Pillow pyqtgraph'<=0.12.1'
conda install -y -c anaconda ephem
conda install -y -c conda-forge ephem
conda install -y -c conda-forge imageio pandas
conda install -y -c conda-forge pygobject
conda install -y -c astropy astropy
conda install -y pyqt
pip install rawpy
pip install git+https://github.com/matejak/imreg_dft@master#egg=imreg_dft
```

To install OpenCV, use the ```opencv4_install.sh``` script. This will build OpenCV with gstreamer and ffmpeg support.
If you want to use the machine for capture, you need to install OpenCV using the ```opencv4_install.sh``` script. This will build OpenCV with gstreamer and ffmpeg support. If you are not planning to run the capture but you are planning to use other RMS tool, you can install opencv using conda:

```
conda install -c conda-forge opencv
```


## Setting up
Expand Down
24 changes: 19 additions & 5 deletions RMS/Formats/FrameInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,16 @@ def loadChunk(self, first_frame=None, read_nframes=None):
self.cache[file_name] = self.ff

return ff


def setCurrentFF(self, ff_name):
""" Set the current FF file. """

if ff_name in self.ff_list:
self.current_ff_index = self.ff_list.index(ff_name)

# Load the chunk
self.loadChunk()

@property
def current_ff_file(self):
Expand Down Expand Up @@ -709,15 +718,20 @@ def __init__(self, dir_path, config, beginning_time=None, detection=False):

if beginning_time is None:

# Try reading the beginning time of the video from the name if time is not given
try:
# Try reading the beginning time of the video from the name if time is not given
self.beginning_datetime = datetime.datetime.strptime(file_name_noext, "%Y%m%d_%H%M%S.%f")

except ValueError:

except:
messagebox(title="Input error", \
message="The time of the beginning cannot be read from the file name! Either change the name of the file to be in the YYYYMMDD_hhmmss format, or specify the beginning time using command line options.")
try:
self.beginning_datetime = datetime.datetime.strptime(file_name_noext, "%Y%m%d_%H%M%S")

sys.exit()
except:
messagebox(title="Input error", \
message="The time of the beginning cannot be read from the file name! Either change the name of the file to be in the YYYYMMDD_hhmmss format, or specify the beginning time using command line options.")

sys.exit()

else:
self.beginning_datetime = beginning_time
Expand Down
8 changes: 8 additions & 0 deletions Scripts/MultiCamLinux/RMS-screen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
if [[ -d /home/${USER}/source/Stations ]]
then
for Dir in /home/${USER}/source/Stations/*
do screen -dmS $(basename $Dir) /home/${USER}/source/RMS/Scripts/MultiCamLinux/StartCapture.sh $(basename $Dir)
echo "Launched and detached station $(basename $Dir)"
done
fi
1 change: 1 addition & 0 deletions Scripts/RMS_Update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ source ~/vRMS/bin/activate
if sudo -n true 2>/dev/null; then
sudo apt-get update
sudo apt-get install -y gobject-introspection libgirepository1.0-dev
sudo apt-get install -y gstreamer1.0-libav gstreamer1.0-plugins-bad
else
echo "sudo requires a password. Please run this script as a user with passwordless sudo access."
fi
Expand Down
Loading

0 comments on commit 4896cea

Please sign in to comment.