New post
1

URL scheme support

Please add URL scheme support to Sky Safari on the Mac. For example

skysafari://view?ra=...&dec=...&fov=...
To have it display the sky at the given coordinates with the given field of view, all in degrees.

This would allow other applications on the Mac to smoothly work with Sky Safari.

I believe adding this would be relatively easy, e.g. by adding this to applicationWillFinishLaunching:

[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL];

implementing handleURLEvent:, and adding something like this to the info.plist:

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.simulationcurriculum.SkySafari</string>
<key>CFBundleURLSchemes</key>
<array>
<string>skysafari</string>
</array>
</dict>
</array>

15 comments

  • 0
    Avatar
    Bill Tschumy

    We already do something like this with the iOS app.   A url like:

    skyobject://<object name>

    will find and center on the object <object name>.

    Coincidentally, I was just yesterday adding a custom URL to the Mac version for a different purpose. I could add the "skyobject" scheme to Mac as well.

    Do you think RA/Dec is really better than specifying an object?

  • 1
    Avatar
    Sander Berents

    RA/Dec/fov is the most important one, but ideally you would add both.

    I am the author of Observatory. With a URL scheme for RA/Dec/fov, I will add a menu item for it so you can for example look at an image in Observatory, and with one click see the corresponding area in the sky with Sky Safari.

    Hence the wish for RA/Dec/fov support. Later enhancements could be for example the ability to also pass one or two rectangles & angle (both in degrees), to display a camera fov overlay in Sky Safari. And possibly an angle to rotate Sky Safari's view. The skyobject URL scheme I might be able to support at one point as well (e.g. using the tags feature in Observatory).

    The above could be a start of many more, e.g. adding targets to observing lists, slew a telescope, etc, but that's for later. I think it would be great to have the macOS astronomy applications work together.

  • 0
    Avatar
    Bill Tschumy

    OK, I'll look into adding this.

  • 0
    Avatar
    Sander Berents

    Thanks Bill!

  • 0
    Avatar
    Bill Tschumy

    What epoch do you want to specify the coordinates in?  Do you care if FOV is in degrees or minutes (or radians)?

  • 0
    Avatar
    Sander Berents

    It is best to have a parameter for that, with a default of your choice. For consistency, I believe FOV should also be in degrees (float/double, like ra/dec).

  • 0
    Avatar
    Bill Tschumy

    I have implemented this.  To keep life simple (for me) I've decided you must specify J2000 coordinates.

    the url scheme is: skysafari://ra_dec_fov/ra/dec/fov

    where ra & dec is in J2000 coords.  Using decimal coords is preferred although you can specify things like "2h 30m 2s" if you want (although you will need to %-escape the spaces).

    the fov is in decimal degrees.

    The literal string "ra_dec_fov" is an argument saying how to interpret the arguments following it.

    This will be in SkySafari 6.0.2 for Mac

  • 0
    Avatar
    Sander Berents

    Cool! I'll add support for it in Observatory 1.2.4, depending on when SkySafari 6.0.2 is released.

     

    Will it work in all three versions of SkySafari 6?

  • 0
    Avatar
    Bill Tschumy

    Yes, it should work on all three versions.

  • 0
    Avatar
    Sander Berents

    Hi Bill,

    Thanks for the SkySafari 6.0.2 update. I tried the URL scheme handling and like it! Here a few observations:

    1. It turns out RA is expected in hour angles. No problem.
    2. If SkySafari is not running already when using the ra_dec_fov scheme, it is launched automatically (great!), but it will then crash right away.
    3. It doesn't do anything if another object has been centered with the center command. One has to move away (even a little bit) from a centered object, and then it will work.
    4. The RA/Dec given in the URL will not end up in the center of the Sky Chart. I see cases where it's 0.5-1 degrees off, which is beyond the FOV typically passed in the URL. I suspect it is not expecting J2000 coordinates, but J2018 coordinates (today). The accuracy seems to depend on what coordinate system has been selected in SkySafari. I found that when an object is centered with the center command, and one switches between the different coordinate systems, it remains centered. But for an object that is not explicitly centered, but just visually centered in the Sky Chart, selecting different coordinate systems will make it move around. For example, M76 should be nearly in the center here (J2000), but it isn't, and it moves around depending on the selected coordinate system: skysafari://ra_dec_fov/1.7048/51.5703/0.3019

    It sure is a great new feature, and the upcoming update of Observatory will support it. Hopefully you will be able to address the issues I found. Thanks again!

  • 0
    Avatar
    Bill Tschumy

    I will look at these issues.  I am a bit surprised because I did test #2, #3 and #4 and did not see any of those problems.  

    What macOS are you running on?

  • 0
    Avatar
    Sander Berents

    10.13.4.

    Note that when I explicitly set the epoch to J2000 in SkySafari's Precession settings, instead of "Use Current Epoch" (which is the default), then M76 in this example is in the center, and changing the coordinate system doesn't seem to move it out of the center. #2 and #3 still happen when the epoch is explicitly set though. Please use J2000 as the default for the UR scheme, or include an option for it.

  • 0
    Avatar
    Bill Tschumy

    I will have to talk to the person that wrote the low-level code that handles this.  I do explicitly set the coordinate system to J2000 before using your coordinates.  Not sure why it isn't having the correct effect.  Stay tuned.

  • 0
    Avatar
    Bill Tschumy

    I have fixed the issues.  We are planning on having another release in a week or two.

  • 0
    Avatar
    Sander Berents

    Great! Thanks Bill

Please sign in to leave a comment.