Creating a .gdb containing array channels

JustinAnning
edited February 17 in GX Developer
I'm using 
geosoft.gxpy.gdb.write_line(line_name, data, header)

in a stand alone python script. I can create a simple .gdb as per the tutorial example. Works very well thanks.


Now I'm trying to load data where I want to specify columns to load as an array channels. Do I still use the "write_line" function if I want to create a couple of array channels?

I've tried giving the same name for all the columns of data I want to load into the array channel as this seemed to what the reference below inferred, but it just loads up the first array value only.  Am I on the right track?


write_line(linedatachannels=Nonefid=(0.01.0))

Write data to a multiple channels in a line. If no channel list is provided it assumes that the data is for all channels from the line, the compliment of read_line().

Parameters:
  • line – line to write to, name or symbol
  • data – numpy array shape (records,channels). If single dimension, one channel
  • channels – channel name or symbol list, or a single name/symbol. If a single name is specified for multi-column data, a VA channel is assumed. If None, a sorted list of all channels is assumed.
  • fid – option fid tuple (start, increment), default (0.0,1.0)

Regards
Justin
Tagged:

Comments

  • So to make a .gdb with both standard and array channels you can do this.....


    import geosoft.gxpy as gxpy
    import geosoft.gxpy.gdb as gxdb

    lines = ['line1', 'line2', 'line3']

    gxc = gxpy.gx.GXpy()
    gdb = gxdb.Geosoft_gdb.new('test.gdb', overwrite=True)

    for L in lines:

    header = ['x', 'y']
    data = [[1, 1, ],
    [2, 2, ]]

    header_array_z = 'z'
    data_array_z = [[1, 2, 3, 4, 5, 6, 7, 8, 9],
    [9, 8, 7, 6, 5, 4, 3, 2, 1]]

    header_array_Vp = 'Vp'
    data_array_Vp = [[1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000],
    [9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000]]

    line_name = gxdb.create_line_name(L, gxdb.LINE_TYPE_RANDOM, 0)
    gdb.write_line(line_name, data, header)
    gdb.write_line(line_name, data_array_z, header_array_z)
    gdb.write_line(line_name, data_array_Vp, header_array_Vp)