Command-Line Interface
DISCO provides a single console-script entry point, disco-start,
declared in pyproject.toml as:
[project.scripts]
disco-start = "disco.main:run"
The entry point disco.main:run inspects sys.argv[1] and dispatches
either to the GUI server or to the CLI pipeline (see Architecture).
Synopsis
usage: disco-start [-h] [--rout ROUT] [--rmin RMIN] [--incl INCL] [--pa PA]
[--beam BEAM] [--homobeam {on,off}] [--csv {on,off}]
[--debug {on,off}] [identifier ...]
Positional Arguments
Argument |
Description |
|---|---|
|
Zero or more object identifiers or file paths.
Each identifier is matched against discovered FITS group names and file
paths. May be an object name prefix (e.g., |
Optional Arguments
Argument |
Default |
Description |
|---|---|---|
|
|
Force the outer disk radius in arcseconds. When specified, the automatic outer radius estimation is bypassed and this value is used for all groups. |
|
|
Force the inner disk radius (cavity) in arcseconds. When set to 0.0 (default), the inner radius is detected automatically from the FITS header beam size. |
|
|
Force the disk inclination in degrees.
When both |
|
|
Force the disk position angle in degrees.
Must be specified jointly with |
|
|
Force the target beam resolution in arcseconds for beam
homogenisation. When omitted and |
|
|
Enable or disable beam homogenisation. When |
|
|
Enable CSV export. When |
|
|
Save a diagnostic deprojected PNG image showing the optimised centre and outer radius overlay. |
Usage Examples
# Process all FITS files discovered in the working directory
disco-start
# Process a single object by name prefix
disco-start AS209
# Process multiple objects simultaneously
disco-start AS209 Elias29 DoAr25
# Process a specific directory group
disco-start path/to/group/
# Process a FITS file directly
disco-start path/to/disk.fits
# Force inclination and PA, export CSV, enable debug output
disco-start AS209 --incl 35.0 --pa 120.0 --csv on --debug on
# Set outer radius and disable beam homogenisation
disco-start AS209 --rout 1.2 --homobeam off
# Specify a custom homogenisation beam size
disco-start AS209 Elias29 --homobeam on --beam 0.15
CNN Model Loading
At startup, the CLI attempts to load the pre-trained DiscoNet weights from
disco/models/disco_model_stable.pth. The model is instantiated as
DiscoNet(n_out=5) and its state dictionary is loaded with
weights_only=True. If the model file is absent or fails to load, a
warning is printed and the pipeline falls back to analytical geometry
optimisation without CNN priors.
# Effective loading logic in disco/cli.py
model_path = os.path.join(BASE_DIR, "models", "disco_model_stable.pth")
if os.path.exists(model_path):
ckpt = torch.load(model_path, map_location='cpu', weights_only=True)
cnn_model = DiscoNet(n_out=5)
state = ckpt["model_state"] if isinstance(ckpt, dict) else ckpt
cnn_model.load_state_dict(state)
cnn_model.eval()