Show UCAC4 stars in the Deep Sky Annotation

Discussions on extending SharpCap using the built in Python scripting functionality
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Show UCAC4 stars in the Deep Sky Annotation

#1

Post by Jean-Francois »

Hello,

I have now a small program for the generation of a custom star catalogue from the UCAC4 catalogue.
The UCAC4 catalogue is much too large for importing completely in the Deep Sky Annotation tool.

So I did a small script and a C-program for this.

Unzip the following file where you want.
UCAC4_SharpCap.zip
(88.85 KiB) Downloaded 23 times
The ZIP file contains the files:
UCAC4_annotation.py => SharpCap script for the IronPython console (manual start)
UCAC4_annotation_menu.py => Same SharpCap script for the menu
UCAC4_read.exe => the C-program for the UCAC4 catalogue (with my own modification for working with SharpCap)

You need the UCAC4 catalogue installed on your computer.
The original version with the "\u4b" directory with the z001 to z900 files.

When you have the files on your computer, it is necessary to modify some input in the script.
Open the script with a text editor (Notepad or similar).
UCAC4_description_1.jpg
UCAC4_description_1.jpg (24.91 KiB) Viewed 1213 times
Change the path of the UCAC4 catalogue. Note the "\\" double character (one "\" could work too, but it is safer to have it double).
If you have SharpCap version 4.0, then please modify the path in the variable "script_path".
SharpCap 4.1 and above can find automatically the location of the script.

If you want to use the "menu" version of my script, you need to insert the script in the list under:
"File" - "SharpCap Settings" - "Startup Scripts" - "Add".
After this, restart SharpCap. The menu "UAC4" will appear. in the menu

If you want use the script from the console, then open it and start it with the green arrow.

For a quick test, use the Sky Simulator camera.
Start the Deep Sky Annotation and then start the UCAC4 script.
UCAC4_description_2.jpg
UCAC4_description_2.jpg (49.03 KiB) Viewed 1213 times

Click on the button "Copy UCAC4 stars to clipboard".
UCAC4_description_3.jpg
UCAC4_description_3.jpg (12.58 KiB) Viewed 1213 times
A file with the stars in the field of the camera is generated in the following directory:
C:\Users\%USER%\AppData\Roaming\SharpCap\AnnotationCatalogs\currentroi.txt
Note: the file name could change later in *.csv when Robin finish some work on the Deep Sky Annotation tool.

Paste the stars in the Deep Sky Annotation tool by clicking the button "Paste Custom Object Info".
A new catalogue will appear "Pasted from Clipboard (xxx objects)".
UCAC4_description_4.jpg
UCAC4_description_4.jpg (20.9 KiB) Viewed 1213 times
And here the result (small region of my monitor):
UCAC4_description_5.jpg
UCAC4_description_5.jpg (138.39 KiB) Viewed 1213 times

When you move the telescope and you have a new star field, first click the button "Clear" from the Deep Sky Annotation before generating a new list of stars with my script. The "Paste Custom Object Info" does not delete the preceding list.

What I have to do next:
- set a magnitude limit
- set a maximum number limit
- solve some behaviour near the 90° declination

The actual script generates all the stars that is located in the field of view of the camera.
If you have a large detector with a short focal, then you will have several 10'000 stars.
That will be again too much for the Deep Sky Annotation tool. So the tool with the UCAC4 catalogue is for long focal telescope or small detector.

Best regards and give some feedback,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13370
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Show UCAC4 stars in the Deep Sky Annotation

#2

Post by admin »

Hi,

that's very cool - thanks for sharing!

Robin
procyon12
Posts: 255
Joined: Tue Jan 14, 2020 11:32 am

Re: Show UCAC4 stars in the Deep Sky Annotation

#3

Post by procyon12 »

Hi Jean-Francois,

Very cool indeed :o because the 4UC catalog is of high importance for occultation work.

I made a quick test under W10 and latest SC 4.1 using the Test Camera 1 with the Orion image. It worked, see a crop:

4uc_3.png
4uc_3.png (244.7 KiB) Viewed 1140 times


Cheers

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

Re: Show UCAC4 stars in the Deep Sky Annotation

#4

Post by admin »

Hi,

yesterday I added some new scripting reachable code to allow this to be further refined. In the next update, there will be a SharpCap.DeepSkyAnnotation object available via scripting with the following methods/properties

Code: Select all

    public interface IDeepSkyAnnotation
    {
        bool IsActive { get; }
        void Activate();
        void Deactivate();
        bool HasPlateSolveInfo { get; }
        void StartPlateSolveNearby();
        void StartPlateSolveGlobal();
        void PasteClipboardDataAsCustom();
        void ReloadAllCatalogs();
        void LoadTextAsCustom(string text);
    }
I did this as a quick change to make it scriptable without really changing the existing code, so things may change slightly in future when I get around to avoiding the double catalog load and also there is no way to just clear down the custom objects.

cheers,

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

Re: Show UCAC4 stars in the Deep Sky Annotation

#5

Post by Jean-Francois »

Hello Robin,

Many thanks for the future new script functions.

I understand the following functions:

IsActive : True or False, means if the Deep Sky Annotation window is visible
Activate(): show the Deep Sky Annotation tool window (for example for opening it from a script)
Deactivate(): close the D.S.A. window
HasPlateSolveInfo: True or False, True when a Plate Solve was done and the telescope does not move (too much)
False when no Plate Solve or large movement of the telescope
That is good, so I can try to reduce the number of Plate Solve (my script today performs a new Plate Solve every time).
StartPlateSolveNearby(): start Plate Solve with the last coordinates of the telescope (around to 15° ?)
StartPlateSolveGobal(): start a global Plate Solve
PasteClipboardDataAsCustom(): very nice for my script
ReloadAllCatalogs(): is that all the "selected" catalogues or all the "visible" catalogues in the directory ?
LoadTextAsCustom(): Similar as the PasteClipboardDataAsCustom, but directly from a text (string or file ?), so without the Clipboard.SetText(text).

You can add some additional functions:
- List of the available catalogues
- Is a catalogue selected ?
- Select or deselect a catalogue (from the preceding list)
- Clear the custom catalogue

The actual behaviour of the "Paste a Custom Object Info" is to add the new list to the actual list.
What will be the behaviour of the PasteClipboardDataAsCustom() and LoadTextAsCustom() ? Change the list or "add" the list.
Ideally is first to "delete" the list (if any already saved) and then "paste" the new list of objects.

For the catalogue data format ... I have a proposal to modify it a little bit.
Some catalogues have in the field "Object Types" too much different information, for example the star types (A, A0, A1 to A9, B, B0, B1 to B9, .... R0, R1 to R9). One solution is to modify the catalogue, but it will be less information.

My proposal is to have the types in two parts : IDs|Names|Type_a % Type_b|||||
In place of "%", you can have "$" or "&".

The meaning would be: "Type_a" is used for the "Object Types" list in the Deep Sky Annotation and the Select a Target (of the GOTO tool).
The "Type_b" is used for the object view on the image or in the table.
With the star example: IDs|Names|A % A3||||| or IDs|Names|M & M2|||||.
"A" or "M" would be used in the "Object Types" list. the "A3" and "M2" would be shown on the image or in the table.


I have one additional question about the view of the objects on the image.
You have some code that limits the number of the objects shown on the image, so that not too much objects are in a small area.
Is it possible to modify this ?

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

Re: Show UCAC4 stars in the Deep Sky Annotation

#6

Post by admin »

Hi Jean-Francois,

yes, your interpretation of the functions is basically correct - to clarify

ReloadAllCatalogs - this reloads all the catalog data including the built in catalogs and any custom catalogs found on disk
LoadTextAsCustom - this expects the catalog data to be in the string (not a filename), so you can avoid messing with the clipboard

You are also correct that there is code that limits the density of targets drawn on screen to avoid ending up with an unreadable mess. The current behaviour is as follows

* Always draw the selected item that is highlighted in the 'Objects in View' list
* Other items are drawn in order from brightest to dimmest, with no object drawn closer than about 60 to 80 screen pixels of a previously drawn object

If SharpCap is cutting back on what is displayed due to this check then zooming further in on the image should show more, which I think is usually sufficient.

The API so far is basically what I could easily put together in an hour or so without significantly changing the existing way that the annotation works. Anything more really requires more significant work, so will not be happening just yet. I will keep those ideas in mind though when I do get around to a proper refresh of how annotation works.

cheers,

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

Re: Show UCAC4 stars in the Deep Sky Annotation

#7

Post by Jean-Francois »

Hello Robin,

OK, thanks for the information.

Concerning the "HasPlateSolveInfo" ... that is without the information itself ? Only yes or no ?

PasteClipboardDataAsCustom() and LoadTextAsCustom() ... will be a reset (clear/delete) of the list before pasting or loading the data ?

Yes, the zooming allows to see more object labels as visible on the images:
UCAC4_description_6.jpg
UCAC4_description_6.jpg (128.89 KiB) Viewed 1063 times
UCAC4_description_7.jpg
UCAC4_description_7.jpg (143.95 KiB) Viewed 1063 times
Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13370
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Show UCAC4 stars in the Deep Sky Annotation

#8

Post by admin »

Hi Jean-Francois,

yes, the 'HasPlateSolveInfo' is just yes/no - if you want more then you can check the PixelPositionProvider which can map pixel co-ordinates to/from sky co-ordinates.

The reset is only manual, so if you paste multiple times then the in-memory catalog will grow. Assuming you are only adding a few thousands or tens of thosands of items at a time then this shouldn't be a big issue (people are using catalogs with a million items in them).

cheers,

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

Re: Show UCAC4 stars in the Deep Sky Annotation

#9

Post by Jean-Francois »

Hello,

UPDATE of my UCAC4 script.

I have now a new version of my script for the UCAC4 catalogue.
UCAC4_annotation_version_1.4.zip
(91.12 KiB) Downloaded 19 times
And a short description (with really useful information, so please read it before).
UCAC4_annotation_2024-04-14.pdf
(377.13 KiB) Downloaded 18 times
You need first to have the UCAC4 stars catalogue installed on your computer.
Note that you need the original catalogue with the 900 files (from z001 to z900 with 8.26 GB uncompressed size).

Here a real image from yesterday evening:
Occultation_with_UCAC4_4.png
Occultation_with_UCAC4_4.png (791.87 KiB) Viewed 952 times
If you tested the preliminary version, please delete the 3 files (2 *.py and the *.exe).
The 3 new files have more features.

If you have a problem, please contact me as soon as possible ... so that I can correct it rapidly.

Regards,
Jean-François
procyon12
Posts: 255
Joined: Tue Jan 14, 2020 11:32 am

Re: Show UCAC4 stars in the Deep Sky Annotation

#10

Post by procyon12 »

Hi all,

Tested with simulation (Test Camera 1 with the Orion image) - it works.

ClpBrd5_2.png
ClpBrd5_2.png (476.45 KiB) Viewed 908 times

Many thanks to Jean-Francois!

Christian
Post Reply