Graphical User Interface
The DISCO GUI is a single-page web application delivered by the FastAPI
backend (disco.server) and rendered in any modern browser. It is
launched with:
disco-start gui
Mosaic layout of the GUI (v1.2.5): File Header, Image Viewer with ellipse overlay, Render Configuration, and Scientific Analysis.
The server binds to the first free TCP port starting at 8000 and opens a
browser tab automatically after a 1.5-second delay via a background thread.
Check the terminal for the URL (for example http://localhost:8000, or
8001 if 8000 is already in use).
Tip
The GUI is recommended for exploratory analysis and first-time users. For reproducible, automated batch processing, use the CLI instead (see Command-Line Interface).
Step-by-Step Guide
A typical GUI session follows these steps:
1. Load a FITS file
Click the folder icon in the toolbar and select your .fits file.
The image will appear in the viewer and the FITS header will populate
automatically in the CATALOG panel.
2. Adjust the disk geometry
In the Render Configuration panel, use the sliders to set the initial geometric parameters:
Inclination — disk inclination in degrees (0° = face-on, 90° = edge-on).
Position Angle — orientation of the disk major axis in degrees.
FOV — full width of the deprojected square view in arcseconds (defaults to about half the map side; Radius Out cannot exceed FOV/2).
Radius Out — estimated outer disk radius in arcseconds.
Center X / Y — pixel coordinates of the disk centre (auto-initialised to the image midpoint on load).
Activate the Ellipse Tool in the toolbar to display the geometry overlay on the image. As you move the sliders, the ellipse updates live so you can visually align it with the disk before running the pipeline.
3. Run the pipeline
Click RUN PIPELINE. DISCO computes the deprojected image, azimuthally-averaged radial profile, cumulative flux curve, and Gaussian ring fit for the current parameters.
4. Auto-tune the geometry (optional)
Click Auto-Tune Geometry in the ANALYSIS panel to refine inclination, position angle, and centre from the current sliders. The GUI path runs a coarse grid search plus a local L-BFGS-B fit of the geometric loss (with only a small allowed centre shift). Treat the output as an approximate suggestion, not a guaranteed global optimum: low-inclination disks, weak rings, or a poor seed can leave a local minimum. Always check the ellipse by eye. The stronger CNN + differential-evolution hybrid is used by the CLI, not by this button. See disco.core.optimization.
5. Explore the results
Switch between Deprojection, Model, Residuals, and Polar view tabs to inspect different representations of the disk. Deprojected maps are sky-aligned (North up). Activate the Inspector tool and hover over the image to probe the radial profile in real time. Drag on the profile chart to define a fitting range for Gaussian ring analysis.
6. Export
Download the radial profile as CSV, save the currently displayed view as a FITS file, or open the Matplotlib Widget for a publication-ready figure. Use Save Session to preserve all parameters for later restoration.
Application Layout
The interface is implemented as a mosaic tiling system
(react-mosaic-component) with four resizable, re-arrangeable panels,
identified by internal window identifiers:
Panel ID |
Content |
|---|---|
|
Geometry parameter controls (inclination, position angle, FOV, outer radius, centre pixel coordinates), active filename display, and the RUN PIPELINE button. |
|
Interactive canvas viewer ( |
|
FITS header keyword table (key, value, comment) and SIMBAD query button. |
|
The |
File Loading
Files are loaded via two mechanisms:
Direct FITS upload — clicking the folder icon triggers a hidden
<input type="file">element. The selected file is posted toPOST /upload. On success,GET /previewis called to retrieve a base64-encoded preview image, andGET /get_headerretrieves the FITS header keywords.Session restore — if a
.jsonsession file is selected, the stored parameters are restored and the referenced FITS filename is reloaded viaPOST /load_local.
Toolbar Reference
Toolbar (v1.2.5): open, save session, fullscreen, close, ellipse, pan, and inspector. The active tool is highlighted in purple.
The toolbar provides file management and viewer interaction controls. The active mode is highlighted with a purple background.
Icon |
Name |
Description |
|---|---|---|
📁 |
Open File |
Opens a file picker to load a |
💾 |
Save Session |
Saves current parameters (inclination, PA, radius, centre) and the
active filename to a downloadable |
⛶ |
Fullscreen |
Expands the viewer panel to fill the browser window. |
✕ |
Close |
Clears the currently loaded file and resets the interface. |
◎ |
Ellipse Tool |
It allows you to manipulate the shape of the ellipse. The ellipse reflects the current inclination, position angle, and outer radius in real time as you adjust the sliders and/or move the ellipse control. Use it as a visual guide before running the pipeline. |
🖐 |
Pan |
Switches to pan/drag mode for navigating across large images. |
⊕ |
Inspector |
Enables the Cursor Probe. Hovering over the image synchronises the crosshair position with the 1D radial profile chart and displays Radius, Intensity (K), and X/Y sky offsets in real time. |
Geometry Controls (CONTROLS panel)
The following parameters are exposed in the CONTROLS panel and are
transmitted to POST /run_pipeline on each pipeline execution:
Parameter |
Description |
|---|---|
|
Disk inclination in degrees (slider + numeric input, range 0–90°). |
|
Position angle in degrees (slider + numeric input, range 0–180°). |
|
Full width of the deprojected square view in arcseconds. Radius Out cannot exceed FOV/2. |
|
Outer disk radius in arcseconds (slider + numeric input; capped by FOV/2). |
|
Pixel coordinates of the disk centre (numeric inputs; initialised to the image midpoint on load). |
|
Radial range boundaries for Gaussian ring fitting (set by drag-selection on the profile chart or image canvas). |
Auto-Tune Geometry
The Auto-Tune button (implemented as handleAutoTune in App.jsx)
posts the current geometry to POST /optimize_geometry and applies the
returned optimised inclination, position angle, and centre:
// App.jsx — handleAutoTune (API base URL matches the running server port)
const response = await fetch(`${apiBase}/optimize_geometry`, {
method: 'POST',
body: JSON.stringify({
cx, cy, pa, incl, rout, fit_rmin, fit_rmax
}
});
const data = await response.json();
setParams(prev => ({
...prev,
incl: data.optimized_incl,
pa: data.optimized_pa,
cx: data.optimized_cx,
cy: data.optimized_cy,
}));
The optimisation is a grid-search seeded L-BFGS-B minimisation of
disco.core.optimization.geometric_loss() (see disco.core.optimization).
The GUI Auto-Tune uses this analytical path only; it can converge to a
local minimum and is not guaranteed to recover literature-quality
geometry on every source. The CNN-seeded hybrid optimiser
(auto_tune_geometry_hybrid) is used exclusively by the CLI pipeline.
Analysis Dashboard (ANALYSIS panel)
View Modes
The dashboard toolbar provides four view selectors:
Mode |
Description |
|---|---|
|
Deprojected (face-on) image computed by the pipeline. |
|
Azimuthally-averaged synthetic model image. |
|
Difference between the deprojected image and the model. Highlights non-axisymmetric structures such as spirals, arcs, or clumps. |
|
Image resampled into polar coordinates (radius vs azimuth). |
Display Settings
A popover panel provides the following visualisation controls, which
trigger a POST /render_plot call on change:
Control |
Description |
|---|---|
Intensity Limits (Min/Max) |
Manual |
Auto button |
Sets |
Colormap |
Selected from: |
Stretch |
Selected from: |
Contours |
Boolean toggle; number of contour levels is configurable (1–50). |
Overlays |
Axes, colourbar, and contours. The synthesised beam is shown when available in the FITS header (not a Display Configuration toggle); the Matplotlib Widget provides a separate beam overlay control. |
1D Profile Chart
The radial profile chart is rendered with the recharts library
(LineChart). The Y axis supports linear and logarithmic scaling (toggle
switch). Data points are derived from the profileData object returned
by POST /run_pipeline.
Range selection for Gaussian ring fitting is implemented as a
click-and-drag interaction on the chart: the dragStart and dragEnd
state variables track the selected radial interval, which is communicated
to the server via POST /run_pipeline through the fit_rmin /
fit_rmax fields.
Cursor Probe
When the Inspector tool is active, hovering over the 2D image canvas
(SimpleImageViewer) synchronises the current radius to the 1D chart
via the syncedRadius state variable. The probe widget displays:
RADIUS — current radial position in arcseconds
INTENSITY — brightness temperature at the closest profile sample, in K
OFFSET X, OFFSET Y — \(r / \sqrt{2}\) in arcseconds
Ring Fit Statistics
If a fit range is active (fit_rmin < fit_rmax), the pipeline fits a
Gaussian to the radial profile within the selected interval using
scipy.optimize.curve_fit with the model:
The returned fit object exposes:
PEAK RADIUS \(r_0\) — centroid of the fitted Gaussian, in arcsec
WIDTH (FWHM) — \(2\sqrt{2 \ln 2}\,\sigma\), in arcsec
Cumulative Flux Chart
The cumulative enclosed flux is computed client-side as:
and displayed as an AreaChart.
Custom Markers
The Add Marker function enters marker-placement mode on the image canvas.
On click, a dialog prompts for a label, shape (circle, square,
star, cross), and colour. Markers are rendered as Konva.js overlay
shapes and are persistent within the session. Markers can be cleared per
view mode.
Export Functions
Function |
Behaviour |
|---|---|
Download FITS |
Calls |
CSV Export |
Client-side function ( |
Session Save |
Serialises |
Matplotlib Widget |
Opens a secondary browser panel ( |
SIMBAD Query
The SIMBAD button (in the CATALOG panel) triggers GET /query_simbad.
The server reads the WCS from the loaded FITS header, converts the image
centre pixel to sky coordinates, and queries CDS SIMBAD within a 2 arcmin
radius, requesting the otype, flux(V), and distance VOTable
fields. The result is returned as a list of JSON objects and displayed in a
popup table.
This functionality requires astroquery to be installed. If the library
is absent, the endpoint returns HTTP 501.