bp / resqpy

Python API for working with RESQML models
https://resqpy.readthedocs.io/en/latest/
MIT License
53 stars 13 forks source link

Grid geometry: ParametricLine type support #723

Closed marcusapel closed 1 year ago

marcusapel commented 1 year ago

Hello, when loading a RESQML grid (exported from RMS 14.1) I get an Error:

grid = model.grid(title = 'Geo_model', uuid = grid_uuid) #ValueError: grid geometry points type not supported: Point3dParametricArray

The grid type used is ParametricLine type. It has the concept of coordinate lines and a buffer of z values of size (ni+1)(nj+1)(nk+1). [ni,nj,nk] being the size of the grid. The format of this grid type resembles the Eclipse GRDECL format, and is most efficient in size. Is there a known solution to handle this grid type in resqpy? How much effort would it be to support it? Below is the xml description of the grid:

<?xml version="1.0" encoding="UTF-8"?>
<resqml2:IjkGridRepresentation xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:dc="http://purl.org/dc/terms/" xmlns:resqml1="http://www.resqml.org/schemas/1series" xmlns:resqml2="http://www.energistics.org/energyml/data/resqmlv2" xmlns:witsml1="http://www.witsml.org/schemas/1series" xmlns:eml="http://www.energistics.org/energyml/data/commonv2" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:ptm="http://www.f2i-consulting.com/PropertyTypeMapping" xmlns:abstract="http://www.energistics.org/schemas/abstract" schemaVersion="2.0" uuid="918073a4-587a-4f79-a855-6efae13b4147" xsi:type="resqml2:obj_IjkGridRepresentation">
    <eml:Citation xsi:type="eml:Citation">
        <eml:Title xsi:type="eml:DescriptionString">grid</eml:Title>
        <eml:Originator xsi:type="eml:NameString">MAAP</eml:Originator>
        <eml:Creation xsi:type="xsd:dateTime">2023-04-20T11:39:00Z</eml:Creation>
        <eml:Format xsi:type="eml:DescriptionString">Roxar</eml:Format>
    </eml:Citation>
    <resqml2:ExtraMetadata xsi:type="resqml2:NameValuePair">
        <resqml2:Name xsi:type="xsd:string">pdgm/dx/resqml/creatorGroup</resqml2:Name>
        <resqml2:Value xsi:type="xsd:string">MAAP</resqml2:Value>
    </resqml2:ExtraMetadata>
    <resqml2:ExtraMetadata xsi:type="resqml2:NameValuePair">
        <resqml2:Name xsi:type="xsd:string">pdgm/dx/resqml/project</resqml2:Name>
        <resqml2:Value xsi:type="xsd:string">aac247ed-8d34-4315-ae40-6c711bee552f</resqml2:Value>
    </resqml2:ExtraMetadata>
    <resqml2:Nk xsi:type="xsd:positiveInteger">51</resqml2:Nk>
    <resqml2:Ni xsi:type="xsd:positiveInteger">13</resqml2:Ni>
    <resqml2:Nj xsi:type="xsd:positiveInteger">21</resqml2:Nj>
    <resqml2:Geometry xsi:type="resqml2:IjkGridGeometry">
        <resqml2:LocalCrs xsi:type="eml:DataObjectReference">
            <eml:ContentType xsi:type="xsd:string">application/x-resqml+xml;version=2.0;type=obj_LocalDepth3dCrs</eml:ContentType>
            <eml:Title xsi:type="eml:DescriptionString">Local Depth CRS</eml:Title>
            <eml:UUID xsi:type="eml:UuidString">0cfadc42-2a7b-4510-bbb6-e86b16bfac94</eml:UUID>
            <eml:UuidAuthority xsi:type="xsd:string">pdgm</eml:UuidAuthority>
        </resqml2:LocalCrs>
        <resqml2:Points xsi:type="resqml2:Point3dParametricArray">
            <resqml2:Parameters xsi:type="resqml2:DoubleHdf5Array">
                <resqml2:Values xsi:type="eml:Hdf5Dataset">
                    <eml:PathInHdfFile xsi:type="xsd:string">/RESQML/918073a4-587a-4f79-a855-6efae13b4147/parameters</eml:PathInHdfFile>
                    <eml:HdfProxy xsi:type="eml:DataObjectReference">
                        <eml:ContentType xsi:type="xsd:string">application/x-eml+xml;version=2.0;type=obj_EpcExternalPartReference</eml:ContentType>
                        <eml:Title xsi:type="eml:DescriptionString">C:\Users\maap\OneDrive - Equinor\Resqml\volve\3dgrid.h5</eml:Title>
                        <eml:UUID xsi:type="eml:UuidString">96d84de7-0e38-48d9-b57c-f3546b62f4fc</eml:UUID>
                        <eml:UuidAuthority xsi:type="xsd:string">pdgm</eml:UuidAuthority>
                        <eml:VersionString xsi:type="eml:NameString">2023-05-11T10:29:49Z</eml:VersionString>
                    </eml:HdfProxy>
                </resqml2:Values>
            </resqml2:Parameters>
            <resqml2:ParametricLines xsi:type="resqml2:ParametricLineArray">
                <resqml2:ControlPointParameters xsi:type="resqml2:DoubleHdf5Array">
                    <resqml2:Values xsi:type="eml:Hdf5Dataset">
                        <eml:PathInHdfFile xsi:type="xsd:string">/RESQML/918073a4-587a-4f79-a855-6efae13b4147/controlPointParameters</eml:PathInHdfFile>
                        <eml:HdfProxy xsi:type="eml:DataObjectReference">
                            <eml:ContentType xsi:type="xsd:string">application/x-eml+xml;version=2.0;type=obj_EpcExternalPartReference</eml:ContentType>
                            <eml:Title xsi:type="eml:DescriptionString">C:\Users\maap\OneDrive - Equinor\Resqml\volve\3dgrid.h5</eml:Title>
                            <eml:UUID xsi:type="eml:UuidString">96d84de7-0e38-48d9-b57c-f3546b62f4fc</eml:UUID>
                            <eml:UuidAuthority xsi:type="xsd:string">pdgm</eml:UuidAuthority>
                            <eml:VersionString xsi:type="eml:NameString">2023-05-11T10:29:49Z</eml:VersionString>
                        </eml:HdfProxy>
                    </resqml2:Values>
                </resqml2:ControlPointParameters>
                <resqml2:ControlPoints xsi:type="resqml2:Point3dHdf5Array">
                    <resqml2:Coordinates xsi:type="eml:Hdf5Dataset">
                        <eml:PathInHdfFile xsi:type="xsd:string">/RESQML/918073a4-587a-4f79-a855-6efae13b4147/controlPoints</eml:PathInHdfFile>
                        <eml:HdfProxy xsi:type="eml:DataObjectReference">
                            <eml:ContentType xsi:type="xsd:string">application/x-eml+xml;version=2.0;type=obj_EpcExternalPartReference</eml:ContentType>
                            <eml:Title xsi:type="eml:DescriptionString">C:\Users\maap\OneDrive - Equinor\Resqml\volve\3dgrid.h5</eml:Title>
                            <eml:UUID xsi:type="eml:UuidString">96d84de7-0e38-48d9-b57c-f3546b62f4fc</eml:UUID>
                            <eml:UuidAuthority xsi:type="xsd:string">pdgm</eml:UuidAuthority>
                            <eml:VersionString xsi:type="eml:NameString">2023-05-11T10:29:49Z</eml:VersionString>
                        </eml:HdfProxy>
                    </resqml2:Coordinates>
                </resqml2:ControlPoints>
                <resqml2:KnotCount xsi:type="xsd:positiveInteger">2</resqml2:KnotCount>
                <resqml2:LineKindIndices xsi:type="resqml2:IntegerConstantArray">
                    <resqml2:Value xsi:type="xsd:integer">1</resqml2:Value>
                    <resqml2:Count xsi:type="xsd:positiveInteger">308</resqml2:Count>
                </resqml2:LineKindIndices>
            </resqml2:ParametricLines>
        </resqml2:Points>
        <resqml2:KDirection xsi:type="resqml2:KDirection">down</resqml2:KDirection>
        <resqml2:PillarGeometryIsDefined xsi:type="resqml2:BooleanConstantArray">
            <resqml2:Value xsi:type="xsd:boolean">true</resqml2:Value>
            <resqml2:Count xsi:type="xsd:positiveInteger">308</resqml2:Count>
        </resqml2:PillarGeometryIsDefined>
        <resqml2:PillarShape xsi:type="resqml2:PillarShape">straight</resqml2:PillarShape>
        <resqml2:CellGeometryIsDefined xsi:type="resqml2:BooleanConstantArray">
            <resqml2:Value xsi:type="xsd:boolean">true</resqml2:Value>
            <resqml2:Count xsi:type="xsd:positiveInteger">13923</resqml2:Count>
        </resqml2:CellGeometryIsDefined>
        <resqml2:SplitCoordinateLines xsi:type="resqml2:ColumnLayerSplitCoordinateLines">
            <resqml2:Count xsi:type="xsd:positiveInteger">10</resqml2:Count>
            <resqml2:PillarIndices xsi:type="resqml2:IntegerHdf5Array">
                <resqml2:NullValue xsi:type="xsd:integer">0</resqml2:NullValue>
                <resqml2:Values xsi:type="eml:Hdf5Dataset">
                    <eml:PathInHdfFile xsi:type="xsd:string">/RESQML/918073a4-587a-4f79-a855-6efae13b4147/PillarIndices</eml:PathInHdfFile>
                    <eml:HdfProxy xsi:type="eml:DataObjectReference">
                        <eml:ContentType xsi:type="xsd:string">application/x-eml+xml;version=2.0;type=obj_EpcExternalPartReference</eml:ContentType>
                        <eml:Title xsi:type="eml:DescriptionString">C:\Users\maap\OneDrive - Equinor\Resqml\volve\3dgrid.h5</eml:Title>
                        <eml:UUID xsi:type="eml:UuidString">96d84de7-0e38-48d9-b57c-f3546b62f4fc</eml:UUID>
                        <eml:UuidAuthority xsi:type="xsd:string">pdgm</eml:UuidAuthority>
                        <eml:VersionString xsi:type="eml:NameString">2023-05-11T10:29:49Z</eml:VersionString>
                    </eml:HdfProxy>
                </resqml2:Values>
            </resqml2:PillarIndices>
            <resqml2:ColumnsPerSplitCoordinateLine xsi:type="resqml2:ResqmlJaggedArray">
                <resqml2:Elements xsi:type="resqml2:IntegerHdf5Array">
                    <resqml2:NullValue xsi:type="xsd:integer">-9999</resqml2:NullValue>
                    <resqml2:Values xsi:type="eml:Hdf5Dataset">
                        <eml:PathInHdfFile xsi:type="xsd:string">/RESQML/918073a4-587a-4f79-a855-6efae13b4147/ColumnsPerSplitCoordinateLine/elements</eml:PathInHdfFile>
                        <eml:HdfProxy xsi:type="eml:DataObjectReference">
                            <eml:ContentType xsi:type="xsd:string">application/x-eml+xml;version=2.0;type=obj_EpcExternalPartReference</eml:ContentType>
                            <eml:Title xsi:type="eml:DescriptionString">C:\Users\maap\OneDrive - Equinor\Resqml\volve\3dgrid.h5</eml:Title>
                            <eml:UUID xsi:type="eml:UuidString">96d84de7-0e38-48d9-b57c-f3546b62f4fc</eml:UUID>
                            <eml:UuidAuthority xsi:type="xsd:string">pdgm</eml:UuidAuthority>
                            <eml:VersionString xsi:type="eml:NameString">2023-05-11T10:29:49Z</eml:VersionString>
                        </eml:HdfProxy>
                    </resqml2:Values>
                </resqml2:Elements>
                <resqml2:CumulativeLength xsi:type="resqml2:IntegerHdf5Array">
                    <resqml2:NullValue xsi:type="xsd:integer">-9999</resqml2:NullValue>
                    <resqml2:Values xsi:type="eml:Hdf5Dataset">
                        <eml:PathInHdfFile xsi:type="xsd:string">/RESQML/918073a4-587a-4f79-a855-6efae13b4147/ColumnsPerSplitCoordinateLine/cumulativeLength</eml:PathInHdfFile>
                        <eml:HdfProxy xsi:type="eml:DataObjectReference">
                            <eml:ContentType xsi:type="xsd:string">application/x-eml+xml;version=2.0;type=obj_EpcExternalPartReference</eml:ContentType>
                            <eml:Title xsi:type="eml:DescriptionString">C:\Users\maap\OneDrive - Equinor\Resqml\volve\3dgrid.h5</eml:Title>
                            <eml:UUID xsi:type="eml:UuidString">96d84de7-0e38-48d9-b57c-f3546b62f4fc</eml:UUID>
                            <eml:UuidAuthority xsi:type="xsd:string">pdgm</eml:UuidAuthority>
                            <eml:VersionString xsi:type="eml:NameString">2023-05-11T10:29:49Z</eml:VersionString>
                        </eml:HdfProxy>
                    </resqml2:Values>
                </resqml2:CumulativeLength>
            </resqml2:ColumnsPerSplitCoordinateLine>
        </resqml2:SplitCoordinateLines>
        <resqml2:GridIsRighthanded xsi:type="xsd:boolean">false</resqml2:GridIsRighthanded>
    </resqml2:Geometry>
</resqml2:IjkGridRepresentation>
andy-beer commented 1 year ago

I've started work on this issue @marcusapel – hopefully will have some functionality in resqpy sometime next week. A couple of things to note:

andy-beer commented 1 year ago

This issue is resolved by pull request #756, which is included in tagged release v4.10.0 for your information: @marcusapel