Skip to content

feat: scripted downloads page - #313

Open
alexgoff wants to merge 3 commits into
developfrom
am-download-page
Open

alexgoff wants to merge 3 commits into
developfrom
am-download-page

Conversation

@alexgoff

@alexgoff alexgoff commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

There's been some interest in the potential for scripted downloads. It may be out of scope for the Skyviewer since it is a public tool, and not designed for scientific output, but nonetheless here is a proof-of-concept of how it could work:

  • A new page called "export" has been created with 4 possible filetypes: jpg/jpeg, png, and webp
  • A headless component called ImageExport waits on all layers to load, then starts an interval that checks Aladin's WebAssembly renderer to see if it has completed rendering.
  • If rendering is done (there's not a documented API for when tiles are done loading, see the note below) then the Aladin image export is started
  • Once this is done, you could close the window or do whatever is most useful to scripted users

The isRendering method corresponds to if Web Assembly is currently rendering tiles, but not necessarily if the download queue is empty. It can go from true to false to true again if tiles finish but more are still in the queue. There is not another interface that I have found for any sort of status on the web assembly download queue. This might be something that CDS could verify exists, or expose if it doesn't. Either way, test on a slow connection to see if the download waits til the tiles complete their load.

An alternative method would be using the Performance Observer API to watch for resource calls initiated by img elements (the HTML canvas for aladin-lite is considered an img by performance observers) and wait til those have completed. Accessing Aladin's list of promises is possibly easier though.

Issue open with CDS to determine if there is a way to detect all tiles are downloaded and rendered: cds-astro/aladin-lite#313

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant