• No results found

Python widgets for astronomy visualization

N/A
N/A
Protected

Academic year: 2021

Share "Python widgets for astronomy visualization"

Copied!
55
0
0

Loading.... (view fulltext now)

Full text

(1)

Python widgets

for astronomy

visualization

David Shupe (Caltech/IPAC) Scientist, LSST and ZTF

on behalf of the LSST

Science User Interface & Tools team

(2)

Astronomy in 2020+

Context: LSST Science Platform

Too much data to download -> Remote workspaces

LSST LSST Stack

DAX and Compu3ng Infrastructure Firefly

Query/Visualize: xyz Analyze: xyz

Data: xyz

Data: xyz

LSST LSST Stack

Data Access, Database and Compu6ng Infrastructure Firefly

(3)
(4)

Python widgets for astronomy visualization

• The Firefly visualization system

(5)

Python widgets for astronomy visualization

• The Firefly visualization system

(6)

Python widgets for astronomy visualization

• The Firefly visualization system

• APIs to Firefly

(7)

Python widgets for astronomy visualization

• The Firefly visualization system

• APIs to Firefly

• Example: Python interaction with the Firefly app • Firefly widgets for Jupyter

(8)

Python widgets for astronomy visualization

• The Firefly visualization system

• APIs to Firefly

• Example: Python interaction with the Firefly app • Firefly widgets for Jupyter

(9)

Python widgets for astronomy visualization

• The Firefly visualization system

• APIs to Firefly

• Example: Python interaction with the Firefly app • Firefly widgets for Jupyter

(10)

Archive Access System

Firefly

(11)

Archive Access System

Firefly

Pipeline

Database

Disk/Tape

Store

(12)

Archive Access System

Firefly

Pipeline

Database

Disk/Tape

Store

Search

Retrieval

System

Workspace

(13)

Archive Access System

Firefly

Pipeline

Database

Disk/Tape

Store

Search

Retrieval

System

Workspace

Firefly

Server

Firefly

Web

Client

(14)

Table Display

FITS Image

Viewer

(15)

Table Display

FITS Image

Viewer

WCS Readout

Zoom

Flip/ Rotate/ Crop

Color / Stretch Grid Region Magnifier Distance tools Markers Fits Headers Crop

XY Plot / Histogram

(16)

Table Display

FITS Image

Viewer

WCS Readout

Zoom

Flip/ Rotate/ Crop

Color / Stretch Grid Region Magnifier Distance tools Markers Fits Headers Crop Sort / Filter Column Controls

Supports large tables, 1O Million+ rows

Very fast response time

(17)

Table Display

FITS Image

Viewer

WCS Readout

Zoom

Flip/ Rotate/ Crop

Color / Stretch Grid Region Magnifier Distance tools Markers Fits Headers Crop Sort / Filter Column Controls

Supports large tables, 1O Million+ rows

Very fast response time

Interactive

Column math

Zoom

Filter

(18)

Many Faces

of Firefly

(19)

Catalog Search

Planck

WISE

Spitzer

IRSA Viewer

Finder Chart

Herschel

Many Faces

of Firefly

(20)
(21)

Using Firefly

• Servers

• Application at Infrared Science Archive

http://irsa.ipac.caltech.edu/irsaviewer

• Standalone Firefly

(22)

Using Firefly

• Servers

• Application at Infrared Science Archive

http://irsa.ipac.caltech.edu/irsaviewer

• Standalone Firefly

Download a single file, deploy using only Java 8

• Programmatic interfaces • Javascript

• Python with Firefly the single-page application • Widgets for Jupyter notebook / JupyterLab

(23)

Python widgets for astronomy visualization

• The Firefly visualization system

• APIs to Firefly • Javascript

• Python: firefly_client

• Example: Python interaction with the Firefly app • Firefly widgets for Jupyter

(24)

Contemporar y JavaScript framework

External and internal actions are enabled

Actions Reducers Store View Dispatch Subscribe Actions dispatched from outside Actions monitored by the outside Control Response

(25)

Javascript API falls out naturally

• Dispatch actions to make a change

var action= firefly.action; • To change color:  action.dispatchColorChange({plotId:’myplot’, 
 cbarId:5}); • Zooming an image: action.dispatchZoom({plotId:’myplot’, 
 userZoomType:’UP’ });
 action.dispatchZoom({plotId:’myplot’,
 userZoomType:’LEVEL’,level: zlevel, 
 forceDelay: true });

(26)

Documentation for Javascript API

(27)

