mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5792 Python : Add import_summary_case and find summary case from ID
Add example of use and updated documentation
This commit is contained in:
committed by
Gaute Lindkvist
parent
dfc93164d0
commit
8662ff90d2
@@ -225,22 +225,31 @@ caf::PdmObjectHandle* RimSummaryCase_resampleValues::execute()
|
||||
QString periodString = m_resamplingPeriod().trimmed();
|
||||
RiaQDateTimeTools::DateTimePeriod period = RiaQDateTimeTools::DateTimePeriodEnum::fromText( periodString );
|
||||
|
||||
RiaTimeHistoryCurveResampler resampler;
|
||||
resampler.setCurveData( values, timeValues );
|
||||
auto dataObject = new RimcSummaryResampleData();
|
||||
|
||||
if ( RiaSummaryTools::hasAccumulatedData( adr ) )
|
||||
if ( period != RiaQDateTimeTools::DateTimePeriod::NONE )
|
||||
{
|
||||
resampler.resampleAndComputePeriodEndValues( period );
|
||||
RiaTimeHistoryCurveResampler resampler;
|
||||
resampler.setCurveData( values, timeValues );
|
||||
|
||||
if ( RiaSummaryTools::hasAccumulatedData( adr ) )
|
||||
{
|
||||
resampler.resampleAndComputePeriodEndValues( period );
|
||||
}
|
||||
else
|
||||
{
|
||||
resampler.resampleAndComputeWeightedMeanValues( period );
|
||||
}
|
||||
|
||||
dataObject->m_timeValues = resampler.resampledTimeSteps();
|
||||
dataObject->m_doubleValues = resampler.resampledValues();
|
||||
}
|
||||
else
|
||||
{
|
||||
resampler.resampleAndComputeWeightedMeanValues( period );
|
||||
dataObject->m_timeValues = timeValues;
|
||||
dataObject->m_doubleValues = values;
|
||||
}
|
||||
|
||||
auto dataObject = new RimcSummaryResampleData();
|
||||
dataObject->m_timeValues = resampler.resampledTimeSteps();
|
||||
dataObject->m_doubleValues = resampler.resampledValues();
|
||||
|
||||
return dataObject;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user