Helpful IronPython libraries

Discussions on extending SharpCap using the built in Python scripting functionality
User avatar
admin
Site Admin
Posts: 5018
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Helpful IronPython libraries

Post by admin » Wed Oct 07, 2020 6:18 pm

Hi Keith,

Yes, you should be able to achieve this – certainly in SharpCap 3.3 where the following code should point the way

Code: Select all

from time import sleep
def framehandler(sender, args):
	args.Frame.Info.ExtendedFrameData.AdditionalInfo.Add("TEST","cheese")
	
	
SharpCap.SelectedCamera.FrameCaptured += framehandler
sleep(10)
SharpCap.SelectedCamera.FrameCaptured -= framehandler
Basically the code in framehandler gets called as every frame is grabbed from the camera and you can add additional information that will get written into the FITS headers. The code at the end just activates that the 10 seconds and then deactivates it again. The Frame.Info object also has an ExposureMs property that you can read to get the exposure of the frame (this ends up in the EXPTIME header).

Robin

Butterbelly
Posts: 33
Joined: Tue Feb 14, 2017 7:53 pm

Re: Helpful IronPython libraries

Post by Butterbelly » Thu Oct 08, 2020 4:17 pm

Thanks for reply Robin

I will digest and get back with any further questions - there are a couple straight off the bat but
will ponder :-) so as not to pester you as I imagine you are busy.

cheers Keith

Butterbelly
Posts: 33
Joined: Tue Feb 14, 2017 7:53 pm

Re: Helpful IronPython libraries

Post by Butterbelly » Tue Oct 13, 2020 7:19 pm

Hi Robin
I have sorted out the FITS header entries and think it will work well - i intend to create an equivalent to the snapshot button which will take a snapshot with the fits header extras taken care of - I'm hoping to use the FX Frame Stack (3) assuming the snapshot will take that stacked image!?!? can you confirm - if not I can work round

My next issue is the WCS data from a plate solve which needs also to be in the FITS header - I can do this in Astroimagej and other software but it would be very convenient to have a one shop solution and include it in the script used above for fits headers.

I see there is a solution already been discussed

****************************************************************************************************************************************
* Plate solver viewtopic.php?f=14&t=1993

*
Hi,
There is no direct command to carry out plate solving from the scripting API, but it should be relatively simple to invoke the command line plate solving application in the same way that SharpCap does.
If you run the plate solving from SharpCap by pressing the UI button and then go and look in the log you will see the commandline parameters that are used for the plates solving to give you a starting point. The results of the plate solving procedure can be found in the output of the command line solving tool. Once you have those you should be able to synchronise the mount using this scripting

SharpCap.Mounts.SelectedMount.SyncTo(ra,dec)

****************************************************************************************************************************************
however I see no way to get this WCS data provided by the plate solving into the fits header or am I missing something and is this included in the statement "The results of the plate solving procedure can be found in the output of the command line solving tool."
I imagine a similar approach to the other headers could be taken if I had access to the WCS data
Any thoughts or suggestions on this

many thanks and hope I'm making sense
Keith

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

Re: Helpful IronPython libraries

Post by admin » Wed Oct 14, 2020 6:09 pm

Hi Keith,

the brightening of the image made by the frame stack effects in the FX drop-down only apply to the image has viewed on-screen – they don't change the saved image.

I think you can work around the plate solving issue – you change your setup so that after plate solving SharpCap only synchronises the mount (this is in the plate solving settings page), then read the RA and Dec coordinates back from the mount after the plate solving operation has set them to the correct value.

Cheers, Robin

Post Reply