fixers module

Define functions to fix measurement errors.

fix_wrong_e_field_calibration(freq_mhz, g_probe_new, rack_calibration_folder, filepath_bad, filepath_new=None, g_probe_bad=None, a_rack_bad=None, b_rack_bad=None, sep=',', **kwargs)[source]

Recover proper electric field measurements.

Use this when the attenuation and/or the rf rack data in LabView was incorrect.

Parameters:
  • freq_mhz (float) – Test frequency in \(\mathrm{MHz}\).

  • g_probe_new (dict[str, float]) – Correct attenuation at current frequency for every field probe. Keys are the names of the field probes, eg "E1", "E2", etc.

  • rack_calibration_folder (Path) –

    Folder holding all the rack calibration files. It should look like:

    outputs
    ├── E1_fit_calibration.csv
    ├── E2_fit_calibration.csv
    ├── E3_fit_calibration.csv
    ├── E4_fit_calibration.csv
    ├── E5_fit_calibration.csv
    ├── E6_fit_calibration.csv
    └── E7_fit_calibration.csv
    

  • filepath_bad (Path) – Path to the original data file, generally XLSX file.

  • filepath_new (Path | None, default: None) – Path to the new corrected data file, generally CSV file.

  • g_probe_bad (dict[str, float] | None, default: None) – Dictionaries linking every field probe to the electric field probe parameters as found in filepath_bad. If not provided, should be read from filepath_bad directly.

  • a_rack_bad (dict[str, float] | None, default: None) – Dictionaries linking every field probe to the electric field probe parameters as found in filepath_bad. If not provided, should be read from filepath_bad directly.

  • b_rack_bad (dict[str, float] | None, default: None) – Dictionaries linking every field probe to the electric field probe parameters as found in filepath_bad. If not provided, should be read from filepath_bad directly.

  • sep (str, default: ',') – Column delimiter in input and output CSV files.

Raises:

NotImplementedError – When the bad electric field probes parameters are not provided and they should be read from filepath_bad directly.

Return type:

None

fix_power_channel_b(p_bad, k_fix, alpha_fix)[source]

Fix power measured on channel B.

Transfer function proposed by M. Vénière.

\[P_\mathrm{ok} = k_\mathrm{fix} \times P_\mathrm{bad}^{\alpha_\mathrm{fix}}\]
Parameters:
Return type:

ndarray[tuple[Any, ...], dtype[double]]

Returns:

Fixed power in \(\mathrm{W}\).