Skip to content

Commit b96d85b

Browse files
committed
Changes made for run of AutoQC for paper.
1 parent bc4f85b commit b96d85b

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

analyse-results.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def find_roc(table,
7171
filter_from_file_spec=True,
7272
enforce_types_of_check=True,
7373
n_profiles_to_analyse=np.iinfo(np.int32).max,
74-
n_combination_iterations=1,
74+
n_combination_iterations=0,
7575
with_reverses=False,
7676
effectiveness_ratio=2.0,
7777
improve_threshold=1.0,
@@ -319,9 +319,9 @@ def find_roc(table,
319319
# python analyse-results.py <database table name> <number of profiles to extract> <flag to generate a conservative set of QC tests - can be any value>
320320

321321
if len(sys.argv) == 3:
322-
find_roc(sys.argv[1], n_profiles_to_analyse=sys.argv[2])
322+
find_roc(sys.argv[1], n_profiles_to_analyse=sys.argv[2], costratio=[2.0, 2.0])
323323
elif len(sys.argv) == 4:
324-
find_roc(sys.argv[1], n_profiles_to_analyse=sys.argv[2], costratio=[10.0, 10.0])
324+
find_roc(sys.argv[1], n_profiles_to_analyse=sys.argv[2], costratio=[5.0, 5.0])
325325
else:
326326
print 'Usage - python analyse_results.py tablename <number of profiles to train ROC curve on> <optional character or number to indicate that we want a conservative set of QC tests i.e. with very low false positive rate>'
327327

qctest_groups.csv

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Range,At least one from group,CoTeDe_GTSPP_global_range,
1111
Range,At least one from group,CoTeDe_GTSPP_profile_envelop,
1212
Range,At least one from group,EN_range_check,
1313
Range,At least one from group,ICDC_aqc_02_crude_range,
14-
Range,At least one from group,ICDC_aqc_06_n_temperature_extrema,
14+
Range,Optional,ICDC_aqc_06_n_temperature_extrema,
1515
Range,At least one from group,WOD_range_check,
1616
Gradient,At least one from group,AOML_gradient,
1717
Gradient,At least one from group,Argo_gradient_test,
@@ -39,7 +39,7 @@ Density,At least one from group,CoTeDe_Argo_density_inversion,
3939
Density,At least one from group,EN_stability_check,
4040
Climatology,At least one from group,AOML_climatology_test,
4141
Climatology,At least one from group,CoTeDe_GTSPP_WOA_normbias,
42-
Climatology,At least one from group,CoTeDe_tukey53H_norm,
42+
Spike or step,At least one from group,CoTeDe_tukey53H_norm,
4343
Climatology,At least one from group,CoTeDe_WOA_normbias,
4444
Climatology,At least one from group,EN_background_check,
4545
Climatology,At least one from group,EN_std_lev_bkg_and_buddy_check,

util/dbutils.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def unpack_qc_results(results):
8383
def db_to_df(table,
8484
filter_on_wire_break_test=False,
8585
filter_on_tests={},
86-
n_to_extract=numpy.iinfo(numpy.int32).max):
86+
n_to_extract=numpy.iinfo(numpy.int32).max,
87+
applyparse=True):
8788

8889
'''
8990
Reads the table from iquod.db into a pandas dataframe.
@@ -169,13 +170,15 @@ def db_to_df(table,
169170
df.iat[i, j] = main.pack_array(qc)
170171

171172
del df[testname] # No need to keep this any longer.
173+
df.reset_index(inplace=True, drop=True)
172174

173175
todrop = list(todrop)
174176
if len(todrop) > 0:
175177
df.drop(todrop, inplace=True)
176178
df.reset_index(inplace=True, drop=True)
177179
testNames = df.columns[2:].values.tolist()
178-
df[['Truth']] = df[['Truth']].apply(parse_truth)
179-
df[testNames] = df[testNames].apply(parse)
180+
if applyparse:
181+
df[['Truth']] = df[['Truth']].apply(parse_truth)
182+
df[testNames] = df[testNames].apply(parse)
180183

181184
return df

0 commit comments

Comments
 (0)