コード例 #1
0
    def get_trajectorys(self,
                        q_traj: witsml.obj_trajectory,
                        returnElements: str = 'id-only') -> witsml.trajectorys:
        '''Get trajectorys from a witsml store server
    
        The default is only to return id-only, change to all when you know what trajectory to get.
        Pass an empty trajectory with returnElements id-only to get all by id.
    
        Args:
            q_traj (witsml.obj_trajectory): A query trajectory specifing objects to return
            returnElements (str): String describing data to get on of [all, id-only, header-only, data-only, station-location-only
                                                                       latest-change-only, requested]
        Returns:
            witsml.trajectorys: trajectorys, a collection of trajectory
        
        Raises:
            StoreException: If the soap server replies with an error
            pyxb.exception: If the reply is empty or the document fails to validate a pyxb exception is raised
        '''

        q_trajs = witsml.trajectorys(version=witsml.__version__)

        q_trajs.append(q_traj)

        reply_traj = self.soap_client.service.WMLS_GetFromStore(
            'trajectory',
            q_trajs.toxml(),
            OptionsIn=f'returnElements={returnElements}')

        return _parse_reply(reply_traj)
コード例 #2
0
ファイル: soap_client.py プロジェクト: javier1nc/komle
    def get_trajectorys(
            self,
            q_traj: witsml.obj_trajectory,
            OptionsIn: str = 'returnElements=id-only') -> witsml.trajectorys:
        '''Get trajectorys from a witsml store server
    
        The default is only to return returnElements=id-only, change to all when you know what trajectory to get.
        Pass an empty trajectory with OptionsIn returnElements=id-only to get all by id.
    
        Args:
            q_traj (witsml.obj_trajectory): A query trajectory specifing objects to return
            OptionsIn (str): String describing data to get on of [returnElements=all, returnElements=id-only, returnElements=header-only, 
                                                                       returnElements=data-only, returnElements=station-location-only,
                                                                       returnElements=latest-change-only, returnElements=requested,
                                                                       returnElements=data-only;requestLatestValues=500]
        Returns:
            witsml.trajectorys: trajectorys, a collection of trajectory
        
        Raises:
            pyxb.exception: If the reply is empty or the document fails to validate a pyxb exception is raised
        '''

        q_trajs = witsml.trajectorys(version=witsml.__version__)

        q_trajs.append(q_traj)

        QueryIn = q_trajs.toxml()

        #OptionsIn=f'returnElements={returnElements}

        reply_traj = self.soap_client.service.WMLS_GetFromStore(
            'trajectory', QueryIn, OptionsIn)

        return witsml.CreateFromDocument(reply_traj.XMLout)
コード例 #3
0
ファイル: test_write_bindings.py プロジェクト: sveinhov/komle
def test_trajecorys():
    from komle.bindings.v1411.write import witsml
    trajs = witsml.trajectorys(version=witsml.__version__)

    traj = witsml.obj_trajectory(uidWell='4',
                                 uidWellbore='5',
                                 uid='6',
                                 nameWell='SomeWell2',
                                 nameWellbore='SomeWellbore',
                                 name='SomeName2')
    traj.objectGrowing = False
    traj.mdMn = 0
    traj.mdMn.uom = 'm'
    traj.mdMx = 1000
    traj.mdMx.uom = 'm'
    traj.serviceCompany = 'Tigergutt'
    traj_station = witsml.cs_trajectoryStation(uid='myuid')
    traj_station.typeTrajStation = 'unknown'
    traj_station.md, traj_station.md.uom = 40, 'm'

    traj_station.tvd, traj_station.tvd.uom = 40.1, 'm'
    traj_station.incl, traj_station.incl.uom = 0.2, 'dega'
    traj_station.azi, traj_station.azi.uom = 0.1, 'dega'
    traj_station.dispNs, traj_station.dispNs.uom = 28.0, 'm'
    traj_station.dispEw, traj_station.dispEw.uom = 2.2, 'm'
    traj_station.vertSect, traj_station.vertSect.uom = 0, 'm'
    traj_station.dls, traj_station.dls.uom = 0, 'dega/m'

    traj.trajectoryStation.append(traj_station)
    trajs.append(traj)
    trajs.toDOM()
コード例 #4
0
# %% Try to write to file
# This will give an error due to the missing nameWellbore

with open('out_log.xml', 'w') as log_file:
    log_file.write(logs.toDOM().toprettyxml())

# %% Set the missing value and try again
# It is also possible to add values after initalization

logs.log[1].nameWellbore = "SomeWellbore2"
with open('out-log.xml', 'w') as log_file:
    log_file.write(logs.toDOM().toprettyxml())

# %% Create a Trajectorys

trajs = witsml.trajectorys(version=witsml.__version__)


# %% Create trajectory
traj = witsml.obj_trajectory(uidWell='4', 
                             uidWellbore='5', 
                             uid='6',
                             nameWell='SomeWell2',
                             nameWellbore='SomeWellbore',
                             name='SomeName2')

# %% Fill some more values

traj.objectGrowing = False
traj.mdMn = 0
traj.mdMn.uom = 'm'