Firefly Sessions¶
The LSST table and image visualiser for astronomical data exploration
🎯 What You'll Learn
- How to launch a Firefly session and choose the right version
- How to load images, tables, and access CANFAR storage
- How to perform catalogue overlays, plotting, and cutouts
- Performance tips for large surveys and troubleshooting guidance
Firefly is a powerful web-based visualisation tool originally developed for the Rubin Observatory LSST. It provides advanced capabilities for viewing images, overlaying catalogues, and analysing tabular data - making it perfect for survey data analysis and multi-wavelength astronomy.
🎯 What is Firefly?¶
Firefly offers specialised tools for:
- Image visualisation with advanced stretch and colour controls
- Catalogue overlay and source analysis tools
- Table viewer with filtering, plotting, and statistical tools
- Multi-wavelength data comparison and analysis
- Large survey datasets like LSST, HSC, and WISE
Key Features¶
Feature | Capability |
---|---|
Image Display | FITS images with WCS support, multiple panels |
Catalogue Overlay | Plot sources on images, interactive selection |
Table Analysis | Sort, filter, plot columns, statistical analysis |
Multi-band | RGB colour composites, band switching |
Cutout Services | Extract subimages from large surveys |
Coordinate Systems | Support for all standard astronomical coordinates |
🚀 Launching Firefly¶
Step 1: Create New Session¶
- Login to the CANFAR Science Portal
- Click the plus sign (+) to create a new session
- Select
firefly
as your session type
Step 2: Choose Container¶
The container selection updates automatically after choosing the session type. Select the Firefly container version you need:
Available Versions¶
- firefly:latest - Most recent stable version (recommended)
- firefly:X.X - Specific version for reproducible analysis
Version Selection
Use the latest version unless you need a specific version for reproducibility. The latest version includes performance improvements and new features.
Step 3: Configure Session¶
Session Name¶
Choose a descriptive name that helps identify your work:
Good session names:
- lsst-photometry
- hsc-catalogue-analysis
- multiband-survey
- gaia-cross-match
Memory Requirements¶
If using a fixed resource session, select RAM based on your data size:
- 8GB: Small catalogues, single images
- 16GB: Default, suitable for most work
- 32GB: Large catalogues, multiple images
- 64GB: Very large survey datasets
Memory Planning
Large tables and multi-image layouts benefit from 32GB+ RAM. Start with 8GB and scale up if needed.
CPU Cores¶
Most Firefly work is I/O bound rather than CPU intensive:
- 2 cores: Default, sufficient for most visualisation tasks
- 4 cores: Large table operations, complex filtering
Step 4: Launch Session¶
- Click "Launch" button
- Wait for container initialisation (~30-60 seconds)
- Session appears on your portal dashboard
- Click the session icon to access Firefly
🔥 Using Firefly¶
Interface Overview¶
Firefly's interface consists of several main areas:
graph TD
Interface[Firefly Interface]
Interface --> Upload[File Upload Area]
Interface --> Images[Image Display]
Interface --> Tables[Table Viewer]
Interface --> Tools[Analysis Tools]
Upload --> Local[Local Files]
Upload --> URLs[Remote URLs]
Upload --> Storage[CANFAR Storage]
Images --> Display[Image Canvas]
Images --> Controls[Display Controls]
Images --> Overlays[Catalogue Overlays]
Tables --> Browse[Data Browser]
Tables --> Filter[Filtering Tools]
Tables --> Plot[Plotting Tools]
Main Components¶
- File Upload Area: Load local files, URLs, or access CANFAR storage
- Image Display: Multi-panel image viewer with WCS support
- Table Viewer: Advanced table browser with analysis tools
- Control Panels: Image display controls, colour maps, overlays
Loading Data¶
Upload Local Files¶
FITS Images:
- Click "Images" tab
- Select "Upload"
- Choose FITS file from your computer
- Image loads automatically with WCS if available
Catalogue Tables:
- Click "Tables" tab
- Select "Upload"
- Choose CSV, FITS table, or VOTable
- Table opens in browser interface
Access CANFAR Storage¶
From ARC Projects:
# Files in your project directory are accessible via:
/arc/projects/[project]/data/image.fits
/arc/projects/[project]/data/image_sources.csv
From VOSpace:
- In Firefly, use "File" → "Open"
- Navigate to VOSpace URLs
- Access:
vos://cadc.nrc.ca~vault/[user]/
Remote Data Access¶
Survey Archives:
# Example URLs for Firefly
https://archive.stsci.edu/hlsp/data.fits
https://irsa.ipac.caltech.edu/data/WISE/cutouts/
Supported Formats:
- Images: FITS, JPEG, PNG
- Tables: CSV, FITS tables, VOTable, IPAC tables
- Archives: Gzipped files automatically handled
Image Analysis¶
Basic Image Display¶
Display Controls:
- Load FITS image
- Adjust stretch (log, linear, sqrt)
- Set scale limits (min/max values)
- Choose colour table (heat, cool, rainbow)
Navigation:
- Zoom: Mouse wheel or zoom controls
- Pan: Click and drag
- Centre: Double-click to centre
- Reset: Reset zoom and pan to default
Multi-band RGB¶
Creating RGB Composites:
- Load three images (e.g., g, r, i bands)
- Select "RGB" mode
- Assign each image to R, G, or B channel
- Adjust relative scaling
- Fine-tune colour balance
Coordinate Systems¶
Firefly supports standard coordinate systems:
- Equatorial: RA/Dec (J2000, B1950)
- Galactic: Galactic longitude/latitude
- Ecliptic: Ecliptic coordinates
- Pixel: Image pixel coordinates
Catalogue Analysis¶
Table Operations¶
Basic Navigation:
- Sort columns: Click headers to sort
- Filter rows: Use search box for text filtering
- Select rows: Click rows, Ctrl+click for multiple
- Pagination: Navigate large tables with page controls
Advanced Filtering:
// Example filters (use in filter box):
magnitude < 20.5 // Bright sources
colour_g_r > 0.5 && colour_g_r < 1.5 // Colour selection
distance < 100 // Distance constraint
ra > 180 && ra < 200 // RA range
Statistical Analysis¶
Built-in Statistics:
- Column statistics: Mean, median, std deviation
- Histogram analysis: Distribution plots
- Cross-correlation: Compare columns
- Selection statistics: Stats on filtered data
Plotting Tools¶
Column Plots:
- Select table columns for X and Y axes
- Choose plot type (scatter, histogram, line)
- Apply colour coding by third column
- Add error bars if available
- Customise symbols and colours
Image-Catalogue Overlay:
- Load image and catalogue table
- Match coordinate columns (RA, Dec)
- Select overlay symbol (circle, cross, diamond)
- Adjust symbol size and colour
- Sources appear overlaid on image
Advanced Features¶
Cutout Services¶
Extract subimages from large surveys:
Manual Cutouts:
- Right-click on image location
- Select "Create Cutout"
- Specify size (arcmin)
- Choose format (FITS, JPEG, PNG)
- Download or save to CANFAR storage
Programmatic Cutouts:
# Example using Python and Firefly
import requests
url = "https://irsa.ipac.caltech.edu/cgi-bin/Cutouts/nph-cutouts"
params = {
'mission': 'wise',
'locstr': '10.68 +41.27',
'sizeX': '300',
'sizeY': '300'
}
response = requests.get(url, params=params)
Multi-wavelength Analysis¶
Cross-band Analysis:
- Load images in different bands
- Use "Blink" mode to compare
- Create RGB composite
- Overlay catalogue with colour-magnitude selection
- Identify sources across wavelengths
Spectral Energy Distributions:
- Load multi-band photometry table
- Select source of interest
- Plot flux vs wavelength
- Fit SED models if available
Data Export¶
Save Results:
- Modified tables: CSV, FITS, VOTable formats
- Image displays: PNG, PDF for publications
- Analysis plots: Vector formats for papers
- Session state: Save/restore workspace
Export Options:
File → Export → [Format]
- Tables: CSV, FITS table, VOTable
- Images: FITS, PNG, JPEG, PDF
- Plots: PNG, PDF, SVG
- Session: Save current state
🛠️ Common Workflows¶
Survey Photometry¶
HSC/LSST Photometry Workflow:
- Load survey image (HSC, LSST, etc.)
- Upload photometric catalogue
- Overlay sources on image
- Filter by magnitude and colour
- Create colour-magnitude diagram
- Export selected sources
// Example: Filter for main sequence stars
// In Firefly filter box:
(g_mag - r_mag) > 0.2 && (g_mag - r_mag) < 1.0 && r_mag < 22
Multi-object Analysis¶
Target List Processing:
- Load target list (CSV with coordinates)
- Create cutouts around each target
- Measure properties in each cutout
- Compile results in table
- Plot trends and correlations
- Save analysis products
Cross-matching Catalogues¶
Gaia Cross-match Example:
- Load your source catalogue
- Load Gaia reference catalogue
- Perform spatial cross-match
- Analyse proper motions and parallaxes
- Create clean stellar sample
- Export matched catalogue
Time Series Visualisation¶
Light Curve Analysis:
- Load time-series table (time, magnitude, error)
- Create light curve plot
- Apply period folding if needed
- Identify outliers and trends
- Export cleaned data
🔧 Integration with CANFAR¶
Storage Access¶
ARC Projects:
# Your project data appears in Firefly file browser
/arc/projects/[project]/
├── images/ # FITS images
├── catalogues/ # Source tables
├── results/ # Analysis products
└── plots/ # Exported figures
VOSpace Integration:
# Access archived data
vos://cadc.nrc.ca~vault/[user]/
├── published_data/ # Public datasets
├── working_data/ # Analysis in progress
└── final_products/ # Paper-ready results
Collaborative Features¶
Session Sharing:
- Copy Firefly session URL
- Share with team members (same CANFAR group)
- Collaborate on analysis in real-time
- Each user sees same data and visualisations
Data Sharing:
- Save analysis results to shared project space
- Export publication-quality figures
- Share VOSpace links for external collaborators
- Version control important datasets
Working with Other CANFAR Tools¶
Integration Patterns:
- Notebooks → Firefly: Prepare data in Python, visualise in Firefly
- Firefly → Desktop: Export results for further analysis in CASA/DS9
- Batch → Firefly: Process large datasets, visualise results
- CARTA → Firefly: Radio analysis in CARTA, optical follow-up in Firefly