Skip to content
Permalink
Browse files

update MDAL to 0.4.95 : add proper reference time for TUFLOWFV format

  • Loading branch information
PeterPetrik committed Jan 17, 2020
1 parent 830e080 commit 19deb05edc92ed0446a2f377ced96d6447f59048
@@ -254,6 +254,9 @@ MDAL::DateTime MDAL::DriverCF::parseTime( std::vector<RelativeTimestamp> &times
std::string timeUnitInformation = mNcFile->getAttrStr( timeArrName, "units" );
std::string calendar = mNcFile->getAttrStr( timeArrName, "calendar" );
MDAL::DateTime referenceTime = parseCFReferenceTime( timeUnitInformation, calendar );
if ( !referenceTime.isValid() )
referenceTime = defaultReferenceTime();

MDAL::RelativeTimestamp::Unit unit = parseCFTimeUnit( timeUnitInformation );

times = std::vector<RelativeTimestamp>( nTimesteps );
@@ -317,6 +320,12 @@ bool MDAL::DriverCF::canReadMesh( const std::string &uri )
return true;
}

MDAL::DateTime MDAL::DriverCF::defaultReferenceTime() const
{
// return invalid reference time
return DateTime();
}

void MDAL::DriverCF::setProjection( MDAL::Mesh *mesh )
{
std::string coordinate_system_variable = getCoordinateSystemVariableName();
@@ -136,9 +136,14 @@ namespace MDAL
const MDAL::CFDatasetGroupInfo &dsi,
double fill_val_x, double fill_val_y );

//! Returns the default reference time
virtual DateTime defaultReferenceTime() const;

void setProjection( MDAL::Mesh *m );
cfdataset_info_map parseDatasetGroupInfo();
DateTime parseTime( std::vector<RelativeTimestamp> &times ); //Return the reference time

//! Populates the times array and returns the reference time
DateTime parseTime( std::vector<RelativeTimestamp> &times );
void addDatasetGroups( Mesh *mesh,
const std::vector<RelativeTimestamp> &times,
const cfdataset_info_map &dsinfo_map, const DateTime &referenceTime );
@@ -389,6 +389,11 @@ void MDAL::DriverTuflowFV::populateFaces( MDAL::Faces &faces )
}
}

MDAL::DateTime MDAL::DriverTuflowFV::defaultReferenceTime() const
{
return DateTime( 1990, 1, 1 );
}

void MDAL::DriverTuflowFV::calculateMaximumLevelCount()
{
if ( mMaximumLevelsCount < 0 )
@@ -140,6 +140,7 @@ namespace MDAL
void addBedElevationDatasetOnFaces();
void populateVertices( MDAL::Vertices &vertices );
void populateFaces( MDAL::Faces &faces );
virtual DateTime defaultReferenceTime() const override;

void calculateMaximumLevelCount();
int mMaximumLevelsCount = -1;
@@ -22,7 +22,7 @@ static MDAL_Status sLastStatus;

const char *MDAL_Version()
{
return "0.4.94";
return "0.4.95";
}

MDAL_Status MDAL_LastStatus()

0 comments on commit 19deb05

Please sign in to comment.
You can’t perform that action at this time.