Git Product home page Git Product logo

archive-ds9-uri's Introduction

archive-ds9-uri

Open Archive API frames in DS9

Screencast.from.2023-03-31.15-19-29.webm

What is this?

DS9 is de-facto the tool of choice to view FITS files.

The LCO Science Archive provides a web UI and API to browse & download FITS files generated by our observatory.

What's missing is a quick & easy way of "linking" images from the Archive into DS9.

This application provides that functionality.

It does this by registring itself as a handler for archive+ds9:// URLs with your Operating System. These links encode which FITS files to download & open in DS9. Whenever your OS encounters these links it asks this application to handle them.

Install

Pre-built packages are attached to every Release.

macOS

Download the .dmg file and install it.

You might have to add an exception to get it to open https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac

NOTE: The DS9 installer for MacOS does not add the ds9 command-line executable to a standard path like /usr/local/bin. To get around that, please configure the archive-ds9-uri to use the ds9 executable located inside of the application package:

  1. Launch archive-ds9-uri
  2. Navigate to the preferences pane
  3. Under Preferences->DS9->Executable, click the folder to update the location of your DS9 executable. A finder window will open.
  4. Type Command+Shift+g, a dialog will open allowing you to specify a path to the ds9 executable. Begin typing /Applications/SAOImageDS9.app/Contents/MacOS/ds9. (Note for different versions of DS9 this path may be slightly different)
  5. Select the ds9 executable that appears
  6. Save preferences
Screencast.from.2023-03-30.11-36-37.webm

Linux

Download the .flatpak file and install it using:

flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak --user install *.flatpak

Windows

Download the Setup.exe file and install it.

Note: If you're having problems launching DS9, try installing the latest version of DS9 from https://sites.google.com/cfa.harvard.edu/saoimageds9/download. 8.4.1 is known to work.

Develop

Use devenv to setup the dev environment:

devenv shell

Run the app in dev mode:

yarn start

In development mode any changes to files in src/renderer/* automatically propogate out.

Changes to the Main process (src/main/*) requires a manual restart of the Node process. If you type rs + Enter in the terminal running yarn start, it should restart faster than exiting the process and restarting it manually.

Build distribution artifacts (via electron-forge):

yarn make

Install application using built flatpak (on Linux):

flatpak --user install out/make/flatpak/x86_64/*.flatpak

Windows (on Linux via Wine)

To build distribution artifacts for Windows, use:

yarn make -p win32 -a x64

archive-ds9-uri's People

Contributors

jashan-lco avatar mgdaily avatar dependabot[bot] avatar

Watchers

Mark Bowman avatar Steve Foale avatar Brian Haworth avatar  avatar

archive-ds9-uri's Issues

Feature: Save frames to a consistent paths

Currently, every "launch" (i.e. user opens a URI) frames are downloaded to a unique folder. This means the frames are downloaded again, even if the same frames were opened before. This is not a problem, and in-fact the desired behavior when clean-up is enabled, but when clean-up is disabled this leads to lots of duplicates on the file-system. There's also an expectation by the user these files would not be downloaded again.

So, instead of saving the files to a randomly generated folder like {download-dir}/{uuid}/{frame-id}.fits, save them to a consistent path like {download-dir}/{archive-api-host}/{frame-id}/{frame-version}. In addition, only download the file if one does not already exist. And when downloading, save to a temp location first and then move to the final path to avoid partially downloaded files.

Feature: Retry intermittent network errors

Currently if there are any network errors, the whole task to download frames errors out. This should be changed so that we individually retry downloading the failed frame individually and then bubble up the error to fail the whole task.

Tokens in the URL

Putting the token in the URL is security disaster waiting to happen. Someone could accidentally share the "link" thinking it's safe and end up leaking access to their account.

I see two options:

  • Rather than sending the token in the URL, have users manually set it in the Preferences. Downside is this yet another manual step and that's annoying.
  • Add the option to generate & authenticate with the archive-api using short-lived (~mins) JWTs. And include these tokens in the link. Downside is this is more work & makes the links ephemeral. Users can still leak access to their account for a short-period of time.

Feature: Add a way to setup preferences using a URI

Allow user preferences to be sourced from a URI and saved. E.g. archive+ds9://preferences?archiveApiUrl=xxx&token=xxxx.

With #21 removing the ability to set the token in the URI, users have to manually set that up. It would be better UX if users could simply click a link from the ArchiveAPI UI and set all of this up automatically. This would be a one time step, that could be shown to the user in their Profile card on the ArchiveAPI UI.

In addition, the URI to open frames should be changed to archive+ds9://open?frameIds=1,2,3,4. That is, open should be prepended to the URI, frame_ids should be renamed to frameIds, and frame_url & token should be removed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.