Cross-Database Channel Lookup

Use the Database Tools > Database Utilities > Cross-Database Channel Lookup menu option (LOOKUPDBCH GX) to set the contents of a channel in one database based on a table lookup of values in a second database, using a reference channel.

Select Lookup Database dialog options

Lookup database

The name of the database containing the lookup data and reference channels. This must not be the current database.

Script Parameter: LOOKUPDBCH.DB

Cross-Database Channel Lookup dialog options

Lookup database

The name of the database containing the lookup data and reference. (Read-only)

Reference channel

This lookup database reference channel.

Script Parameter: LOOKUPDBCH.REFCH

Data channel

The lookup database data channel.

Script Parameter: LOOKUPDBCH.DATACH

Lookup method

Select the lookup table method. See below for descriptions.

Script Parameter: LOOKUPDBCH.LOOKUP

Lookup max. search distance

When using the "Nearest" or "Interpolate" lookup table options, the maximum search distance. Values at a greater distance are not copied.

Script Parameter: LOOKUPDBCH.DIST

Application Notes

This GX will sample a channel from a lookup database, based on values in a reference channel found in the destination. The two databases must have common lines, the keying is done on a common reference channel (i.e. 'station'). Only the "selected" lines in the destination database are updated.

The benefit of this GX is that different kinds of data (mag, grav, hlem, geochem) that reside in separate databases can now be merged into one.

The lookup database name is written to the channel Label field.

Example

One use of this GX would be to resample data to a new sampling interval. Consider XYZ data in line D0 in a database. A distance channel "Dist" is created from the X and Y values, and this becomes the reference channel. In a second database, in line D0, create a "Dist" channel, and enter new distance values. Now run the LOOKUPDBCH GX, with the second database as the current database. Set the first database as the Lookup database. Select "Z" as the Data channel. The GX will create a new "Z" channel in the second database with values of "Z" based on the corresponding reference distances in the "Dist" channel.

Lookup database Data Channel values

Lookup database Reference values

Current database Reference values

New channel values

100

0

0

100

200

10

20

300

300

20

40

500

400

30

60

700

500

40

80

900

600

50

 

 

700

60

 

 

800

70

 

 

900

80

 

 

To resample an entire database to a new sample interval, see the RESAMPLDB GX.

Table Lookup Method

A look-up table is formed using the lookup database reference channel and data channel values. There are five different methods available for determining the data channel value, based on the corresponding reference value:

Exact: Only if the identical reference channel value can be found in the lookup database will the corresponding data channel value be set. Values where there is no match are set to dummy.

Nearest: The destination data channel value will be set by locating the lookup reference channel value which is closest to the destination reference channel value. All values in the destination database data channel are set.

Interpolate: If an exact match is not found in the lookup reference channel, then interpolation is performed using the two nearest bracketing values, and interpolating from their corresponding data values. If the destination reference value is less than or greater than the range of lookup reference values, the result is set to a dummy.

Nearest (close): Similar to "Nearest", but if the nearest value is greater than the entered maximum search distance, the result is set to dummy.

Interpolate (close): Similar to "Interpolate", but if the nearest value is greater than the entered maximum search distance, the result is set to dummy.

Original GX source and idea provided courtesy of Joel Jansen.