Script for occultation observation

astrocalina
Posts: 37
Joined: Thu Jul 18, 2024 8:17 am

Re: Script for occultation observation

#21

Post by astrocalina »

Hello,
my previous post wasn't very clear:
  • the GS Server works if I open it and I click on "Connect"
    when I open SharpCap and I connect the camera: GS Server starts
    a couple a weeks ago the connection status changed automatically
    now when I connect the Camera the GS Servers starts but it doesn't connect automatically, this will create a lot of issues: first of all the sequencer will be very very slow (i.e GoToHome, pointing some stars or other)
What do you thing? If I want to change to SynScanPro how should I configure it? (I've read the doc but I didn't understood how to configure with sharpcap)
Thank you so much
Jean-Francois
Posts: 822
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Script for occultation observation

#22

Post by Jean-Francois »

Hello,

On my desktop computer with the simulator of GSS ...

You have 2 methods to connect the mount with SharpCap.
Each method without any software started.

A)
- start GSS and connect to the mount
- with GSS unpark or search home if necessary
- start SharpCap
- open a camera
- if the material connection is set automatically, then the mount should be connected (and maybe other hardware)
- if not, then click on the "Scope Controls" button for connecting the mount
- at the end, if you disconnect the camera, GSS software stays open and you can park the mount, then close GSS


B)
- start SharpCap
- open a camera with SharpCap
- if the material connection is set automatically, then the mount should be connected (and maybe other hardware)
- if not, then click on the "Scope Controls" button for connecting the mount
=> in both cases, the GSS software starts automatically in the background
- do your observation
- at the end, when you close the camera, GSS software will close automatically (so you need to park the mount if necessary before closing the camera)


I think that the best is case A).
You have the control on the mount before the connection from SharpCap and you have control after the use with SharpCap.

Try with the GSS simulator before connecting with the mount.
Have a look in the SharpCap settings for automatic connection of the hardware.

Good luck and have a nice day,
Jean-Francois
astrocalina
Posts: 37
Joined: Thu Jul 18, 2024 8:17 am

Re: Script for occultation observation

#23

Post by astrocalina »

Hello,
finally I've tested the script but after the capture I receive this error: "Starting error processing on : Exception of type 'IndexOutOfRangeException' : index out of range: 5"
Debug 22:00:45.565332 #1 Notification (Status=OK): Capture Stopped - Captured : 60 frames (0 dropped) in 0:04:00 at 0.2 fps -> C:\Users\utente\Desktop\SharpCap Captures\2025-03-02\2025-03-02T20-58-45Z_(7952)-1992-XB_UCAC4-477-043806\21_56_47\2025-03-02T20-58-45Z_(7952)-1992-XB_UCAC4-477-043806_00060.fits in void SharpCap.UI.NotificationViewModel.DisplayMessage(NotificationMessage message)
Warning 22:00:45.655282 #1 Winforms Application Thread exception event recevied for System.IndexOutOfRangeException: index out of range: 5
at IronPython.Runtime.Operations.PythonOps.FixIndex(Int32 v, Int32 len)
at IronPython.Runtime.Operations.StringOps.GetItem(String s, Int32 index)
at IronPython.Runtime.Binding.PythonGetIndexBinder.StringIndex(CallSite site, Object target, Object index)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at IronPython.Compiler.PythonCallTargets.OriginalCallTarget2(PythonFunction function, Object arg0, Object arg1)
at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at ShowUTC_Time$247(Closure, PythonFunction, Object, Object, Object)
at CallSite.Target(Closure, CallSite, Object, Object, EventArgs)
at _Scripting_(Object[], Object, EventArgs)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam) in void SharpCap.BugReporting.ApplicationOnThreadException(object sender, ThreadExceptionEventArgs e)
Warning 22:00:45.679589 #1 Starting error processing on : Exception of type 'IndexOutOfRangeException' : index out of range: 5
Stack Trace: at int IronPython.Runtime.Operations.PythonOps.FixIndex(int v, int len)
at string IronPython.Runtime.Operations.StringOps.GetItem(string s, int index)
at object IronPython.Runtime.Binding.PythonGetIndexBinder.StringIndex(CallSite site, object target, object index)
at TRet System.Dynamic.UpdateDelegates.UpdateAndExecute2<T0, T1, TRet>(CallSite site, T0 arg0, T1 arg1)
at int Microsoft.Scripting.Interpreter.DynamicInstruction<T0, T1, TRet>.Run(InterpretedFrame frame)
at void Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at TRet Microsoft.Scripting.Interpreter.LightLambda.Run3<T0, T1, T2, TRet>(T0 arg0, T1 arg1, T2 arg2)
at object IronPython.Compiler.PythonCallTargets.OriginalCallTarget2(PythonFunction function, object arg0, object arg1)
at object IronPython.Runtime.Method+MethodBinding<T0>.SelfTarget(CallSite site, CodeContext context, object target, T0 arg0)
at TRet System.Dynamic.UpdateDelegates.UpdateAndExecute3<T0, T1, T2, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2)
at object ShowUTC_Time$247(Closure, PythonFunction, object, object, object)
at object CallSite.Target(Closure, CallSite, object, object, EventArgs)
at void _Scripting_(object[], object, EventArgs)
at void System.Windows.Forms.Timer+TimerNativeWindow.WndProc(ref Message m)
at LRESULT System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam) in bool SharpCap.BugReporting.ShouldReportException(Exception exception)
Info 22:00:45.686751 #1 Considering if the error needs to be reported : System.IndexOutOfRangeException("index out of range: 5") in bool SharpCap.BugReporting.WorkOutIfWeShouldReport(Exception exception)
Warning 22:00:45.705170 #1 Scripting exception caught at top level. : Exception of type 'IndexOutOfRangeException' : index out of range: 5 () in bool SharpCap.BugReporting.ShouldReportImpl(Exception exception)
Info 22:00:45.717856 #1 Loading translation resources from C:\Program Files\SharpCap 4.1 (64 bit)\LanguageFiles\UI_it.MessageBoxWindow.json in Dictionary<string, string> SharpCap.UI.JsonCategoryProvider.Load(string context)
Info 22:00:47.052118 #28 Display frame rate reduced to 1.00 (max 30) due to UI thread load level of 100.0% in void SharpCap.Base.FrameLimiter.IntermittentLogRate()
Info 22:01:19.050307 #28 Display frame rate reduced to 1.00 (max 30) due to UI thread load level of 100.0% in void SharpCap.Base.FrameLimiter.IntermittentLogRate()
Info 22:01:46.497727 #1 MessageBox : 'Scripting Error Detected' It looks like an error occurred that may have been caused by one of your SharpCap python scripts.

