fixed small bug for particle classified as thin_noScatt

This commit is contained in:
2024-09-25 10:16:18 +02:00
parent 144fc61978
commit 740a8a1d73

View File

@ -1680,7 +1680,7 @@ def process_hist_and_dist(df, col, flag_col, flag_value, bin_lims, bin_ctrs, dt_
# Resample and calculate histogram
ddf_hist_compact = df_filtered[col].resample(dt_str).agg(
{'result': lambda x: calculate_histogram(x, bin_lims=bin_lims)})
{'result': lambda x: calculate_histogram(x, bin_lims=bin_lims)}) # I might want to add a .fillna(0) here, this would solve the problem of fillna in the resampling function
# Add and filter based on 'original_idx'
ddf_hist_compact[['original_idx']] = df_filtered[['temporary_col']].resample(dt_str).count()
@ -1859,7 +1859,7 @@ def process_pbp_parquet(dir_path_pbp, dir_path_hk,
ddf_pbp['cnts_thin_low_inc_scatt_ratio'] = 0
ddf_pbp['cnts_particles_for_tl_dist'] = 0 # this flag is used for the calculation of time lag distributions below (it includes the particles classfified as "thin" or "thick")
ddf_pbp.loc[~flag_scatt & flag_inc_in_range_tl_analysis, 'thin_noScatt'] = 1
ddf_pbp.loc[~flag_scatt & flag_inc_in_range_tl_analysis, 'cnts_thin_noScatt'] = 1
ddf_pbp.loc[flag_scatt & flag_scatt_not_sat & flag_inc_in_range_tl_analysis & flag_timelag_0_50 & ~flag_low_ratio_inc_scatt, 'cnts_thin'] = 1
ddf_pbp.loc[flag_scatt & flag_scatt_not_sat & flag_inc_in_range_tl_analysis & flag_timelag_0_50 & flag_low_ratio_inc_scatt, 'cnts_thin_low_inc_scatt_ratio'] = 1
ddf_pbp.loc[flag_scatt & flag_scatt_not_sat & flag_inc_in_range_tl_analysis & flag_timelag_greater_50 & ~flag_extreme_positive_timelag, 'cnts_thick'] = 1