CLI Reference¶
Use pycwb --help to list commands and pycwb COMMAND --help for a
command’s options. python -m pycwb runs the CLI with the active interpreter.
Common workflows¶
pycwb run user_parameters.yaml
pycwb progress --work-dir my_search
pycwb merge --work-dir my_search
pycwb merge --work-dir my_search --wave
pycwb xtalk input.bin --output_dir converted
batch-setup builds job metadata and scheduler files, including catalog
fragments for planned batches; it can download a missing cross-talk catalog.
See Your First Search, Troubleshooting, and Run on Clusters for
complete workflows.
Search, batch, and postproduction¶
pycwb run # Run a single search
pycwb batch-setup # Generate Condor/SLURM submission scripts
pycwb post-process # Run postproduction workflow
pycwb render-event-pages /path/to/report/events/index.json # Refresh existing trigger HTML
For cluster submission details, see Run on Clusters.
Command options¶
run¶
usage: pycwb run [-h] [--config-vars config_vars] [--input-dir input_dir]
[--work-dir work_dir] [--force-overwrite] [--n-proc n_proc]
[--plot] [--compress_json] [--name name] [--list-n-jobs]
[--list-jobs] [--jobs jobs] [--trial-idx trial_idx]
[--lags lag_vector [lag_vector ...]] [--log-level log_level]
file_path
Run search
positional arguments:
file_path the path to the user parameter file
options:
-h, --help show this help message and exit
--config-vars config_vars
the config variables to overwrite, in the format of
key1=value1,key2=value2
--input-dir, -i input_dir
the input directory, the input files will be copied to
the working directory, such as the data quality files
--work-dir, -d work_dir
the working directory
--force-overwrite, -f
overwrite the existing results
--n-proc, -n n_proc the number of cpu to use, if it set to 0, it will use
the value from the user parameter file.
--plot generate the plot, by default False
--compress_json compress the json files, by default False
--name name the name of the serve
--list-n-jobs list number of the jobs in the flow
--list-jobs list all jobs in the flow
--jobs, -j jobs the range of jobs to run, e.g., 1-5,7
--trial-idx, -t trial_idx
the trial indices to run, e.g., 0-2,5
--lags lag_vector [lag_vector ...]
specific lag vectors to run; each vector is comma-
separated per-IFO shifts. Pass multiple vectors as
space-separated arguments, e.g., --lags 0,0 0,600
0,1190 (or quoted: "0,0;0,600;0,1190")
--log-level log_level
logging level (default: INFO)
batch-setup¶
usage: pycwb batch-setup [-h] [--config-vars config_vars]
[--input-dir input_dir]
[--cluster job_submission_system] [--submit]
[--work-dir work_dir] [--force-overwrite]
[--conda-env conda_env] [--conda-init conda_init]
[--additional-init additional_init]
[--accounting-group accounting_group]
[--n-proc n_proc] [--job-per-worker job_per_worker]
[--container-image container_image]
[--should-transfer-files] [--memory memory]
[--disk disk] [--compress_json] [--list-n-jobs]
[--list-jobs] [--walltime walltime]
[--slurm-constraint slurm_constraint]
[--slurm-partition slurm_partition]
[--n-retries n_retries]
file_path
Set up batch run
positional arguments:
file_path the path to the user parameter file
options:
-h, --help show this help message and exit
--config-vars config_vars
the config variables to overwrite, in the format of
key1=value1,key2=value2
--input-dir, -i input_dir
the input directory, the input files will be copied to
the working directory, such as the data quality files
--cluster, -c job_submission_system
the submit option, the available options are condor
and slurm
--submit, -s submit the jobs to the job submission system
--work-dir, -d work_dir
the working directory
--force-overwrite, -f
overwrite the existing results
--conda-env, -e conda_env
the conda environment
--conda-init conda_init
the conda init command to source before conda activate
(defaults to the cvmfs conda.sh for condor without a
container image)
--additional-init, -a additional_init
additional initialization commands
--accounting-group, -g accounting_group
the condor accounting group
--n-proc, -n n_proc CPU slots requested per Condor job or Slurm array
task; omitted uses YAML
--job-per-worker, -j job_per_worker
scientific segments assigned per cluster allocation;
omitted uses YAML
--container-image, --image container_image
the URI to the container image
--should-transfer-files
whether transfer files to computing node, set this if
the shared file system does not exist
--memory, -m memory the memory for each job
--disk, -k disk the disk space for each job
--compress_json compress the json files, by default True
--list-n-jobs list number of the jobs in the flow
--list-jobs list all jobs in the flow
--walltime walltime SLURM wall-clock time limit per job (e.g. 72:00:00,
default from config)
--slurm-constraint slurm_constraint
SLURM node feature constraint (e.g. cal)
--slurm-partition slurm_partition
SLURM partition to submit to
--n-retries n_retries
Additional attempts after failure (0 runs once);
omitted uses YAML or scheduler defaults: Condor 3,
Slurm 5
config-setup¶
usage: pycwb config-setup [-h] [--backend {pycwb,cwb}] [--config-only]
[--condor-only] [--machine-file machine_file]
[--events-file EVENTS_FILE]
[--override-profile OVERRIDE_PROFILE]
[--datatype datatype] [--dq-base-path DQ_DIR]
[--machine machine]
[--config-base-path config_base_path]
[--cluster job_submission_system] [--submit]
[--dry-run] [--n-proc n_proc] [--memory memory]
[--disk disk] [--accounting-group accounting_group]
[--container-image container_image]
[--force-overwrite] [--list-n-jobs]
[--walltime walltime]
[--slurm-constraint slurm_constraint]
[--slurm-partition slurm_partition]
[--n-retries n_retries]
workdir
Set up project configuration and batch jobs
positional arguments:
workdir Working directory name (will be created), e.g.,
O4_K02_C00_BurstLF_LH_BKG_standard
options:
-h, --help show this help message and exit
--backend {pycwb,cwb}
Render PycWB YAML or native cWB C templates (default:
pycwb)
--config-only Generate the run directory without preparing batch
jobs; useful when cWB runs on another machine
--condor-only Prepare Condor files for an existing generated cWB
run, without regenerating its configuration or inputs
--machine-file machine_file
Native host settings YAML for --condor-only; defaults
to WORKDIR/config/machine.yaml
--events-file EVENTS_FILE
Selected-event CSV or selection manifest; prepare an
event-only PycWB run without submitting jobs
--override-profile OVERRIDE_PROFILE
YAML partial overriding the generated PycWB
configuration before validation and batch preparation
--datatype, -d datatype
Data source type (e.g. igwn-osg, cit-local, gwosc,
local). Overrides the data_source defined in the
machine profile. Valid values are those configured in
settings.yaml.
--dq-base-path DQ_DIR
Override the DQ directory root. Defaults to the
selected datatype profile dq_base_path (relative to
CONFIG), then CONFIG/DQ. Relative CLI paths use the
current working directory. No fallback to another DQ
root.
--machine machine Machine profile name (overrides the machine key in
settings.yaml). Loads machine/<machine>.yaml from the
config repository.
--config-base-path, -c config_base_path
Base path to configuration repository (default:
./prototypes/config)
--cluster job_submission_system
Job submission system to use for batch setup (e.g.,
condor, slurm)
--submit, -s Submit the job to the batch system after setup
--dry-run Show what would be done without creating files
--n-proc, -n n_proc The number of cpu to use for each condor/slurm job
--memory, -m memory Memory per job (e.g., 4GB)
--disk, -k disk Disk space per job (e.g., 8GB)
--accounting-group, -g accounting_group
Condor accounting group
--container-image, --image container_image
Container image URI
--force-overwrite, -f
Overwrite existing results
--list-n-jobs List number of jobs without submitting
--walltime walltime SLURM wall-clock time limit per job (e.g. 72:00:00,
default from config)
--slurm-constraint slurm_constraint
SLURM node feature constraint (e.g. cal)
--slurm-partition slurm_partition
SLURM partition to submit to
--n-retries n_retries
Additional attempts after failure (0 runs once);
omitted uses YAML or scheduler defaults: Condor 3,
Slurm 5
clone-dir¶
usage: pycwb clone-dir [-h] [--catalog] [--force] [--events-file EVENTS_FILE]
[--override-profile OVERRIDE_PROFILE]
[--cluster {condor,slurm}]
indir outdir
Clone a directory to a new location
positional arguments:
indir Source run directory
outdir Destination run directory
options:
-h, --help show this help message and exit
--catalog Link source catalog entries instead of copying them.
These remain shared with the source; do not write
through the links. Not supported with event selection
or configuration overrides.
--force, -f Replace an existing destination after the clone is
prepared successfully
--events-file EVENTS_FILE
Selected-event CSV or selection manifest for an event-
only run
--override-profile OVERRIDE_PROFILE
YAML partial overriding the new run configuration
--cluster {condor,slurm}
Scheduler for event-only preparation (omitted uses
YAML); does not submit
batch-runner¶
usage: pycwb batch-runner [-h] [--allocated-cores ALLOCATED_CORES]
[--memory-limit MEMORY_LIMIT] [--batch-id BATCH_ID]
[--recover-corrupt] [--work-dir work_dir]
[--n-proc n_proc] [--jobs jobs] [--compress_json]
[--n-workers n_workers]
file_path
Run one batch payload
positional arguments:
file_path the path to the user parameter file
options:
-h, --help show this help message and exit
--allocated-cores ALLOCATED_CORES
Allocated logical CPU slots (ceiling)
--memory-limit MEMORY_LIMIT
Allocation-wide host memory ceiling, e.g. 8GiB
--batch-id BATCH_ID Prepared catalog batch, e.g. b000000 (exclusive with
--jobs)
--recover-corrupt Rebuild unreadable checkpoints from a verified
prepared record, preserving originals and recomputing
the whole batch
--work-dir, -d work_dir
the working directory
--n-proc, -n n_proc CPU budget per scientific segment; omitted or 0
preserves YAML
--jobs, -j jobs the range of jobs to run, e.g., 0-9
--compress_json compress the json files, by default True
--n-workers, -w n_workers
Maximum concurrent scientific segments within this
allocation; positive integer, default 1
xtalk¶
usage: pycwb xtalk [-h] [--output_dir output_dir] file_path
Convert an xtalk file
positional arguments:
file_path the path to the user parameter file
options:
-h, --help show this help message and exit
--output_dir, -o output_dir
the output directory
merge¶
usage: pycwb merge [-h] [--work-dir work_dir] [--wave]
[--catalog-dir catalog_dir] [--output-dir output_dir]
[--mlabel mlabel] [--allow-incomplete] [--no-resume]
[--no-check-consistency] [--use-threads] [--threads N]
[--duckdb-memory-limit SIZE] [--n-proc n_proc]
Merge catalog or wave files
options:
-h, --help show this help message and exit
--work-dir, -d work_dir
the working directory
--wave, -w whether to merge the reconstructed waveforms
--catalog-dir catalog_dir
the directory containing the catalog files to be
merged
--output-dir output_dir
the directory containing the wave files to be merged
--mlabel, -m mlabel merge label
--allow-incomplete allow merging completed tasks from an unfinished run
without confirmation; requires --mlabel for unfinished
runs
--no-resume disable reuse of completed merge outputs (resume is
enabled by default; existing labels are never
overwritten)
--no-check-consistency
disable advisory configuration metadata comparison;
trigger/progress and job provenance checks still apply
--use-threads enable parallel catalog column decoding using Arrow's
current CPU pool; use --threads N to set its size
(default: disabled)
--threads N set the Arrow CPU pool to N threads and enable catalog
column decoding threads; overrides the environment-
derived pool size (catalog merges only)
--duckdb-memory-limit SIZE
DuckDB validation memory budget, e.g. 256MB or 1GB
(default: 128MB; catalog merges only). This does not
limit total process memory or change scheduler
requests
--n-proc, -n n_proc number of worker processes for parallel wave-file
reading (default: os.cpu_count())
repair-catalog¶
usage: pycwb repair-catalog [-h] [--work-dir WORK_DIR] [--fragment FRAGMENT]
[--dag DAG] [--apply] [--report REPORT]
user_parameter_file
Inspect or reconstruct corrupted catalog fragments
positional arguments:
user_parameter_file Original run YAML
options:
-h, --help show this help message and exit
--work-dir, -d WORK_DIR
Existing run directory
--fragment FRAGMENT Restrict to a batch ID or legacy jobs selector;
repeatable
--dag DAG Original Condor DAG defining stable batch membership
--apply Preserve originals and rebuild corrupted pairs;
default inspects only
--report REPORT Save a JSON report at this path
post-process¶
usage: pycwb post-process [-h] [--diagram-only] [--open] [--no-diagram]
[--no-resume] [--progress {auto,live,plain}]
[--log-file PATH]
file_path
Post-process results
positional arguments:
file_path the path to the workflow file
options:
-h, --help show this help message and exit
--diagram-only, -d Generate workflow DAG diagram and exit (dry-run, no
execution).
--open, -o Open the interactive HTML diagram in browser after
generation (only with --diagram-only).
--no-diagram Skip diagram generation during workflow execution.
--no-resume Run actions again instead of reusing completed outputs
(resume is enabled by default).
--progress {auto,live,plain}
workflow display: auto uses Rich on interactive
terminals, live forces Rich, plain prints step
transitions (default: auto)
--log-file PATH append detailed output and tracebacks to a plain-text
log; relative to the current directory
render-event-pages¶
usage: pycwb render-event-pages [-h] JSON [JSON ...]
Refresh saved trigger pages without running analysis
positional arguments:
JSON saved event index or status JSON file; repeat to refresh several
selections
options:
-h, --help show this help message and exit
gwosc¶
usage: pycwb gwosc [-h] [--time_left time_left] [--time_right time_right]
[--ifos ifos [ifos ...]]
[--user_parameters_path user_parameters_path]
event_name
Download data and configuration for a GW event
positional arguments:
event_name The name of the GW event you want (e.g., "GW150914").
options:
-h, --help show this help message and exit
--time_left time_left
The pycWB analysis interval is [event_gps_time -
time_left; event_gps_time + time_right]. Default: 610
seconds.
--time_right time_right
The pycWB analysis interval is: [event_gps_time -
time_left; event_gps_time + time_right]. Default: 610
seconds.
--ifos ifos [ifos ...]
List of the detectors you want data from. For example:
--ifos H1 L1. The default is H1 L1.
--user_parameters_path user_parameters_path
Path of the user_parameters file, default
pycwb/vendor/template/gwosc/
gwosc-data¶
usage: pycwb gwosc-data [-h] [--work-dir work_dir] file_path
Download data for a configuration
positional arguments:
file_path the path to the user parameter file
options:
-h, --help show this help message and exit
--work-dir, -d work_dir
the working directory
get-external-modules¶
usage: pycwb get-external-modules [-h] [-u] file_path
Fetch configured external modules
positional arguments:
file_path the path to the config file
options:
-h, --help show this help message and exit
-u, --update update the existing external modules
online¶
usage: pycwb online [-h] [--work-dir work_dir] [--n-workers N]
[--log-level LEVEL]
config_file
Run an online search
positional arguments:
config_file Path to the YAML configuration file (with online
extension)
options:
-h, --help show this help message and exit
--work-dir, -d work_dir
Working directory for output (default: current
directory)
--n-workers, -n N Override online_n_workers from config
--log-level LEVEL Logging level (default: INFO)
progress¶
usage: pycwb progress [-h] [--work-dir work_dir] [--catalog-dir catalog_dir]
[--jobs job_range] [--verbose] [--timeit]
[--label label]
Show progress from run catalogs
options:
-h, --help show this help message and exit
--work-dir, -d work_dir
working directory (default: current directory)
--catalog-dir catalog_dir
sub-directory containing the catalog/progress files
(default: catalog)
--jobs, -j job_range restrict display to these jobs, e.g. "1-5,7"
--verbose, -v show per-job breakdown table (hidden by default)
--timeit, -t print per-step wall-clock timings to stderr for
performance profiling
--label, -l label use progress.{label}.parquet / catalog.{label}.parquet
as the merged files
simulation-summary¶
usage: pycwb simulation-summary [-h]
[--cache-waveform-support | --no-cache-waveform-support]
[--cache-waveform-ignore-par NAME,...]
[--output output.parquet]
[--work-dir work_dir]
[--config-vars key=value,...]
[--log-level level]
[config.yaml]
Build a per-simulation summary
positional arguments:
config.yaml config path relative to the caller (default: <work-
dir>/config/user_parameters.yaml)
options:
-h, --help show this help message and exit
--cache-waveform-support, --no-cache-waveform-support
reuse waveform timing across equivalent injections
(requires a deterministic polarization generator with
support independent of GPS time and explicitly ignored
parameters; enabled by default)
--cache-waveform-ignore-par NAME,...
comma-separated model parameters to ignore in the
support key; replaces
injection.cache_waveform_ignore_par; use an empty
string to clear the configured list; requires --cache-
waveform-support
--output, -o output.parquet
destination path for the Parquet summary file
(default: <work_dir>/catalog/simulations.parquet)
--work-dir, -d work_dir
working directory used to resolve relative paths
(default: .)
--config-vars key=value,...
comma-separated key=value pairs to override config
fields
--log-level level logging level (default: INFO)
match-simulations¶
usage: pycwb match-simulations [-h] [--output output.parquet]
[--how {inner,left,right,outer}]
[--buffer seconds] [--ranking-par RANKING_PAR]
[--extra-sim-columns COL [COL ...]]
[catalog.parquet] [simulations.parquet]
Match triggers to simulations
positional arguments:
catalog.parquet path to the trigger catalog Parquet file (default:
catalog/catalog.parquet)
simulations.parquet path to the simulation summary Parquet file (default:
catalog/simulations.parquet)
options:
-h, --help show this help message and exit
--output, -o output.parquet
destination path for the matched Parquet file
(default: matched_<how>.parquet in the current
directory)
--how {inner,left,right,outer}
join type: inner=matched pairs only; left=all triggers
(NULL sim for unmatched); right=all simulations (NULL
trigger for missed, default); outer=all triggers and
simulations
--buffer, -b seconds time buffer (seconds) added symmetrically to each
trigger window (default: 0)
--ranking-par RANKING_PAR
Unique recovery ranking (rho_alt for cWB pp_irho=1)
--extra-sim-columns COL [COL ...]
(deprecated — all simulation columns are now included
automatically with sim_ prefix)