Script for occultation observation

Jean-Francois
Posts: 825
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Script for occultation observation

#1

Post by Jean-Francois »

Hello,

Here a short preview of the future SharpCap script (and OccultWatcher Addin).
Addin_OccultWatcher.SC_report.pdf
(868.1 KiB) Downloaded 374 times
It should simplify the preparation of an observation.
An event file is generated from OccultWatcher and then import in SharpCap.

I'm still programming the "capture" part, but you can see in the PDF the actual status of my codes.

Please send me your comments and ideas (if it is not too complicated to add, I will add it if it simplify the preparation and the capture of the occultation events). One "new" idea I have is to add a "voice" in my script. I found how to do.

Part OccultWatcher Addin:
The Addin is finished ... but it needs an small update of OccultWatcher.
I have a beta version from Hristo. It will be necessary to wait until this new version of OccultWatcher is released.

Part SharpCap scripts:
First I write the codes of the script for the future version 4.1 (some changes in ASCOM).
The beta 4.1 version is working properly, but it is still not an official released version.
I updated my LED_Calibration script that can be started in the new "Occultation" script.

Robin, I code a "night vision", but is it possible to "transfer" the SharpCap night vision to the script window ?

Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 17365
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Script for occultation observation

#2

Post by admin »

Hi Jean-Francois,

that looks very interesting - great to see this sort of thing :)

Not quite sure about the night mode for the scripting window - the main part of the scripting window should take on night mode colours (does in my testing). Unfortunately the title bar stays in system colours. This is the hardest part of the window to change, particularly because the console is a separate library that I pull into SharpCap, so I cannot easily use the solution for the problem that I use for the rest of the SharpCap windows.

cheers,

Robin
Jean-Francois
Posts: 825
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Script for occultation observation

#3

Post by Jean-Francois »

Hello Robin,

The IronPython Console (window) changes to the Nigh vision when the main window of SharpCap changes to the Night Vision (with F12 or from the menu). That is "nice" for the people that want to code during a night session.

I was asking if it is possible the have the Night Vision in a Windows Form generated by the script, also what my script shows.
If it is possible to use one class of SharpCap with the view in the Night mode.

And yes the title bar is not easy to change. I try to find how to change the tabs too.

Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 17365
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Script for occultation observation

#4

Post by admin »

Hi Jean-Francois,

ah, I get it now.

Unfortunately all of SharpCap's night mode is based on WPF (Windows Presentation Framework) as a UI technology, not Windows Forms - actually one of the reasons I made the change was because it made the night mode much easier and also more complete (for instance scroll bars cannot really have their colours changed in Windows Forms, but can in WPF).

You can however discover if SharpCap is in night mode (SharpCap.NightModeControl.Enabled), and you can then set the foreground and background of your windows forms window using the 'BackColor' and 'ForeColor' properties (ie Black background, DarkOrange foreground to roughly match SharpCap). Some other controls on the form (buttons, etc) may also need their colours setting.

Hope this helps,

Robin
Jean-Francois
Posts: 825
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Script for occultation observation

#5

Post by Jean-Francois »

Hello Robin,

OK, WPF not Windows Forms.

I already use the "SharpCap.NightModeControl.Enabled" in my script.
But it is not complete ... the tabs and the upper title bar stay in white/grey.

Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 17365
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Script for occultation observation

#6

Post by admin »

Hi,

yes, that's the problem with Windows Forms - much harder to change the colour of some things without rewriting the whole thing from scratch. WPF does give you the ability to re-theme moderately easily. Unfortunately, writing WPF in python is probably close to impossible sadly :(

cheers,

Robin
Jean-Francois
Posts: 825
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Script for occultation observation

#7

Post by Jean-Francois »

Hello occultation observers,

I have now a new version of my script.
Occultation_Addin_SharpCap_script_2023-07-02.zip
(849.7 KiB) Downloaded 346 times
What can you do with my script ?
- From OccultWatcher for a future event ... export a file with all the information of the event
- In SharpCap ... import the file with the information and you can do the following things
- GOTO to the star coordinates
- Plate Solve and centre to the star coordinates
- With the QHY-174GPS camera: perform the LED calibration
- Prefill the weather condition in the SODIS template
- Start a test capture (for checking if the images transfer is stable)
- Start the countdown and start automatically the capture of the film at a predefined time before the expected event time

The ZIP file contains a PDF with a lot of explanation ... please read it before doing something with the script (really, read it).

If at the beginning you do not want use the automatic start of the film ... it is OK.
You can use the script for the preparation (GOTO, Plate Solve, LED calibration). The film capture can be done manually.

But before using my script with a real occultation ... please use it with several test events.
You can do the following, for a future event (some days before the event), you can use the file after changing the date (and or time) from the tags
#StarRA, #StarDEC, #PredictTime, #EventDate, #EventTime (scroll down to the end of the file).
Yes, if the future event is at 3 O'clock in the morning ... you can change the time for 22 O'clock.



In addition for the QHY-174GPS camera LED calibration ... you can install the "menu" version of the LED calibration script.
The same script is used with the "Occultation" script.
Calibration_LED_2023-04-27_menu_41.zip
(4.51 KiB) Downloaded 327 times
Occultation_SC_32.png
Occultation_SC_32.png (28.47 KiB) Viewed 12422 times
Regards,
Jean-Francois
User avatar
vichman
Posts: 50
Joined: Mon Jun 18, 2018 7:05 am

Re: Script for occultation observation

#8

Post by vichman »

Hello Jean-Francois,

thank you very much for your Occultation script for SharpCap, unfortunately I have big trouble using it.
I am using SharpCap in its latest version (V 4.1.12281) on Windows 10.

There are two errors that I encounter:

1.)
When I try to use the LED Calibration function with my QHY174M-GPS, the LED goes on and off, but then there is an error message, the Script freezes and SharpCap crashes.
The error message is in the log file attached, maybe you can have a look?
Error LED.log
(79.01 KiB) Downloaded 137 times

2.)
When I try to use the GoTo feature (after importing the TXT file from OccultWatcher), there is also an error message (the mount is connected in SharpCap) and SharpCap freezes. I have to kill SharpCap from the Task Manager.
The error message is in the log file attached, maybe you can also have a look?
Goto.log
(103.97 KiB) Downloaded 144 times

On idea in addition: Is it possible to modify the OccultWatcher plugin, so that it fills the text file already with the necessary data for SODIS, i.e. take the observer name, location etc. from OccultWatcher?

Thanks a lot in advance!
Stefan
User avatar
admin
Site Admin
Posts: 17365
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Script for occultation observation

#9

Post by admin »

Hi,

just to give an explanation of the two logs...

The first is a mismatch between the OxyPlot graph plotting code in SharpCap (newer version) and the script, which is expecting an older version I think. I think Jean Francois may be working on (or even have written) an updated version for this change.

The second is due to the mount thinking that the target is below the horizon, so it raises an error when the GOTO is requested.

cheers,

Robin
User avatar
vichman
Posts: 50
Joined: Mon Jun 18, 2018 7:05 am

Re: Script for occultation observation

#10

Post by vichman »

Hi Robin,

thanks for the explanation.
Then I will eagerly await an update of the script. :D

As for the second error: Understood that the mount cannot slew if the object is below the horizon, but then it would be good if SharpCap would not freeze.
I do not know if this is a problem of SC or of the script, though (or of the mount’s driver).

Thanks
Stefan
Post Reply