Browse Source

fixed naming for test spot overflow

xmlparsing
Holger Frey 4 years ago
parent
commit
9be13db61c
  1. 2
      sensospot_data/columns.py
  2. 5
      sensospot_data/dynamic_range.py
  3. 4
      sensospot_data/parser.py

2
sensospot_data/columns.py

@ -70,7 +70,7 @@ SETTINGS_EXPOSURE_CHANNEL = "Exposure.Channel"
SETTINGS_EXPOSURE_TIME = "Exposure.Time" SETTINGS_EXPOSURE_TIME = "Exposure.Time"
# calculated value for dynamic range normalization # calculated value for dynamic range normalization
CALC_SPOT_OVERFLOW = "Calc.Spot.Overflow" CALC_SPOT_OVERFLOW = "Calc.Spot.Is.Overflowing"
# settings for normalized exposure time # settings for normalized exposure time
SETTINGS_NORMALIZED_EXPOSURE_TIME = "Settings.Normalized.Exposure.Time" SETTINGS_NORMALIZED_EXPOSURE_TIME = "Settings.Normalized.Exposure.Time"

5
sensospot_data/dynamic_range.py

@ -35,7 +35,7 @@ def _check_if_xdr_ready(data_frame):
def _calc_overflow_info(data_frame, column=RAW_DATA_SPOT_MEAN, limit=0.5): def _calc_overflow_info(data_frame, column=RAW_DATA_SPOT_MEAN, limit=0.5):
""" add overflow info, based on column and limit """ """ add overflow info, based on column and limit """
data_frame[CALC_SPOT_OVERFLOW] = data_frame[column] > limit data_frame.loc[:, CALC_SPOT_OVERFLOW] = data_frame[column] > limit
return data_frame return data_frame
@ -61,7 +61,8 @@ def _reduce_overflow(data_frame):
def blend(data_frame, column=RAW_DATA_SPOT_MEAN, limit=0.5): def blend(data_frame, column=RAW_DATA_SPOT_MEAN, limit=0.5):
""" creates an extended dynamic range, eliminating overflowing spots """ """ creates an extended dynamic range, eliminating overflowing spots """
_check_if_xdr_ready(data_frame) _check_if_xdr_ready(data_frame)
data_frame = _calc_overflow_info(data_frame, column, limit) if CALC_SPOT_OVERFLOW not in data_frame.columns:
data_frame = _calc_overflow_info(data_frame, column, limit)
return _reduce_overflow(data_frame) return _reduce_overflow(data_frame)

4
sensospot_data/parser.py

@ -16,6 +16,7 @@ from .columns import (
META_DATA_EXPOSURE_ID, META_DATA_EXPOSURE_ID,
META_DATA_WELL_COLUMN, META_DATA_WELL_COLUMN,
RAW_DATA_COLUMNS_RENAME_MAP, RAW_DATA_COLUMNS_RENAME_MAP,
RAW_DATA_NORMALIZATION_MAP,
) )
from .parameters import add_optional_measurement_parameters from .parameters import add_optional_measurement_parameters
@ -124,6 +125,9 @@ def _sanity_check(data_frame):
expected_rows = field_rows * field_cols * exposures * spot_positions expected_rows = field_rows * field_cols * exposures * spot_positions
if expected_rows != len(data_frame): if expected_rows != len(data_frame):
raise ValueError("Measurements are missing") raise ValueError("Measurements are missing")
# set the right data type for measurement columns
for raw_column in RAW_DATA_NORMALIZATION_MAP:
data_frame[raw_column] = pandas.to_numeric(data_frame[raw_column])
return data_frame return data_frame

Loading…
Cancel
Save