1
Basic functionality and features (GeoDict Base Package) / Re: Extract saturated structures with Python
« on: May 23, 2024, 04:03:11 PM »
Hi,
yes, there is. The values can be found in the Resultmap. Thus, you can access them from Python via the stringmap package. Find a detailed description for the stringmap options in the GeoPy Scripting User Guide on page 81 (https://www.math2market.com/fileadmin/UserGuide/GeoDict2024/Automation2024.pdf). Below find an example how the file with the saturation closest to 0.5 can be found.
yes, there is. The values can be found in the Resultmap. Thus, you can access them from Python via the stringmap package. Find a detailed description for the stringmap options in the GeoPy Scripting User Guide on page 81 (https://www.math2market.com/fileadmin/UserGuide/GeoDict2024/Automation2024.pdf). Below find an example how the file with the saturation closest to 0.5 can be found.
Code: [Select]
import stringmap
gdr = stringmap.parseGDR("CapillaryPressureResult.gdr")
gdr.push("ResultMap")
saturationlist = gdr.getList("SaturationInvading")
print(saturationlist)
def getSaturationIndex(saturationvalue):
saturationdifference = 1
for saturation in saturationlist:
diff = abs(saturationvalue-float(saturation))
print(diff)
if diff < saturationdifference:
saturationdifference=diff
else:
saturationindex = saturationlist.index(saturation)
break
return saturationindex
file = f"CapillaryPressureResult/Step_{getSaturationIndex(0.5):06}.gdt"