Skip to content

Commit

Permalink
Bugfix #2306 ascii2nc airnow hourly (#2314)
Browse files Browse the repository at this point in the history
Co-authored-by: Dave Albo <dave@seneca.rap.ucar.edu>
  • Loading branch information
davidalbo and Dave Albo authored Oct 25, 2022
1 parent 011f6ab commit 82e5833
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/tools/other/ascii2nc/airnow_locations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,27 @@ bool AirnowLocations::lookupLatLonElev(const string aqsid, double &lat, double &
{
string method_name = "AirnowLocations::lookupLatLonElev()";

int index = -1;
vector<string>::const_iterator it = find(monitoringSiteAqsid.begin(), monitoringSiteAqsid.end(), aqsid);
if (it == monitoringSiteAqsid.end()) {
it = find(monitoringSiteStationId.begin(), monitoringSiteStationId.end(), aqsid);
if (it == monitoringSiteStationId.end()) {
it = find(monitoringSiteFullAqsid.begin(), monitoringSiteFullAqsid.end(), aqsid);
if (it == monitoringSiteFullAqsid.end()) {
return false;
} else {
index = (int)(it - monitoringSiteStationId.begin());
}
} else {
index = (int)(it - monitoringSiteFullAqsid.begin());
}
} else {
index = (int)(it - monitoringSiteAqsid.begin());
}
if (index < 0) {
return false;
}
int index = (int)(it - monitoringSiteAqsid.begin());

lat = monitoringSiteLat[index];
lon = monitoringSiteLon[index];
elev = monitoringSiteElev[index];
Expand Down

0 comments on commit 82e5833

Please sign in to comment.