emp.HOB_yield_scan

Copyright (C) 2023 by The RAND Corporation See LICENSE and README.md for information on usage and licensing

Scan over the height of burst (HOB) and yield to generate EMP results.

Functions

HOB_yield_scan(base_config_path, scan_name)

Generate and run a regional EMP scan based on a base configuration file.

contour_plot(results_dir[, save_path, show, ...])

Create a contour plot of the EMP field strength based on results from a scan.

load_scan_results(results_dir)

Load all EmpLosResult JSON files in a directory and return HOB, total_yield_kt, max E lists.

emp.HOB_yield_scan.load_scan_results(results_dir)[source]

Load all EmpLosResult JSON files in a directory and return HOB, total_yield_kt, max E lists.

Parameters:

results_dir (Union[str, Path]) – Directory containing result JSON files.

Returns:

Dictionary with keys ‘HOB_list’, ‘total_yield_kt_list’, and ‘E_max_list’.

Return type:

Dict[str, List[float]]

emp.HOB_yield_scan.contour_plot(results_dir, save_path=None, show=True, ngrid=50, levels=20)[source]

Create a contour plot of the EMP field strength based on results from a scan.

Parameters:
  • results_dir (Union[str, Path]) – Directory containing result JSON files.

  • save_path (Optional[str], optional) – Path to save the plot, by default None (does not save).

  • show (bool, optional) – Whether to display the plot, by default True.

  • ngrid (int, optional) – Number of grid points for interpolation, by default 50.

  • levels (int, optional) – Number of contour levels, by default 20.

Returns:

The contour set object.

Return type:

contour.QuadContourSet

emp.HOB_yield_scan.HOB_yield_scan(base_config_path, scan_name, N_pts_HOB=20, N_pts_yield=20, HOB_min=55.0, HOB_max=400.0, yield_min=1.0, yield_max=1000.0, num_cores=1)[source]

Generate and run a regional EMP scan based on a base configuration file.

Parameters:
  • base_config_path (str) – Path to the base configuration file.

  • scan_name (str) – Name for the scan, used to create output directory and config files.

  • N_pts_HOB (int, optional) – Number of HOB values to scan, by default 20.

  • N_pts_yield (int, optional) – Number of yield values to scan, by default 20.

  • HOB_min (float, optional) – Minimum HOB value, by default 55.0.

  • HOB_max (float, optional) – Maximum HOB value, by default 400.0.

  • yield_min (float, optional) – Minimum yield value, by default 1.0.

  • yield_max (float, optional) – Maximum yield value, by default 1e3.

  • num_cores (int, optional) – Number of CPU cores to use for parallel processing, by default 1.

Return type:

None