@@ -303,7 +303,7 @@ def __init__(
303303 if statistical_err_treatment == "independent" :
304304 self .statistical_err = np .sqrt (np .sum (self .statistical_err ** 2 , axis = 0 ))
305305 elif statistical_err_treatment == "difference" :
306- self .statistical_err = np .diff (self .statistical_err , axis = 0 )
306+ self .statistical_err = - np .diff (self .statistical_err , axis = 0 )
307307 else :
308308 raise ValueError (
309309 f"Unknown statistical_err_treatment option: { statistical_err_treatment } "
@@ -898,7 +898,7 @@ def get_symbol(A, Z, Ex=None):
898898 return f"$^{{{ A } }}${ str (periodictable .elements [Z ])} { ex } "
899899
900900
901- def filter_out_lab_angle (data_set ):
901+ def filter_subentries (data_set , filter_lab_angle = True , min_num_pts = 4 ):
902902 angle_labels = [
903903 l
904904 for l in data_set .labels
@@ -913,12 +913,18 @@ def filter_out_lab_angle(data_set):
913913 )
914914 )
915915 ]
916+
916917 if len (angle_labels ) > 1 :
917918 raise ValueError (f"Too many angle columns: { angle_labels } " )
918919 elif len (angle_labels ) == 0 :
919920 return False
920- else :
921- return "-CM" in angle_labels [0 ]
921+ if min_num_pts is not None :
922+ if data_set .numrows () < min_num_pts :
923+ return False
924+ if filter_lab_angle :
925+ if "-CM" not in angle_labels [0 ]:
926+ return False
927+ return True
922928
923929
924930class ExforEntryAngularDistribution :
@@ -936,10 +942,10 @@ def __init__(
936942 Einc_range : tuple = None ,
937943 Ex_range : tuple = None ,
938944 vocal = False ,
939- filter_subentries = filter_out_lab_angle ,
940945 mass_kwargs = {},
941946 MeasurementClass = AngularDistributionSysStatErr ,
942947 parsing_kwargs = {},
948+ filter_kwargs = {}
943949 ):
944950 r""" """
945951 self .vocal = vocal
@@ -1062,7 +1068,7 @@ def __init__(
10621068 if quantity not in self .exfor_quantities :
10631069 continue
10641070
1065- if not filter_subentries (data_set ):
1071+ if not filter_subentries (data_set , ** filter_kwargs ):
10661072 continue
10671073
10681074 # should be the same for every subentry
0 commit comments