Skip to content

Commit

Permalink
#1755 Support time string for slicing at MetNcCFDataFile::collect_tim…
Browse files Browse the repository at this point in the history
…e_offsets
  • Loading branch information
Howard Soh committed Apr 15, 2021
1 parent a2bad6c commit aa02a0e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions met/src/libcode/vx_data2d_nccf/data2d_nccf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,18 @@ LongArray MetNcCFDataFile::collect_time_offsets(VarInfo &vinfo) {
}
}
}
else if (time_as_value) {
idx = convert_time_to_offset(dim_offset);
if (0 <= idx && idx < time_dim_size) time_offsets.add(idx);
}
else if (0 <= time_dim_slot && dim_offset < time_dim_size)
time_offsets.add(dim_offset);
else error_code = error_code_unknown;

if (0 < time_offsets.n_elements())
mlog << Debug(7) << method_name << " Found " << time_offsets.n_elements()
<< " times from between "
int time_count = time_offsets.n_elements();
if (0 < time_count)
mlog << Debug(7) << method_name << " Found " << time_count
<< (time_count==1 ? " time" : " times") << " between "
<< unix_to_yyyymmdd_hhmmss(_file->ValidTime[0]) << " and "
<< unix_to_yyyymmdd_hhmmss(_file->ValidTime[time_dim_size-1]) << "\n";
else {
Expand Down

0 comments on commit aa02a0e

Please sign in to comment.