Skip to content

Commit

Permalink
Merge commit 'aefa16d967e09a4258ad64ece18e94eab5443e95'
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Dec 11, 2023
2 parents 11a5ea0 + aefa16d commit 44a2b1f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions agrolib/netcdfHandler/netcdfHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ void NetCDFHandler::clear()
variables.clear();
metadata.str("");
timeUnit = "";

missingValue = NODATA;
}


Expand Down Expand Up @@ -525,11 +527,25 @@ bool NetCDFHandler::readProperties(string fileName)
else if (ncTypeId == NC_INT)
{
nc_get_att(ncId, v, attrName, &valueInt);

// no data
if (lowerCase(string(attrName)) == "missing_value" || lowerCase(string(attrName)) == "nodata")
{
missingValue = double(valueInt);
}

metadata << attrName << " = " << valueInt << endl;
}
else if (ncTypeId == NC_DOUBLE)
{
nc_get_att(ncId, v, attrName, &value);

// no data
if (lowerCase(string(attrName)) == "missing_value" || lowerCase(string(attrName)) == "nodata")
{
missingValue = value;
}

metadata << attrName << " = " << value << endl;
}
}
Expand Down Expand Up @@ -1131,6 +1147,7 @@ bool NetCDFHandler::extractVariableMap(int idVar, const Crit3DTime& myTime, std:
}
default:
{
delete[] values;
errorStr = "Wrong variable type.";
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions agrolib/netcdfHandler/netcdfHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
bool isHourly;
bool isDaily;

double missingValue;

gis::Crit3DLatLonHeader latLonHeader;

NetCDFHandler();
Expand Down

0 comments on commit 44a2b1f

Please sign in to comment.