refid and decimate with Python gxapi/gxpy

Options
DavidHoward
DavidHoward Posts: 10 Calcite Rank Badge
edited May 2023 in Oasis montaj
Newbie looking for some howto help with refidding and decimating channels. Basic script is below. Thanks.

##import geosoft.gxpy as gxpy ##import geosoft.gxpy.project as gxprj ##import geosoft.gxpy.utility as gxu import geosoft.gxpy.gdb as gxdb ##import geosoft.gxapi as gxapi ##import geosoft.gxpy.vv as gxvv ##import geosoft.gxapi.GXDU as gxdu import numpy as np #https://geosoftgxdev.atlassian.net/wiki/spaces/GXD93/pages/103415898/Geosoft+Databases ##gxc = gxpy.gx.GXpy() def rungx(): # open the database with gxdb.Geosoft_gdb.open() as gdb: newdbName = str(gdb).replace('.gdb','_refid.gdb') #create a new database for refid data with annotated channel names new_db = gxdb.Geosoft_gdb.new(newdbName, overwrite=True) ## for channel in gdb.list_channels(): new_channel = gxdb.Channel.new(new_db, channel + '_r') # get a list of selected lines lines = gdb.list_lines() # work through each line for line in gdb.list_lines(): print ('processing line {}'.format(line)) #read each channel as a vv, refid and write to new db for channel in gdb.list_channels(): myVvData = gdb.read_channel_vv(line, channel) #refid the data -- HOW? ************************** ## gxvv.GXvv.refid(myVvData, (0,1), myVvData.length) #this doesn't work #decimate the data -- HOW? ************************** ## gxapi.GXVVU.decimate(myVvData, 10) new_db.write_channel_vv(line, channel + '_r', myVvData) input("Press return to continue...") exit()

Best Answers

Answers

  • DavidHoward
    Options
    Thanks, all. Both work a treat. Easy when you know how. :(
    (Sorry about the Geonet tag. I thought I'd selected the GX Developer tag but missed.)
This discussion has been closed.