Skip to content

Commit

Permalink
Merge pull request #2035 from dtcenter/feature_2028_madis2nc_profiler_qc
Browse files Browse the repository at this point in the history
Feature 2028 madis2nc profiler qc
  • Loading branch information
hsoh-u authored Feb 2, 2022
2 parents 82d45a9 + 206f74a commit 4da5850
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 45 deletions.
32 changes: 3 additions & 29 deletions met/src/libcode/vx_nc_obs/met_point_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ void MetPointData::init_from_scratch() {
}


////////////////////////////////////////////////////////////////////////

//void MetPointData::allocate() {
// obs_data.allocate();
//}

////////////////////////////////////////////////////////////////////////

void MetPointData::clear() {
Expand Down Expand Up @@ -178,18 +172,10 @@ MetPointDataPython::MetPointDataPython() {

MetPointDataPython::MetPointDataPython(MetPointDataPython &d) {
init_from_scratch();
//obs_data = d.get_point_obs_data();
//header_data = d.get_header_data();
obs_data->assign(*d.get_point_obs_data());
obs_data = new MetPointObsData();
MetPointObsData *from_obs_data = d.get_point_obs_data();
if (from_obs_data) obs_data->assign(*from_obs_data);
header_data.assign(*d.get_header_data());
cout << " DEBUG HS MetPointData(MetPointData &d) is called \n";
cout << " DEBUG HS MetPointData(MetPointData &d) &header_data.lat_array=" << &(header_data.lat_array) << "\n";
cout << " DEBUG HS MetPointData(MetPointData &d) header_data.lat_array.n()=" << header_data.lat_array.n() << "\n";
cout << " DEBUG HS MetPointData(MetPointData &d) header_data.lon_array.n()=" << header_data.lon_array.n() << "\n";
cout << " DEBUG HS MetPointData(MetPointData &d) header_data.elv_array.n()=" << header_data.elv_array.n() << "\n";
cout << " DEBUG HS MetPointData(MetPointData &d) header_data.typ_idx_array.n()=" << header_data.typ_idx_array.n() << "\n";
cout << " DEBUG HS MetPointData(MetPointData &d) header_data.sid_idx_array.n()=" << header_data.sid_idx_array.n() << "\n";
cout << " DEBUG HS MetPointData(MetPointData &d) header_data.vld_idx_array.n()=" << header_data.vld_idx_array.n() << "\n";
}


Expand All @@ -199,17 +185,6 @@ MetPointDataPython::~MetPointDataPython() {
clear();
}

////////////////////////////////////////////////////////////////////////

//void MetPointDataPython::init_from_scratch() {
// nobs = 0;
// nhdr = 0;
// qty_length = 0;
//
// use_var_id = false;
// use_arr_vars = false;
//}


////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -434,4 +409,3 @@ void MetPointHeader::reset_counters() {
}

///////////////////////////////////////////////////////////////////////////////

2 changes: 0 additions & 2 deletions met/src/libcode/vx_pointdata_python/pointdata_python.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ mlog << Error << "\nMetPythonPointDataFile::operator=(const MetPythonPointDataFi

exit ( 1 );

return ( * this );

}


Expand Down
4 changes: 2 additions & 2 deletions met/src/tools/other/madis2nc/madis2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2114,10 +2114,10 @@ void process_madis_profiler(NcFile *&f_in) {
dim[1] = nlvl;
get_nc_data(&var_levels, (float *)levels_arr, dim, cur);

if (IS_VALID_NC(in_uComponentQty_var)) get_nc_data(&in_uComponentQty_var, (char *)uComponentQty_arr, buf_size, i_hdr_s);
if (IS_VALID_NC(in_uComponentQty_var)) get_nc_data(&in_uComponentQty_var, (char *)uComponentQty_arr, dim, cur);
else memset(uComponentQty_arr, 0, buf_size*dim[1]*sizeof(char));

if (IS_VALID_NC(in_vComponentQty_var)) get_nc_data(&in_vComponentQty_var, (char *)vComponentQty_arr, buf_size, i_hdr_s);
if (IS_VALID_NC(in_vComponentQty_var)) get_nc_data(&in_vComponentQty_var, (char *)vComponentQty_arr, dim, cur);
else memset(vComponentQty_arr, 0, buf_size*dim[1]*sizeof(char));

get_filtered_nc_data_2d(in_uComponent_var, (float *)uComponent_arr, dim, cur, "uComponent");
Expand Down
14 changes: 7 additions & 7 deletions met/src/tools/other/mode_time_domain/mtd_file_int.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1206,19 +1206,19 @@ if ( Nobjects == 0 ) return;

old.ObjVolume = new int [Nobjects];

d = old.Data;

for (j=0; j<Nobjects; ++j) old.ObjVolume[j] = 0;

d = old.Data;
if (d) {
for (j=0; j<Nxyt; ++j, ++d) {

for (j=0; j<Nxyt; ++j, ++d) {

k = (int) (*d);
k = (int) (*d);

if ( k == 0 ) continue;
if ( k == 0 ) continue;

old.ObjVolume[k - 1] += 1;
old.ObjVolume[k - 1] += 1;

}
}


Expand Down
15 changes: 10 additions & 5 deletions met/src/tools/other/pb2nc/pb2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1995,11 +1995,16 @@ void process_pbfile(int i_pb) {
}

if(i_msg <= 0) {
mlog << Warning << "\n" << method_name
<< ((n_derived_obs > 0) ? "Saved the derived variables only. " : " ")
<< "No " << (is_prepbufr ? "PrepBufr" : "Bufr")
<< " messages retained from file: "
<< pbfile[i_pb] << "\n\n";
if (n_derived_obs > 0)
mlog << Debug(3) << method_name
<< "Saved the derived variables only. No " << (is_prepbufr ? "PrepBufr" : "Bufr")
<< " messages retained from file: "
<< pbfile[i_pb] << "\n";
else
mlog << Warning << "\n" << method_name
<< "No " << (is_prepbufr ? "PrepBufr" : "Bufr")
<< " messages retained from file: "
<< pbfile[i_pb] << "\n\n";
}

return;
Expand Down

0 comments on commit 4da5850

Please sign in to comment.