Skip to content

Commit 465c91f

Browse files
authored
Merge pull request #411 from ukmda/markmac99
add setup builder for fbCollector
2 parents ca7b32f + eec3957 commit 465c91f

7 files changed

Lines changed: 140 additions & 50 deletions

File tree

.github/workflows/build_tools.yml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ jobs:
4242
- build_usermgmt
4343
steps:
4444
- name: packaging
45-
run: |
46-
echo "packaging the app now"
47-
cd usermgmt\windows\dist
48-
copy ../camera.ico .
49-
copy ../stationmaint.ini.sample .
50-
copy ../../README.md .
51-
compress-archive -path . -update -destinationpath c:\temp\ukmon_usermgmt.zip
45+
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
46+
with:
47+
path: usermgmt\windows\cam_management_setup.iss
5248
release_usermgmt:
5349
name: release usermanagement
5450
runs-on: win10
@@ -60,23 +56,23 @@ jobs:
6056
env:
6157
GITHUB_TOKEN: ${{ secrets.MM_PAT }}
6258
with:
63-
file: c:\temp\ukmon_usermgmt.zip
59+
file: e:\temp\setup_cameraMgmt.exe
6460
tags: true
6561
draft: true
6662
overwrite: true
67-
tag_name: 2025.10.1
63+
tag_name: 2025.11.1
6864
default_release_name: User Management Tool
6965
default_release_body_path: usermgmt\windows\release_notes.md
7066
cleanup_usermgmt:
71-
name: clean up temp usermanagement files
67+
name: clean up temp cameramgmt files
7268
runs-on: win10
7369
continue-on-error: true
7470
needs:
7571
- release_usermgmt
7672
steps:
77-
- name: delete temp usermgmt package
73+
- name: delete temp cameramgmt package
7874
run: |
79-
del c:\temp\ukmon_usermgmt.zip
75+
del e:\temp\setup_cameraMgmt.exe
8076
build_fbtool:
8177
name: build fbcollector
8278
runs-on: win10
@@ -88,22 +84,17 @@ jobs:
8884
conda activate fbcollector
8985
cd fbCollector
9086
pyinstaller ./fireballCollector.py --onefile --windowed --icon .\ukmda.ico
87+
markdown2 ./README.md > README.html
9188
package_fbtool:
9289
name: package fbcollector
9390
runs-on: win10
9491
needs:
9592
- build_fbtool
9693
steps:
9794
- name: packaging
98-
run: |
99-
echo "packaging the app now"
100-
cd fbCollector\dist
101-
copy ../ukmda.ico .
102-
copy ../config.ini.sample .
103-
copy ../download_events.sh .
104-
copy ../noimage.jpg .
105-
copy ../README.md .
106-
compress-archive -path . -update -destinationpath c:\temp\fbcollector.zip
95+
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
96+
with:
97+
path: .\fbCollector\fireballcollector_setup.iss
10798
release_fbtool:
10899
name: release fbcollector
109100
runs-on: win10
@@ -115,11 +106,11 @@ jobs:
115106
env:
116107
GITHUB_TOKEN: ${{ secrets.MM_PAT }}
117108
with:
118-
file: c:\temp\fbcollector.zip
109+
file: e:\temp\setup_fireballCollector.exe
119110
tags: true
120111
draft: true
121112
overwrite: true
122-
tag_name: 2025.10.1
113+
tag_name: 2025.11.1
123114
default_release_name: Tools to Gather Fireball data and Manage UKMON Cameras
124115
default_release_body_path: fbCollector\README.md
125116
cleanup_fbtool:
@@ -131,4 +122,4 @@ jobs:
131122
steps:
132123
- name: delete package
133124
run: |
134-
del c:\temp\fbcollector.zip
125+
del e:\temp\setup_fireballCollector.exe

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,3 +617,4 @@ servercopybkp/*
617617
fbcollector/config.ini
618618
usermgmt/windows/stationmaint.ini
619619
usermgmt/windows/README.md
620+
fbCollector/README.html

fbCollector/README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,52 @@ This tool allows authorised users to collect fireball data from UKMON and GMN an
66

77
* You have installed [WMPL](https://github.com/wmpg/WesternMeteorPyLib/), used to solve trajectories.
88
* You have installed [RMS](https://github.com/CroatianMeteorNetwork/RMS), used to reduce raw data.
9-
* A local folder where you will store fireball data. This is called `basedir` in this documentation.
9+
* You have a local folder where you will store fireball data. This is called `basedir` in this documentation.
1010

1111
The above are sufficient to collect data from UKMON and to analyse data either collected from UKMON or by other means. There are additional configuration options that can be used to collect data from GMN and upload solutions to UKMON. These are described inline below.
1212

1313
## Installation
14-
* Clone this repository to a location of your choice
15-
* Install WMPL and RMS, and activate the WMPL python virtual environment.
16-
* Change directory into the location of this code then install the additional requiremnts with `pip install -r requirements.txt`
17-
* Copy `config.ini.sample` to `config.ini` and update the values of `basedir`, `rms_loc`, `rms_env`, `wmpl_loc`, and `wmpl_env` as appropriate.
14+
* Install the package `setup_fireballCollector.exe` from [here](https://github.com/ukmda/ukmda-dataprocessing/releases).
15+
* Install WMPL and RMS and verify they're working.
16+
17+
## Configuring the App
18+
* Launch the app from the desktop icon or start menu. After a few seconds a text editor will appear to allow you to configure the application.
19+
* Update the values of `basedir`, `rms_loc`, `rms_env`, `wmpl_loc`, and `wmpl_env` as appropriate and save.
1820

1921
## Using the App
20-
* Launch the app by running `fbCollector.ps1` in a Powershell window. After a few seconds the GUI window should appear.
21-
* In the box labelled `Image Selection` enter a date and time in the format `YYYYMMDD_HHMMSS`, then click "Get Images".
22-
* After a few seconds, the listbox below should be populated with images from around the time you selected, provided the UKMON live feed captured something.
23-
* If nothing appears, check the UKMON [livestream](https://archive.ukmeteors.co.uk/live/index.html) to make sure you chose the correct time.
22+
* Enter a date and time in the format `YYYYMMDD_HHMMSS` into the `Image Selection` box, then click "Get Images".
23+
* After a few seconds, the listbox below should be populated with images from around the time you selected, provided the UKMON live feed captured something.
24+
* If nothing appears, check the UKMON [livestream](https://archive.ukmeteors.co.uk/live/index.html) to make sure you chose a suitable time.
2425

25-
* Go through the image list and click `Remove` to delete any that are not of the event you are interested in.
26+
* Go through the image list and click `Remove` or press the `Delete` key to delete any that are not of the event you are interested in.
2627
* Once you've whittled the list down to just the interesting events, you can select `Get ECSVs` from the `Raw` menu. This will attempt to get raw data for each image. You can also click `Get Videos` to collect any video data thats available.
28+
2729
* Now you can click `Solve` from the `Solve` menu. This will invoke WMPL and will attempt to find a trajectory that matches the raw data. It may take some time.
2830
* If the solver is successful, you can view the solution by selecting `View Solution` from the `Solve` menu. The left-hand list will now show the output of the solver so you can examine it. You can switch back to viewing the raw images by selecting `Review Images` from the `Review` menu.
31+
2932
* If the solve process fails or if the solution seems very poor then try excluding some detections. To do this, select `Excl/Incl ECSV` from the `Raw` menu then rerun the Solver.
3033
* If the solution was bad its also worth deleting it before attempting a rerun via `Delete Solution` from the `Solve` menu.
3134

3235
## Manually Reducing an Image
33-
If you've installed RMS then if you have a FITS or FR file from RMS along with the camera's config and platepar files, you can run RMS's `SkyFit2` tool to analyse the image - select and image then select `Reduce Selected Image` from the `Raw` menu.
36+
If you've installed RMS and you have a FITS or FR file from RMS along with the camera's config and platepar files, you can reduce the data using RMS's `SkyFit2` tool. Select an image in the file list then select `Reduce Selected Image` from the `Raw` menu.
3437

3538
## Sending Solutions to UKMON
36-
Once you have a solution, select `Upload orbit` from the `Solve` menu. This will create a Zip file that bundles the created trajectory pickle file with any images and videos. You can then upload the file to Dropbox, Google Drive or another file-sharing site and email a link to fireballdata@ukmeteornetwork.org where one of our team will validate and upload it to our Archive.
39+
Once you have a solution, select `Upload orbit` from the `Solve` menu. This will create a Zip file that bundles the created trajectory pickle file with any images and videos. You can then upload the file to Dropbox, Google Drive or another file-sharing site and email a link to [us](fireballdata@ukmeteornetwork.org) where one of our team will check and upload it to our Archive.
3740

3841
#### API Key
39-
Members of the UKMON team who frequently create solutions can request an API key to upload solutions less than 10 MB in size. We'll contact you if we think this is applicable.
42+
Members of the UKMON team who frequently create solutions can request an API key to directly upload solutions less than 10 MB in size. We'll contact you if we think this is applicable.
43+
44+
## Sharing Raw Data
45+
If you've configured a raw data location in the configuration file, `Share Raw Data` on the raw menu will create a zip file of all the raw data and copy it to the location. For example, if you have Dropbox installed and set the share location to a folder in your Dropbox, then the zip file will be copied there.
4046

4147
### Collecting data from GMN
42-
Members of the GMN coordinators group who have permission from Denis Vida can use this tool to collect data directly from GMN or using the GMN Watchlist. If you fall into this category you can fill in the `[gmnanalysis]` section of the config file with the name of your SSH private key and other details. This will activate additional menu options to `Get GMN Raw Data` and to use the `Watchlist`.
43-
If you're running on Windows, you will need WSL2 enabled and the rsync tool installed in WSL2.
48+
Members of the GMN Coordinators group who have permission from Denis Vida can use this tool to collect raw data directly from GMN.
49+
50+
If you fall into this category you can fill in the `[gmn]` section of the config file with the name of your SSH private key and other details. This will activate additional menu options to `Get GMN Raw Data` and to use the `Watchlist`.
51+
52+
*Note that you will need WSL2 enabled and the rsync tool installed in WSL2 to run this process.*
4453

4554
## Logs
46-
The programme creates logs in your system's `TEMP` folder.
55+
You can view the logs from the `File` menu. The logs are created in [%TEMP%/fbcollector](%temp%/fbcollector).
4756

4857

fbCollector/fireballCollector.py

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from PIL import Image
1818
import requests
1919
import pandas as pd
20+
import webbrowser
2021

2122
import paramiko
2223
from scp import SCPClient
@@ -254,7 +255,7 @@ def readConfig(self):
254255
self.gmn_key = None
255256
self.gmn_user = None
256257
self.gmn_server = None
257-
if localcfg.has_option('gmnkey','gmnkey'):
258+
if localcfg.has_option('gmn','gmnkey'):
258259
self.gmn_key = localcfg['gmn']['gmnkey']
259260
self.gmn_user = localcfg['gmn']['gmnuser']
260261
self.gmn_server = localcfg['gmn']['gmnserver']
@@ -283,7 +284,7 @@ def readConfig(self):
283284

284285

285286
self.share_loc = None
286-
if localcfg.has_option('share','shrfldr'):
287+
if localcfg.has_option('sharing','shrfldr'):
287288
self.share_loc = os.path.expanduser(localcfg['sharing']['shrfldr'].replace('$HOME','~')).replace('\\','/')
288289

289290
def quitApplication(self):
@@ -418,10 +419,13 @@ def initUI(self):
418419
otherMenu = Menu(self.menuBar, tearoff=0)
419420
otherMenu.add_command(label="Get Traj Pickle", command=self.getTrajpickle)
420421
otherMenu.add_command(label="Add Image/Vid", command=self.addImageVideo)
421-
solveMenu.add_separator()
422+
otherMenu.add_separator()
422423
otherMenu.add_command(label="Delete Orbit", command=self.delOrbit)
423424
self.menuBar.add_cascade(label="Other", underline=0, menu=otherMenu)
424425

426+
helpMenu = Menu(self.menuBar, tearoff=0)
427+
helpMenu.add_command(label="Documentation", command=self.showDocs)
428+
self.menuBar.add_cascade(label="Help", underline=0, menu=helpMenu)
425429
# buttons
426430
self.save_panel = LabelFrame(self, text=' Image Selection ')
427431
self.save_panel.grid(row = 1, columnspan = 2, sticky='WE')
@@ -437,7 +441,6 @@ def initUI(self):
437441
save_bmp = StyledButton(self.save_panel, text="Remove", width = 8, command = lambda: self.remove_image())
438442
save_bmp.grid(row = 1, column = 4)
439443

440-
441444
# Listbox
442445
self.scrollbar = Scrollbar(self)
443446
self.listbox = Listbox(self, width = 47, yscrollcommand=self.scrollbar.set, exportselection=0, activestyle = "none", bg = global_bg, fg = global_fg)
@@ -448,6 +451,9 @@ def initUI(self):
448451
self.listbox.bind('<<ListboxSelect>>', self.update_image)
449452
self.scrollbar.config(command = self.listbox.yview)
450453

454+
# bind delete key
455+
self.listbox.bind("<Delete>", lambda x: self.remove_image())
456+
451457
# IMAGE
452458
try:
453459
# Show the TV test card image on program start
@@ -470,6 +476,10 @@ def reviewConfig(self):
470476
self.readConfig()
471477
self.initUI()
472478

479+
def showDocs(self):
480+
webbrowser.open('README.html')
481+
return
482+
473483
def reduceCamera(self):
474484
current_image = self.listbox.get(ACTIVE)
475485
if current_image == '':
@@ -748,12 +758,13 @@ def archiveFolder(self):
748758
log.warning(f'unable to create archive {self.dir_path}')
749759
log.warning(e)
750760
try:
751-
os.chdir(self.fb_dir)
752761
shutil.rmtree(self.dir_path)
753762
except Exception as e:
754763
log.warning(f'unable to remove folder, please do it manually {self.dir_path}')
755764
log.warning(e)
756765
self.dir_path = self.fb_dir
766+
self.dir_path = self.fb_dir
767+
self.viewData()
757768

758769
def delFolder(self):
759770
noimgdata = img.open(noimg_file).resize((640,360))
@@ -796,6 +807,7 @@ def remove_image(self):
796807
""" Remove the selected image from disk
797808
"""
798809
current_image = self.listbox.get(ACTIVE)
810+
curr_row = self.listbox.curselection()
799811
if current_image == '':
800812
return
801813
if not tkMessageBox.askyesno("Delete file", f"delete {current_image}?"):
@@ -815,6 +827,11 @@ def remove_image(self):
815827
pass
816828
self.selected[current_image] = (0,'')
817829
self.update_listbox(self.get_bin_list())
830+
maxrows = self.listbox.index("end")
831+
curr_row = (max(min(maxrows-1, curr_row[0]),0),)
832+
self.listbox.select_set(curr_row)
833+
self.listbox.activate(curr_row)
834+
self.update_image('x')
818835

819836
def update_image(self, thing):
820837
""" When selected, load a new image
@@ -868,21 +885,33 @@ def getData(self):
868885
self.update_listbox(self.get_bin_list())
869886

870887
def getTrajpickle(self):
871-
basepatt = os.path.split(self.dir_path)[1]
872-
ymd = basepatt[:8]
888+
if self.dir_path:
889+
basepatt = os.path.split(self.dir_path)[1]
890+
else:
891+
basepatt = ''
873892
fullpatt = askstring('Trajectory Name', 'eg 20240101_010203.345_UK', initialvalue=basepatt)
874893
if not fullpatt:
875894
return
876-
trajpick = f'{basepatt}_trajectory.pickle'
895+
ymd = fullpatt[:8]
896+
trajpick = f'{fullpatt[:15]}_trajectory.pickle'
877897
url = f'https://archive.ukmeteors.co.uk/reports/{ymd[:4]}/orbits/{ymd[:6]}/{ymd}/{fullpatt}/{trajpick}'
878898
log.info(f'{url}')
899+
if self.patt is None:
900+
self.dir_path = os.path.join(self.fb_dir, fullpatt[:15])
901+
else:
902+
self.dir_path = os.path.join(self.fb_dir, self.patt)
903+
log.info(self.dir_path)
904+
os.makedirs(self.dir_path, exist_ok=True)
879905
get_response = requests.get(url, stream=True)
880906
if get_response.status_code == 200:
881907
log.info(f'retrieved {trajpick}')
882908
with open(os.path.join(self.dir_path, trajpick), 'wb') as f:
883909
for chunk in get_response.iter_content(chunk_size=4096):
884910
if chunk: # filter out keep-alive new chunks
885911
f.write(chunk)
912+
if self.patt is None:
913+
self.patt = fullpatt[:15]
914+
self.newpatt.set(self.patt)
886915
else:
887916
log.info(f'unable to retrieve {trajpick}, {get_response.status_code}')
888917
return
@@ -1040,7 +1069,6 @@ def getEventData(self):
10401069
ret = tkMessageBox.askyesno("Wait", f'Should wait till {self.evtMonTriggered.strftime("%H:%M:%S")} - continue anyway?')
10411070
if ret is False:
10421071
return
1043-
os.chdir(self.fb_dir)
10441072
log.info(f'getting data for {evtdate}')
10451073
procid = subprocess.Popen(('bash','-c', cmd))
10461074
procid.wait()
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#define MyAppName "UKMON Fireball Analyser"
2+
3+
[Setup]
4+
AppName=UKMON Fireball Analyser
5+
AppVersion="1.0.0"
6+
AppPublisher=UK Meteor Network
7+
AppPublisherURL=https://www.ukmeteornetwork.org
8+
DefaultDirName={localappdata}\programs\fbAnalyser
9+
DefaultGroupName=UKMON
10+
UninstallDisplayIcon={app}\fireballCollector.exe
11+
Compression=lzma2
12+
SolidCompression=yes
13+
OutputDir=e:\temp
14+
OutputBaseFilename=setup_fireballCollector
15+
PrivilegesRequired=lowest
16+
17+
[Files]
18+
Source: ".\dist\fireballCollector.exe"; DestDir: "{app}"
19+
Source: ".\noimage.jpg"; DestDir: "{app}"
20+
Source: ".\ukmda.ico"; DestDir: "{app}"
21+
Source: ".\download_events.sh"; DestDir: "{app}"
22+
Source: ".\config.ini.sample"; DestDir: "{app}"; Permissions: users-modify
23+
Source: ".\README.html"; DestDir: "{app}"
24+
25+
[Tasks]
26+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
27+
28+
[Icons]
29+
Name: "{group}\Fireball Analyser"; Filename: "{app}\fireballCollector.exe"; IconFilename: "{app}\ukmda.ico"
30+
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
31+
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\fireballCollector.exe"; Tasks: desktopicon; WorkingDir: {app}; IconFilename: "{app}\ukmda.ico"

fbCollector/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ scp
66
pyqtgraph
77
xmltodict
88
requests
9-
pandas
9+
pandas
10+
markdown2
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#define MyAppName "UKMON Camera Management"
2+
3+
[Setup]
4+
AppName=UKMON Camera Management
5+
AppVersion="2.0.0"
6+
AppPublisher=UK Meteor Network
7+
AppPublisherURL=https://www.ukmeteornetwork.org
8+
DefaultDirName={localappdata}\programs\cameraMgmt
9+
DefaultGroupName=UKMON
10+
UninstallDisplayIcon={app}\stationMaint2.exe
11+
Compression=lzma2
12+
SolidCompression=yes
13+
OutputDir=e:\temp
14+
OutputBaseFilename=setup_cameraMgmt
15+
PrivilegesRequired=lowest
16+
17+
[Files]
18+
Source: ".\dist\stationMaint2.exe"; DestDir: "{app}"
19+
Source: ".\camera.ico"; DestDir: "{app}"
20+
Source: ".\stationmaint.ini.sample"; DestDir: "{app}"; Permissions: users-modify
21+
Source: "..\README.md"; DestDir: "{app}"; Permissions: users-modify
22+
23+
[Tasks]
24+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
25+
26+
[Icons]
27+
Name: "{group}\Camera Management"; Filename: "{app}\stationMaint2.exe"; IconFilename: "{app}\camera.ico"
28+
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
29+
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\stationMaint2.exe"; Tasks: desktopicon; WorkingDir: {app}; IconFilename: "{app}\camera.ico"

0 commit comments

Comments
 (0)