helicon.postprocess
Post-processing pipeline: thrust, detachment, plume metrics, reports, PropBench export.
Thrust
helicon.postprocess.thrust.compute_thrust(output_dir, *, exit_plane_z=None, species_masses=None, backend='auto')
Compute thrust from WarpX openPMD output.
Reads the final particle snapshot, selects particles near the exit plane, and integrates momentum flux.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_dir
|
path
|
WarpX output directory containing openPMD files. |
required |
exit_plane_z
|
float
|
Axial position of the exit plane [m]. If None, uses the domain boundary (inferred from data). |
None
|
species_masses
|
dict
|
Species name -> mass [kg] mapping. Defaults to standard values. |
None
|
backend
|
``"auto"`` | ``"mlx"`` | ``"numpy"``
|
Compute backend for momentum flux reduction. |
'auto'
|
Source code in src/helicon/postprocess/thrust.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | |
Detachment
helicon.postprocess.detachment.compute_detachment(output_dir, *, species_name='D_plus', species_mass=3.3435837724e-27, z_inject=None, z_exit=None, r_max=None, backend='auto')
Compute detachment efficiency from openPMD particle data.
Reads initial and final particle snapshots, classifies particles by exit location, and computes all three η_d definitions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_dir
|
path
|
WarpX output directory. |
required |
species_name
|
str
|
Particle species to analyze. |
'D_plus'
|
species_mass
|
float
|
Species mass [kg]. |
3.3435837724e-27
|
z_inject
|
float
|
Injection plane z-coordinate [m]. |
None
|
z_exit
|
float
|
Exit plane z-coordinate [m]. |
None
|
r_max
|
float
|
Radial domain boundary [m]. |
None
|
backend
|
``"auto"`` | ``"mlx"`` | ``"numpy"``
|
Compute backend for particle classification and efficiency sums. |
'auto'
|
Source code in src/helicon/postprocess/detachment.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
Plume
helicon.postprocess.plume.compute_plume_metrics(output_dir, *, species_name='D_plus', species_mass=3.3435837724e-27, T_e_eV=2000.0, z_exit=None, r_max=None, backend='auto')
Compute plume divergence and beam efficiency from particle data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_dir
|
path
|
WarpX output directory. |
required |
species_name
|
str
|
Species to analyze. |
'D_plus'
|
species_mass
|
float
|
Species mass [kg]. |
3.3435837724e-27
|
T_e_eV
|
float
|
Electron temperature at throat [eV], for C_T calculation. |
2000.0
|
z_exit
|
float
|
Exit plane z [m]. |
None
|
r_max
|
float
|
Radial domain boundary [m]. |
None
|
backend
|
``"auto"`` | ``"mlx"`` | ``"numpy"``
|
Compute backend for force and kinetic-energy reductions. |
'auto'
|
Source code in src/helicon/postprocess/plume.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
Moments
helicon.postprocess.moments.compute_moments(output_dir, *, nz=128, nr=64, species_name='D_plus', species_mass=3.3435837724e-27, backend='auto')
Compute velocity-space moments on a uniform grid.
Reads particle data from the latest openPMD snapshot, bins particles onto a (nr, nz) grid, and computes density, mean velocity, and pressure tensor components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_dir
|
path
|
WarpX output directory. |
required |
nz
|
int
|
Grid dimensions for moment computation. |
128
|
nr
|
int
|
Grid dimensions for moment computation. |
128
|
species_name
|
str
|
Name of species to process. |
'D_plus'
|
species_mass
|
float
|
Particle mass [kg]. |
3.3435837724e-27
|
backend
|
``"auto"`` | ``"mlx"`` | ``"numpy"``
|
Compute backend for bin index computation. Scatter-add always runs on CPU regardless. |
'auto'
|
Source code in src/helicon/postprocess/moments.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
Pulsed Engines
helicon.postprocess.pulsed.compute_pulsed_metrics(output_dir, *, species_name='D_plus', species_mass=3.3435837724e-27, pulse_period_s=None, n_pulses=None, bfield_path=None)
Compute per-pulse propulsion metrics from time-resolved output.
Analyzes time-series of particle snapshots to identify individual pulses and compute metrics for each.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_dir
|
path
|
WarpX output directory with multiple time snapshots. |
required |
species_name
|
str
|
Species to analyze. |
'D_plus'
|
species_mass
|
float
|
Species mass [kg]. |
3.3435837724e-27
|
pulse_period_s
|
float
|
Expected pulse repetition period [s]. If None, auto-detected. |
None
|
n_pulses
|
int
|
Expected number of pulses. If None, auto-detected. |
None
|
bfield_path
|
path
|
Path to a pre-computed B-field HDF5 file (written by
|
None
|
Source code in src/helicon/postprocess/pulsed.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
Run Report
helicon.postprocess.report.RunReport(helicon_version, config_hash, thrust_N, isp_s, exhaust_velocity_ms, mass_flow_rate_kgs, detachment_momentum, detachment_particle, detachment_energy, plume_half_angle_deg, beam_efficiency, thrust_coefficient, radial_loss_fraction, nozzle_type=None, plasma_source=None, thrust_relative_change_last_10pct=None, particle_count_exit=None, mass_ratio_reduced=False, validation_proximity=None, energy_conservation_relative_error=None)
dataclass
Complete report of a simulation run.
Functions
to_spec_dict(*, config=None, timestamp=None)
Return a spec §6.3 compliant nested dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
SimConfig
|
Original simulation configuration; used to populate
|
None
|
timestamp
|
str
|
ISO-8601 timestamp string. Defaults to the current UTC time. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
|
Source code in src/helicon/postprocess/report.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
helicon.postprocess.report.generate_report(output_dir, *, config_hash=None, config=None)
Generate a summary report from all available postprocessing results.
Attempts to compute each metric; missing data results in None values.
Source code in src/helicon/postprocess/report.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
helicon.postprocess.report.save_report(report, path, *, config=None)
Save a report to JSON using the spec §6.3 nested format.
Source code in src/helicon/postprocess/report.py
helicon.postprocess.report.load_report(path)
PropBench
helicon.postprocess.propbench.PropBenchResult(propbench_version='0.1', code_name='Helicon', code_version='', timestamp='', config_hash=None, nozzle_type=None, species=None, n0_m3=None, T_i_eV=None, T_e_eV=None, thrust_N=None, isp_s=None, exhaust_velocity_ms=None, mass_flow_rate_kgs=None, detachment_efficiency_momentum=None, detachment_efficiency_particle=None, detachment_efficiency_energy=None, plume_half_angle_deg=None, beam_efficiency=None, mass_ratio_reduced=False, electron_model='kinetic')
dataclass
PropBench-compatible result record.
helicon.postprocess.propbench.to_propbench(run_report, config=None, *, mass_ratio_reduced=False, electron_model='kinetic')
Convert a RunReport to a PropBenchResult.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_report
|
RunReport
|
Simulation results from postprocess/report.py. |
required |
config
|
SimConfig or None
|
Optional simulation configuration to extract plasma parameters. |
None
|
mass_ratio_reduced
|
bool
|
Whether a reduced mass ratio was used. |
False
|
electron_model
|
str
|
Electron treatment model used (e.g., "kinetic", "fluid"). |
'kinetic'
|
Returns:
| Type | Description |
|---|---|
PropBenchResult
|
|
Source code in src/helicon/postprocess/propbench.py
helicon.postprocess.propbench.save_propbench(result, path)
Write a PropBenchResult to a JSON file.