Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,11 @@ def _convert_to_seconds(value: float | None) -> float | None:


def _create_peak(peak: dict[str, Any], signal: dict[str, Any]) -> Peak:
# Area and height are reported in μV, but are reported in ASM as mAU
# For Chromeleon software, 1V == 1AU, so we just need to convert μ to m
if (area := try_float_or_none(peak.get("area"))) is not None:
area /= 1000
if (height := try_float_or_none(peak.get("height"))) is not None:
height /= 1000
height = try_float_or_none(peak.get("height"))
# Area is reported in mAU·min — convert to mAU·s for ASM
area = try_float_or_none(peak.get("area"))
if area is not None:
area *= 60
# Times are reported in minutes by Chromeleon - convert to seconds
retention_time = _convert_to_seconds(try_float_or_none(peak.get("retention time")))
width_at_half_height = _convert_to_seconds(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ def test_create_measurement_groups(mock_data: dict[str, Any]) -> None:
assert peaks is not None
peak = peaks[0]
assert peak.peak_analyte_amount == 100.0
assert peak.area == 0.0030483288680073542
assert peak.area == 182.89973208044124
assert peak.asymmetry_factor_measured_at_5_percent_height == 1.2188763229155313
assert peak.area_unit == "mAU.s"
assert peak.capacity_factor == 12
assert peak.chromatographic_resolution == 1.7448475391025424
assert peak.end == 14.38
assert peak.start == 8.86
assert peak.height == 0.11128958058334837
assert peak.height == 111.28958058334837
assert peak.end_unit == "s"
assert peak.start_unit == "s"
assert peak.index == "1"
Expand Down
Loading
Loading