Python API tracks Javascript closely

firefly_client is a thin layer over Javascript API

• Pip-installable

• Dispatch actions, add listeners (callbacks) • Image display for a local Firefly server:

import firefly_client
 fc = firefly_client.FireflyClient(‘localhost:8080’)
 fval = fc.upload_file(‘myfile.fits’)
 fc.show_fits(fval)

(28)

Python widgets for astronomy visualization

• The Firefly visualization system

• APIs to Firefly

• Example: Python interaction with the Firefly app • Firefly widgets for Jupyter

(29)

Setup with Jupyter notebook

Forced photometry with LSST stack

• Define function for

forced photometry for (ra, dec, filter)

• Callback listens for row

selection and point events

• Extension added to

Firefly to enable this button in point

(30)

Add-on from Python: photometry on click

(31)

Add-on from Python: photometry on click

(32)

Table of results is returned to the browser

(33)

Table of results is returned to the browser

(34)

Python widgets for astronomy visualization

• The Firefly visualization system

• APIs to Firefly

• Example: Python interaction with the Firefly app • Firefly widgets for Jupyter

(35)

Eventful Python objects that have a representation in the browser

What are widgets?

(36)

Eventful Python objects that have a representation in the browser

What are widgets?

(37)

Eventful Python objects that have a representation in the browser

What are widgets?

(38)

Eventful Python objects that have a representation in the browser

What are widgets?

(39)

Firefly Widgets

• Available as

firefly_widgets

• Interactive widgets for

Images and Tables

• Widgets currently just past

experimental state

(40)

Firefly Widgets

• Available as

firefly_widgets

• Interactive widgets for

Images and Tables

• Widgets currently just past

experimental state

(41)

Interactive Table Widget

(42)

Interactive Table Widget

(43)

Synchronize widget properties with other widgets

(44)

Synchronize widget properties with other widgets

(45)
(46)

Lessons learned from widget development

• Use the cookiecutter template for Jupyter widgets • incorporates best practices for packaging

(47)

Lessons learned from widget development

• Use the cookiecutter template for Jupyter widgets • incorporates best practices for packaging

• makes installation straightforward • Development is light on Python side,

(48)

Lessons learned from widget development

• Use the cookiecutter template for Jupyter widgets • incorporates best practices for packaging

• makes installation straightforward • Development is light on Python side,

heavy on Javascript

• Only some actions are good candidates for widget attributes • If action is done on the client — can change quickly

(49)

Python widgets for astronomy visualization

• The Firefly visualization system

• APIs to Firefly

• Example: Python interaction with the Firefly app • Firefly widgets for Jupyter

(50)
(51)

Resources for Firefly

(52)

Resources for Firefly

• Instructional videos at IRSA IPAC channel on YouTube • Source code repositories with example notebooks

(53)

Resources for Firefly

• Instructional videos at IRSA IPAC channel on YouTube • Source code repositories with example notebooks

firefly, firefly_client, firefly_widgets

(54)

Resources for Firefly

• Instructional videos at IRSA IPAC channel on YouTube • Source code repositories with example notebooks

firefly, firefly_client, firefly_widgets

• Documentation for Javascript and Python APIs

(55)

Resources for Firefly

• Instructional videos at IRSA IPAC channel on YouTube • Source code repositories with example notebooks

firefly, firefly_client, firefly_widgets

• Documentation for Javascript and Python APIs

• Demo videos made for the Large Synoptic Survey telescope • See blog post at astropython.wordpress.com for links

References

Related documents

youtube channel more functional experience, hiding related video widget rely on delete recommended videos on youtube on computer almost always is everywhere, attach statements

The Village School Cate Theron 1st Runner-up Nimitz HS Vanessa Arellano Winner SMALL CLASS: Alvin HS Mia Aguilar 5th Runner-up Ball HS Haylie Wisner 4th Runner-up Alvin HS Carli

Professor Muhanna has published numerous articles in scholarly journals, including Management Science, MIS Quarterly, Strategic Management Journal, Decision Sciences, the Journal

If initially only long-run potential output was accepted (according to the natural growth rate), its medium and short-run levels have been subsequently admitted; for example, as

After extracting the content, design with web page source example code the online presence that site builder software development did some html page content and vue.. Shapely is

The business intelligence capabilities of SalesPharma gives YOUR COMPANY the ability to have a bird’s eye view of sales and marketing operations at the segment level

The channel was focused on such short videos before the Shorts format launched on YouTube, but they have blown up majorly now and their older videos are also racking