The error was : index out of range: 5.
Something wrong on my configuration or something can I solve it?
Thanks
Jean-Francois
Posts: 822
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Script for occultation observation

#24

Post by Jean-Francois »

Hello,

Not nice to have an error at the end of a capture.

But ... I will say BUT ... do you practice before doing a real occultation ?
I said several time ... "practice with the Sky Simulator before doing an observation ..."

OK, the error message is ... we say in Germany "für die Katze" ... means not meaningful.

But I can see some points:
- you saved the capture in FITS images. That is not ideal to have thousand of files. A SER or better an ADV film would be better.
- is the file name too long ?
- IndexOutOfRangeException is typically an error with an index in a loop or a table
- 4 minutes with 60 images ... that is 4s exposure ... what are you observing ?
- "The error was : index out of range: 5" ... but where ? Why the error message does not mention the line in the script that produces the error ?


Do you use my last script (version 1.5.3) ?
I do not save in FITS, I can do a quick test with the FITS with this last version.
I know last year I corrected a bug for the FITS saving. Maybe one bug is still present.

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

Re: Script for occultation observation

#25

Post by Jean-Francois »

Hello Astrocalina,

I tested my scripts with saving of FITS files.
It is working without error.

Please send me your event file (SODIS template) that you test.

Regards,
Jean-Francois
joanbdunham
Posts: 14
Joined: Sat May 09, 2020 4:23 pm

Re: Script for occultation observation

#26

Post by joanbdunham »

Hi -
A script for the QHY 174 to observe occultations! Wow!
Is this generally available? If so, where?
I am in the USA and we do not (yet) use SODIS. Is that a problem when using your script?
I see earlier in the topic a script for calibration. I thought this became automatic some time ago and separate calibration was no longer necessary. Am I wrong?
Thank you
Joan Dunham
Jean-Francois
Posts: 822
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Script for occultation observation

#27

Post by Jean-Francois »

Hello Joan,

Yes, the script for the occultation exists for several years now and it is generally available.
I updated it step by step. It has now some useful and interesting functions.

You can find here a collection of my scripts viewtopic.php?t=8182
Note that is for all programmer, but until today, it is only my scripts.

The occultation "page" for the script is here. viewtopic.php?t=8492
For the discussion, please continue to use this actual topic.

I have 3 scripts that are useful for the occultation. One shows the UCAC4 stars in the Deep Sky Annotation tool of SharpCap.
The other is for the user of the QHY174GPS camera. It does a precise automatic calibration of the internal LED.
The third script is the script for the occultation observation. All these scripts can be used manually from the IronPython console or integrated in SharpCap.

Concerning the LED calibration of the QHY174GPS camera ... yes, SharpCap sets the begin and end time of the LED automatically.
Most of the time it work fine. In some cases, it is a little off. You can test it and later decide to use or not use it.

Concerning SODIS ... I have an additional small DLL program ... that is for OccultWatcher (desktop), where you can generate an observation file from OccultWatcher with the SODIS template. The idea is that my script write some information in the SODIS template (begin, end of the capture and the weather condition), so that you can use the same file one time again for the report in OccultWatcher and SODIS.
The file does not need to be really a SODIS file. You can use something different as long as the correct tags are in the file. (see the PDF for more detailed information).

Some months ago, I mentioned the use of the USA template in my script ... but absolutely no response.

I add few weeks ago a new function in my script, but not upload it ... it can now save automatically the field area with the annotations.
So it is very easy to find the target for the processing some days or months later.
I can do the update on the forum this weekend.

Please do some practice before a real observation. With an event in few days, you can prepare it and change the date/time manually around the time you want to test it. You can repeat this step several times. Alternative, you can use the ASCOM Sky Simulator during the day.

Best regards,
Jean-Francois
Post Reply