|
|
|
@ -124,16 +124,20 @@ def _sanity_check(data_frame):
@@ -124,16 +124,20 @@ def _sanity_check(data_frame):
|
|
|
|
|
spot_positions = len(data_frame[RAW_DATA_POS_ID].unique()) |
|
|
|
|
expected_rows = field_rows * field_cols * exposures * spot_positions |
|
|
|
|
if expected_rows != len(data_frame): |
|
|
|
|
raise ValueError("Measurements are missing") |
|
|
|
|
raise ValueError( |
|
|
|
|
f"Measurements are missing: {expected_rows} != {len(data_frame)}" |
|
|
|
|
) |
|
|
|
|
# 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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def parse_folder(folder): |
|
|
|
|
def parse_folder(folder, quiet=False): |
|
|
|
|
""" parses all csv files in a folder to one large dataframe """ |
|
|
|
|
file_list = list_csv_files(Path(folder)) |
|
|
|
|
data_frame = parse_multiple_files(file_list) |
|
|
|
|
data_frame = add_optional_measurement_parameters(data_frame, folder) |
|
|
|
|
if quiet: |
|
|
|
|
return data_frame |
|
|
|
|
return _sanity_check(data_frame) |
|
|
|
|