Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix 2884 point2grid no qc #2885

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions src/tools/other/point2grid/point2grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@ void regrid_goes_variable(NcFile *nc_in, VarInfo *vinfo,
}

// Filter by QC flag
if (has_qc_var || has_adp_qc_var) {
if (has_qc_flags && (has_qc_var || has_adp_qc_var)) {
qc_value = qc_data[from_index];
if (mlog.verbosity_level() >= log_debug_level) {
if (qc_min_value > qc_value) qc_min_value = qc_value;
Expand All @@ -2628,8 +2628,6 @@ void regrid_goes_variable(NcFile *nc_in, VarInfo *vinfo,
}
if (has_adp_qc_var) {
int qc_for_flag = compute_adp_qc_flag(adp_qc_data[from_index], shift_bits);
bool filter_out = is_eq(qc_for_flag, bad_data_int);

if (mlog.verbosity_level() >= log_debug_level) {
switch (qc_for_flag) {
case 0: cnt_adp_qc_high++; break;
Expand All @@ -2639,6 +2637,7 @@ void regrid_goes_variable(NcFile *nc_in, VarInfo *vinfo,
}
}

bool filter_out = is_eq(qc_for_flag, bad_data_int);
if (!filter_out) {
/* Adjust the quality by AOD data QC */
if (2 == qc_value) {
Expand All @@ -2659,7 +2658,7 @@ void regrid_goes_variable(NcFile *nc_in, VarInfo *vinfo,
continue;
}
}
else if (has_qc_var && has_qc_flags && !qc_flags.has(qc_value)) {
else if (has_qc_var && !qc_flags.has(qc_value)) {
qc_filtered_count++;
continue;
}
Expand Down Expand Up @@ -2710,19 +2709,21 @@ void regrid_goes_variable(NcFile *nc_in, VarInfo *vinfo,
<< ", by absent: " << absent_count
<< ", total: " << (qc_filtered_count + adp_qc_filtered_count + absent_count)
<< "\n Range: data: [" << from_min_value << " - " << from_max_value
<< "] QC: [" << qc_min_value << " - " << qc_max_value << "]"
<< "\n AOD QC: high=" << cnt_aod_qc_high
<< " medium=" << cnt_aod_qc_medium << ", low=" << cnt_aod_qc_low
<< ", no_retrieval=" << cnt_aod_qc_nr
<< "\n ADP QC: high=" << cnt_adjused_high << " (" << cnt_adp_qc_high
<< "), medium=" << cnt_adjused_medium << " (" << cnt_adp_qc_medium
<< "), low=" << cnt_adjused_low << " (" << cnt_adp_qc_low
<< "), no_retrieval=" << cnt_adp_qc_nr
<< "\n adjusted: high to medium=" << cnt_adp_qc_high_to_medium
<< ", high to low=" << cnt_adp_qc_high_to_low
<< ", medium to low=" << cnt_adp_qc_medium_to_low
<< ", total=" << cnt_adjused_total
<< "\n";
<< "] QC: [" << qc_min_value << " - " << qc_max_value << "]\n";
if (has_qc_flags)
mlog << Debug(log_debug_level)
<< " AOD QC: high=" << cnt_aod_qc_high
<< " medium=" << cnt_aod_qc_medium << ", low=" << cnt_aod_qc_low
<< ", no_retrieval=" << cnt_aod_qc_nr
<< "\n ADP QC: high=" << cnt_adjused_high << " (" << cnt_adp_qc_high
<< "), medium=" << cnt_adjused_medium << " (" << cnt_adp_qc_medium
<< "), low=" << cnt_adjused_low << " (" << cnt_adp_qc_low
<< "), no_retrieval=" << cnt_adp_qc_nr
<< "\n adjusted: high to medium=" << cnt_adp_qc_high_to_medium
<< ", high to low=" << cnt_adp_qc_high_to_low
<< ", medium to low=" << cnt_adp_qc_medium_to_low
<< ", total=" << cnt_adjused_total
<< "\n";


if (to_cell_count == 0) {
Expand Down Expand Up @@ -2938,7 +2939,6 @@ void set_adp_gc_values(NcVar var_adp_qc) {

if (get_nc_att_values(&var_adp_qc, att_name_values, flag_values)) {
int idx;
StringArray flag_meanings = to_lower(att_flag_meanings).split(" ");
if (flag_meanings.has("low_confidence_smoke_detection_qf", idx)) {
adp_qc_low = (flag_values[idx] >> 2) & 0x03;
}
Expand Down