# Control Strategy File Documentation ## Overview Control strategy files define the parameters used to adjust wavefront control performance during HOWFSC (High-Order Wavefront Sensing and Control) operations. These YAML-formatted files specify iteration-dependent settings that control the Electric Field Conjugation (EFC) algorithm behavior. ## File Format Control strategy files use YAML format with a specific structure for parameter definitions. Each parameter can be defined for different iteration ranges and contrast regimes. ### Parameter Structure Each parameter consists of one or more entries with the following fields: - **first**: First iteration number where this setting applies (1-indexed) - **last**: Last iteration number where this setting applies (use `None` for infinity, use last==first if only applicable for a single iteration) - **low**: Lower bound (closest to zero) of mean total contrast where this setting applies (0 for all) - **high**: Upper bound (furthest from zero) of mean total contrast where this setting applies (use `None` for infinity) - **value**: The parameter value to use in this range where low<=contrast0 **Details**: **Example Entry**: ```yaml unprobedsnr: - first: 1 last: None low: 0 high: None value: 5 # ``` **Notes**: - Needs to be high enough to have a good estimate of the contrast since the contrast is used to choose exposure times etc --- ### probedsnr **Type**: Float **Purpose**: Signal-to-noise ratio target for probed measurements **Units**: SNR **Typical Range**: ~7, must be >0 **Details**: [//]: # ([FILL IN: Explain probed SNR in the context of pair-wise probing,) [//]: # (why it differs from unprobed SNR, and how it affects field estimation accuracy]) **Example Entry**: ```yaml probedsnr: - first: 1 last: None low: 0 high: None value: 7 # ``` **Notes**: --- ### probeheight **Type**: Float **Purpose**: Amplitude of DM probes for pair-wise probing **Units**: mean probe amplitude **Typical Range**: 1e-5--1e-7, must be >0 **Details**: **Example Entry**: ```yaml probeheight: - first: 1 last: None low: 0 # High contrast regime high: 1.0e-7 value: 1.0e-7 # - first: 1 last: None low: 1.0e-7 # Medium contrast high: 1.0e-6 value: 1.0e-6 # - first: 1 last: None low: 1.0e-6 # Low contrast regime high: None value: 1.0e-5 # ``` **Notes**: - Non-linearity concerns at deep contrast - Probe height relates to achievable contrast floor - Relationship to SNR requirements --- ### fixedbp **Type**: File path (single value, not range-based) **Purpose**: Specifies fixed bad pixels to exclude **File Format**: FITS file containing binary mask **Details**: Bad pixels are identified as 1. **Example Entry**: ```yaml fixedbp: '../../every_mask_config/fixedbp_zeros.fits' ``` **File Requirements**: - Shape: [nrow, ncol] - Valid values: 0 = good, 1 = bad **Notes**: - If using `path_overrides` in `scripts/default_params.yaml` then the path must be changed to an absolute path --- ## Usage Guidelines [//]: # (### Creating a New Control Strategy) [//]: # () [//]: # ([FILL IN: Step-by-step process for creating a new control strategy file]) [//]: # () [//]: # (1. [FILL IN]) [//]: # (2. [FILL IN]) [//]: # (3. [FILL IN]) [//]: # () [//]: # (### Modifying Existing Strategies) [//]: # () [//]: # ([FILL IN: Best practices for adjusting parameters]) [//]: # () [//]: # (- [FILL IN: Which parameters to adjust first]) [//]: # (- [FILL IN: Testing procedures]) [//]: # (- [FILL IN: Common modifications for different scenarios]) [//]: # () [//]: # (### Iteration and Contrast Logic) [//]: # () [//]: # (The control strategy parameters are selected based on:) [//]: # (```python) [//]: # (# Pseudocode for parameter selection) [//]: # (for each_iteration:) [//]: # ( current_contrast = measure_current_contrast()) [//]: # () [//]: # ( for each_parameter:) [//]: # ( # Find matching entry) [//]: # ( matching_entry = find_where() [//]: # ( iteration_number >= first AND) [//]: # ( iteration_number <= last AND) [//]: # ( current_contrast >= low AND) [//]: # ( current_contrast < high) [//]: # ( )) [//]: # ( ) [//]: # ( use_parameter_value = matching_entry.value) [//]: # (```) [//]: # () [//]: # ([FILL IN: Explain what happens if multiple entries match, or if no entries match]) [//]: # () [//]: # (---) [//]: # () [//]: # (## Common Control Strategy Configurations) [//]: # () [//]: # (### Conservative Strategy (High Stability)) [//]: # () [//]: # ([FILL IN: Parameter recommendations for stable but slower convergence]) [//]: # () [//]: # (### Aggressive Strategy (Fast Convergence)) [//]: # () [//]: # ([FILL IN: Parameter recommendations for faster convergence with potential stability trade-offs]) [//]: # () [//]: # (### Deep Contrast Strategy) [//]: # () [//]: # ([FILL IN: Parameter recommendations for achieving deepest possible contrast]) [//]: # () [//]: # (---) ## File Path Conventions Relative paths in control strategy files are resolved relative to the location of the cstrat file. If using `path_overrides` in `scripts/default_params.yaml` then the paths must be changed to absolute paths. [//]: # (The example paths shown (`../../every_mask_config/`) suggest [FILL IN: explain directory structure].) --- ## References - [Cady et al. (2025) - CGI HOWFSC architecture and performance](https://ui.adsabs.harvard.edu/abs/2025JATIS..11b1408C/abstract) --- ## Change History - 01/21/2026 - Initial documentation created