Skip to content

Commit

Permalink
more docs, add missing str() around exception object
Browse files Browse the repository at this point in the history
  • Loading branch information
backmari committed Jan 31, 2025
1 parent 9cdd04f commit 6b95399
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
22 changes: 10 additions & 12 deletions docs/user/corrections/transmission.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,17 @@ Parameters
- Beam radius within which the transmission will be calculated. If ``None``, then the beam
radius is calculated from the sample logs.
- ``None``
* - ``"useTimeSliceTransmission"``
- (Bio-SANS only) Only used with ``"useTimeSlice": True``. If ``True``, the transmission
correction will be calculated using the time sliced sample run instead of the sample
transmission run. The time slicing scheme is created using the sample run and may not be
compatible with the sample transmission run. Additionally, the sample transmission may be
changing in time, therefore, the time sliced sample run may give a more accurate transmission
correction than a separate sample transmission run.
- ``False``
* - ``"transmissionErrorTolerance"``
- Maximum relative transmission error.
- 0.01
* - ``"useThetaDepTransCorrection"``
- If ``True``, a theta dependent transmission correction will be applied, which takes into
account the effect of the scattering angle on the transmission.
- ``True``
* - ``"transmissionErrorTolerance"``
- Maximum relative transmission error. If ``"useTimeSlice": True``, slices with transmission
error larger than the tolerance will be skipped.
- 0.1
* - ``"useTimeSliceTransmission"``
- (`Only for Bio-SANS and when` ``"useTimeSlice": True``.) If ``True``, the transmission
correction will be calculated using the time sliced sample run itself instead of a separate
sample transmission run. This is useful when the sample transmission is expected to change
over time. Slices with relative transmission error larger than
``"transmissionErrorTolerance"`` will be skipped.
- ``False``
3 changes: 1 addition & 2 deletions src/drtsans/mono/gpsans/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
from drtsans.settings import namedtuplefy
from drtsans.solid_angle import solid_angle_correction
from drtsans.thickness_normalization import normalize_by_thickness
from drtsans.transmission import TransmissionErrorToleranceError, TransmissionNanError
from drtsans.save_ascii import save_ascii_binned_2D
from drtsans.save_cansas import save_cansas_nx

Expand Down Expand Up @@ -1295,7 +1294,7 @@ def reduce_single_configuration(loaded_ws, reduction_input, prefix="", skip_nan=
debug=debug_output,
remove_algorithm_history=remove_algorithm_history,
)
except (ZeroMonitorCountsError, TransmissionErrorToleranceError, TransmissionNanError) as e:
except ZeroMonitorCountsError as e:
if time_slice:
logger.warning(f"Skipping slice {name}: {e}.")
continue
Expand Down
6 changes: 3 additions & 3 deletions src/drtsans/tof/eqsans/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
process_transmission,
)
from drtsans.tof.eqsans.transmission import calculate_transmission # noqa E402
from drtsans.transmission import apply_transmission_correction, TransmissionErrorToleranceError, TransmissionNanError
from drtsans.transmission import apply_transmission_correction

__all__ = [
"apply_solid_angle_correction",
Expand Down Expand Up @@ -105,7 +105,7 @@ def _get_configuration_file_parameters(sample_run, directory=None):
try:
configuration_file_parameters = load_config(source=sample_run, config_dir=directory)
except RuntimeError as e:
logger.error(e)
logger.error(str(e))
logger.warning("Not using previous configuration")
configuration_file_parameters = {}
return configuration_file_parameters
Expand Down Expand Up @@ -931,7 +931,7 @@ def reduce_single_configuration(
absolute_scale=absolute_scale,
keep_processed_workspaces=False,
)
except (ZeroNeutronFluxError, TransmissionErrorToleranceError, TransmissionNanError) as e:
except ZeroNeutronFluxError as e:
if time_slice:
logger.warning(f"Skipping slice {slice_name}: {e}.")
continue
Expand Down

0 comments on commit 6b95399

Please sign in to comment.