NOTES on using this page

  • All information is on one page so that you can use your browser's "find" function to look for keywords related to your question.
  • Use the contents list below to jump to specific information regarding that aspect of using UBC-GIF codes.
  • This should not be a "primary" resource for fundamentals or details about codes. Use software manuals and tutorials where appropriate or the IAG CD-ROM.


Running codes | Meshes | Data and errors | Inversion theoryDCIP2D | MAG3D | GRAV3D | EM1DFM | Utility codes


Running UBC-GIF inversion and modelling codes

What do UBC-GIF codes do about input and output file names?

  • Except for EM1DFM, all output file names used by UBC-GIF codes have pre-defined names. Therefore you must use directories to keep track of your work rather than file names. See the manuals of individual codes for details. Input file names can be whatever you would like.

Can I have spaces in my file names and directory structure?

  • Yes and the file name (whether relative or absolute path) should have quotes around it. Two examples: "C:\My Documents\input.txt" or "A really long file name.dat"

How long can file names be?

  • Older versions of our code limit file names at 120 characters. New codes have been changed to 500. We highly recommend you re-structure your folders if you need more than 500. 

Can I run inversions from one directory?

  • Yes, BUT because the codes have fixed file names for output information, you SHOULD run separate inversions from separate directories. You are expected to keep track of a collection of results by using directories rather than file names.

Can I script several inversions to run sequentially (for DCIP2D, MAG3D, or GRAV3D)?

  • Yes, place each data set that needs inverting into a separate directory, all under a common root. Build an inversion input file for each run, ensuring that all files needed (input data, reference models, and so on) are referenced with complete and correct directory path information. Build a DOS batch file which starts in the "root" directory of all your work, changes to working directories, and runs the code using command line parameters, one directory at a time. Instructions for running the codes from the command line (in a "DOS" or command line window) are given in chapter 3 of all the manuals. The EM1DFM user interface is designed to run many 1D inversions, so setting up batch files should not be necessary for this code.

How do I stop an inversion run prematurely?

  • There is a "stop run" button in the graphical user interfaces for inversion programs. If running from the command line, press CTRL-C.

Help, the program quits with no result, and no apparent error message!

  • Check the log file for indications of "bad" data points.
  • All information in the data file must be numeric. Check for erroneous data points including "####'s", "#div/0" or other non-numeric information.
  • If the log file has no information in it other than the date, check the input file format.

Can I run the programs in Unix?

  • Only MSWindows versions of the inversion and forward modelling codes are available for licensing. Codes should run on all versions of MSWindows at and before the date of the code you are using (see "Help" menu in the Graphical User Interface).

My code was fine, then I upgraded Windows and now it doesn't work!

  • If you have codes that did run on older versions of MSWindows but that fail on newer versions of the operating system, please contact your distributor about obtaining a more recently compiled copy of your codes.
  • Data files should be in the correct ASCII format for the Windows DOS environment.

Should target misfit always be met? 

Smooth models but NOT smooth geology?

Can I get the source code?

  • Sorry, UBC-GIF is unable to provide source code for any of their programs.



What is the 3D Mesh Format?

  • 3D models are defined using a 2-file format. The "mesh" file describes how the earth is descritized. The "model" file lists the physical property values for all cells in a mesh. A model file is meaningless without an associated mesh file. The first value is for the model's top-front-right, (top-south-west) corner cell. Both mesh and model files are in ASCII text format so they can be viewed and edited using any text editor. However, please see the NOTE on tabs vs spaces in the Data and errors section of this page.
  • Mesh files are defined in the MAG3D and GRAV3D manuals, section 2.2 "FILE: mesh".
  • Model files are defined in the MAG3D and GRAV3D manuals, section 2.2 "FILE: model.sus" or "FILE": model.den".

How should I design a 3D Mesh?

  • Potential field measurements (gravity, mangetics, DC potentials) decay with increasing distance from the causitive features. Therefore you should use smaller cells near the surface (in the range of elevations which include the topography variations) and increase the cell thickness with the model depth. The inversion can only assign constant susceptibility for each cell so if there is structure at a scale smaller than your surface cells, it will not be possible to recover unless the cell size is reduced. Of course small cells means more of them, hence a much larger problem. If there are anomalies close to the edges of your data set, include padding cells around the main zone of interest.   Three cells on all sides should be OK, and their sizes should increas by factors of two (i.e. if your model earth has cells of size "1", then the first padding cell should have size "2", the next size "4" and the third size "8"). This will not guarantee that susceptibility won't be placed within the main model, but it might be easier than trying to remove a complicated "regional" field.

How should I design a 2D mesh?

  • The programs build a default mesh with two cells between each horizontal electrode location, and cell aspect ratios of 2:1 (horizontal dimension to vertical dimension).  If the survey array is not dipole-dipole, or pole-pole, or pole-dipole, you must build your own mesh file. The array can have uneven electrode spacing, but the mesh file will be complicated.
  • If you build your own mesh, cells do not have to be all the same size, but the electrodes do have to be on nodes. The program can not work if electrodes are placed in the middle of cells. As noted above, uneven arrays should be OK.
  • 2D Mesh size: Reasonable models have on the order of 2000 cells. Ten times that is starting to get rather large.
  • Current source locations: You must not use the edge of the mesh for a current source because the mathematics must be able to have current flowing into the ground on both sides of the current source. Therefore, for a pole-dipole survey that starts on the left, the first station must be on the node between the first and second cells. For a real survey, it is necessary to add extra cells on both sides, and below, the region of surveying so that mathematical boundary conditions can be managed properly. See the DCIP2D manual on meshes.
  • See also the general rules on mesh design below.
  • See also the DCIP2D workflow found on the IAG

What about including topography with UBC-GIF meshes?

  • The top of the mesh must be above the topography.
  • Data must never be inside cells below the topography, except for borehole data.
  • In data files, the "Elevation" (3rd) column (called Elevn in the manuals) must contain values that are true elevations NOT "altitude" above ground.
  • Error message "Point xxxx: (*******,*******,  yyy.y) is inside the model" usually means that elevations specified for one or many data points in the data file (obs.grv in the manuals) is/are not above the topography.
  • Please read the chapters on FILE: topo.dat in the MAG3D or GRAV3D user manuals.

I want to add extra cells to a mesh for characterizing detail.

  • The best way to make smaller cells in a particular region is to add lines to the default mesh created by the program when you first run the inversion. You can observe the mesh being used in any final model by selecting the View menu, Mesh option in the model viewing window.
  • In our experience, adding extra cells at depth does not usually help the result. The default mesh normally divides the Earth into cells that can be reasonably well resolved with the corresponding geophysical method and the survey provided.

I only care about a portion of the mesh. How do I extract those values?

  • There is no direct method to extract a column or bock of values from a 3D model. Some users have written utility programs to convert mesh/model file-pairs into X-Y-Z-Value column format, then a spreadsheet can be used to sort and extract portions.
  • Alternatively you can view the model in on the screen. When you point the mouse to any cell the value and location are displayed in the window's status bar. It helps to turn on the mesh grid when doing this.

Can you just give me the general rules of mesh design?

  • Sure. They are as follows:
  1. Every electrode in the data set must be placed on a nodal point in the mesh. This is true for UBC-GIF code DCIP2D only.
  2. There should be two or three cells between adjacent electrode locations, i.e., per dipole length. Thus the width of cells is usually an integer fraction of the dipole length, a.
  3. The cell thickness of the first layer should be a fraction of the dipole length, a, with a lower limit of about 1/5 to 1/10. At the same time the aspect ratio (width divided by thickness) of the cells in this region should not exceed 5. The finite difference solution deteriorates as this aspect ratio increases.
  4. The core portion of the mesh is defined horizontally by the position of the first and last electrodes. The depth extent should be greater than the array's depth of penetration and the thickness should generally increase with depth. The cell thickness can increase smoothly and progressively with depth or there can be several depth zones in which the cell thickness is constant. The thickness of the cells in each zone will increase with the depth of the zone.
  5. In the horizontal direction there should be one or two cells outside the primary model domain which have the same width as those inside. This is essential for the finite difference approximation when the electrode is at the end of the line. Beyond that, cells of logarithmically increasing width are used to pad the mesh. The padding cells should extend to a distance that is greater than the maximum length of the array, L.
  6. Similar padding cells for the vertical direction are placed below the core mesh. The thickness of these cells increases logarithmically until the thickness of the padding zone is greater than L.
  7. Once a mesh is formed, it should be tested by performing a forward modelling on a uniform halfspace conductivity model. If the mesh is designed properly, the forward modelled halfspace responses should not deviate from the theoretical value by more than a few percent.
  8. The automatic mesh generator built into the code follows these rules. If you have irregular mesh the software will try to create a sensible mesh based upon the data, but the automated process is not perfect and may generate meshes that are unreasonably large. For additional information see the UBC-GIF tutorial on 2D inversion of resistivity and chargeability.


Data and data errors

Can I have a tab-deliminated data file?

  • No Tabs Please!
  • Please separate columns and parameters of input files with spaces, not tab characters. Saving data from spreadsheets out to "text" files usually results in tab-delimited data files, so these must be changed in a text editor by replacing all tab characters with space characters. Several spaces is OK.

What  are the positioning coordinate systems? Can I use UTM?

  • All UBC-GIF codes work in metres.
  • If DCIP2D is used with feet for positions, the resulting resistivities will have units of "Ohm-feet". This could be changed after the fact, or all position information could be converted to metres first.
  • For UBC-GIF 3D inversion codes, the volume is define by specifying the position of the South-West- Top corner of the volume of ground (the "mesh"), and then all dimensions are in metres after that. This corner could be (0,0,0), or it could be the correct location in UTM based upon the data set, or it could be a position on some survey grid. If the last is true, we would need to align the survey grid onto the UTM coordinate system to get geographically correct positions. These could be converted to Lat/Long if necessary using the GSC facilities.
  • Note that UTM coordinates often involve many digits. It may be appropriate to retain only those digits that change over the survey area for the purposes of inversion. The digits that were dropped can always be put back for final presentation purposes if desired.
  • For Canadian locations, conversion between UTM and Lat/Long is easily done using the GSC's online or downloadable facility called GSRUG. There is all sorts of information on the UTM projection at that site. Individual locations can be converted either directly on line, or a DOS-PC program can be down loaded for managing batches of locations.

What should my mesh size be given my number of data?

  • There is no need for more than a few data points for each cell at the surface of the mesh. The inversion result can not recover details of geology at a smaller scale than your mesh, so including more than a few data points over each surface cell may make convergence slow or impossible. Airborne data sets are often huge, and they will require decimating before inversion routines can handle them. Under 10,000 data points is reasonable for most problems while several tens of thousands of data points is begining to become a very large inverse problem.
  • Data along wide-spaced lines: If there will be several cells between data lines with no data points over them, it is possible that artifacts may be introduced, or that models will look "stripy", with structure predominantly underneath the lines of data. Careful gridding of such data sets might help, but gridding can introduce artifacts into the data set, so take care! Alternatively upward continue data sets so that they are roughly half the line-spacing in elevation. For example, if data were collected along 200 m spaced lines, with a 25 m spacing along the lines, and model cell horizontal dimensions were 20 m x 20 m, then artefacts may be created in the model due to the irregular distribution of the data points.  Instead of that,  try replacing the input data with gridded data.
  • Mesh size: For 3D meshes, try for 10,000 to 50,000 cells to begin. If there is a need, you can try finer meshs once your problem is under control at the coarser scale. (However, recall that 3D problems become extremly large very quickly. For example, if you define a mesh that has 200 by 200 by 200 cells, there will be 8,000,000 unknowns in your problem. If you then try to invert 4,000 data over this mesh then the program will have to manage a matrix that has 32x10^9 elements.

How do I tell if I have defined an inversion problem that is too big?

  • You can always start the program running, and if the computer appears to be hitting the hard disk often, then the problem is to big to fit in your computer's RAM (memory).  It is possible to reduce the problem size by adjusting wavelet compression parameters, but we have not got any well defined rules as to the cost (in terms of model resolution) of more agressive compression.  Most users now use a gigabyte or more of RAM because memory is generally relatively cheap.

How do I prepare data for 3D inversion?

  • If possible constrain data sets so that they have no anomalies close to (or crossing) their edges.
  • For gravity data especially, removal of a regional trend is an important, and not necessarily easy step. Try to end up with a residual data set that has anomalous values of zero near the edges of your data set. This may not be possible, so include padding cells. Upward continue gravity or magnetics data to an elevation around 1/2 cell width. This is to help remove information in the data that was caused by features in the ground that are smaller than your cell sizes. Again, this will improve the chances of successful convergence within a reasonable time. Upward continuation may not be necessary for airborne data sets.
  • Filtering: Simple filtering of data sets (other than noise reduction) is NOT encouraged. Smoothing should be done by upward continuation because it does not introduce artifacts if done properly.

How do I define data errors?

  • Errors arise from many sources including position errors, elevation errors, instrument noise, etc. Therefore you should assign a reasonable value for all data points - say on the order of 5% of the average value.
  • It is wise estimate error using both a percentage and a constant value. This is especially true for data that can be close to zero, or which can be both positive and negative because using a percentage only means that values close to zero would end up being considered as nearly perfect. See the definition of ERRi in the user's manual of the code you are using.
  • If the noise on data are not Gaussien, random, etc. you may have to loosen the misfit critia. In DCIP2D, either specify a value greater than 1 for ChiFact, or examine the data carefully and specify larger errors for data points you don't trust as well. In other words, "default" errors calculated by the program are not always appropriate.
  • When errors are not known: In GRAV3D, MAG3D or EM1DFM there are several ways finding optimal solutions without having to specify a Chifact. These are the L-curve or GCV options. Discussion is provided in the tutorial on linear inversion (large PDF).
  • Default errors for DCIP2D are calculated as explained under "ERRi" in the manual. Here are two approaches to adding noise to data:
  1. Use the formula described in the manual  i.e. contaminate the exact data with Gaussian noise (GN) of standard deviation (sd) equalling 5% of the chargeability value plus additional GN with sd equal to a constant (for example 0.1 pfe).
  2. Similar to the above, however instead of using 5% of the chargeability value for the sd use 5% of a power law function of the Vp i.e. 0.5Vp^-0.3.  This is derived (the constants are arbitrary) by plotting chargeability error against Vp. The errors for both cases are then the sd of the noise (as specified in the manual),  however you should add an additional error floor to this value to get a suitable model.  You may not have to add error floor for the resistivity inversions.


Inverse Theory

What is meant by “initial model”, and “reference model”?

  • See inversion code manuals under “input parameters” or similar headings. The initial model is a model of the earth compatible with the model type being produced by the inversion code (1D, 2D, or 3D) that is used to get the iterative inversion process started. It is usually a uniform value (of the relevant physical property), but it can be a more complex model. For example, when generating 2D models for data gathered along parallel lines, one successful result could be used as the initial model for inversion of data along an adjacent line, if you think the structures do not change very rapidly from line to line.
  • The reference model is part of the model objective function. The final solution will be driven towards this model. See section 4.1 (Model Objectives) of the Inversion Tutorial for details.

What does "model norm" mean?

  • Model norm is the value of the "model objective function" calculated on the current model. The value is representative of just how "smooth" and/or close to a reference, the model is.
  • The inversion algorithm's objective is to simultaneously minimize the model norm, subject to attaining acceptible data misfit.
  • This is a fundamental question regarding inversion theory and it is important for you to understand the essentials. Please read the tutorials on inversion theory that were supplied on your distribution CD.

What is DOI (depth of investigation)?

  • See DCIP2D FAQs below.

Should the target misfit always be met?

  • If an inversion converges, the resulting model is "valid" only in the sense that it is capable of reproducing your observations to the degree specified by your choice of Chifact and your choice of error for each datum. You could ask for models which generate predicted data that are closer and closer to your observations, until you reach a point where some details of the model structure are actually reproducing noise. Then your misfit is too close.
  • In fact, the program may be unable to converge if there are some data points that it is unable to reproduce (within the error specified for that point). If there are individual "bad" data points, they should either have large errors assigned to them individually, or you could drop them from the data set altogether. Observe the misfit map to see if there are individual troublesome data points.
  • For more on these issues see the tutorials.

Why interpreting a complicated Earth with "smooth" models?

  • The nonuniqueness of inversion is constrained in an unbiased, rigorous way when smoothness and closeness to a reference are the defining mathematical goals for the algorithm.  Recall that these programs allow you can specify the degree to which smoothness and closeness to a reference are honoured. Also, when there is no prior information it makes sense to search for the simplest possible structure that can explain the data.
  • Now, with a decade of experience using these types of algorithms, there are several organizations researching other objective functions and minimization techniques that will address the nonuniqueness in ways that produce other types of models.
  • UBC-GIF inversion codes are very flexible because the model objective function can be adjusted to emphasis smoothness (in either geometric direction) or closeness to a reference; the reference itself can be as complicated or as simple as desired; and weightings can be applied. However, the minimization is always an L2-norm calculation so models will be inherently smooth.
  • Sometimes the Earth can be very "un-smooth", particularly in terms of electrical conductivity. It is possible to have adjacent geologic units that have electrical conductivities that vary by 4-5 orders of magnitude. Under such conditions DCIP2D may have trouble finding a model that can satisfy the observations, especially if it is forced to run with default parameters. The program may even quite after trying to produce a model that generates an impossible predicted data set. What to do?
  1. Consider a larger Chifact (value of 5-10 perhaps) to get started.
  2. Set your own value for the reference model, to something close to the higher resistivites of your situation (1000 Ohm-m for example).
  3. Try adjusting alpha's so that smoothness in the horizontal (or vertical) direction is de-emphasized. For example, try (as, ax, az) = (.001, .001, 1), or (as, ax, az) = (1, .001, 1).
  4. Build a model (using the dcip2d model maker utility) with your best estimate of structure based purely on interpretation of the pseudosection. Then use that as a reference model in the inversion.
  5. Try combination of these ideas.

If you could give me one last word, just one, on geophysical inversion what would it be?

  • We will do better than just one word - we'll give you one paragraph (last paragraph of Oldenburg and Li (1994), quoted verbatim): "The important aspect of our inversion methodology is that the generic model objective function that is minimized provides great flexibility to generate different models. With a properly designed objective function it is possible to incorporate additional information about the distribution of conductivity or chargeability and to generate a model that is in accordance with geologic constraints. Such a model may be regarded as a best estimate for the true earth structure and can be used in a final interpretation. However, altering the objective function and carrying out additional inversions allows exploration of model space and provides an indication of which features are demanded by the data. These two aspects of constructing a most-likely model and exploring the range of acceptable models, form the foundation of a responsible interpretation."



What are the data types and units?

  • Input data for DC resistivity inversions (the 5th column of DCIP2D input file) are in units of voltage NOT resistivity. This value of potential is always normalized to unit current amplitude. Therefore values are easily obtained from pseudosection data (which are usually in units of apparent resistivity) by applying the geometric factor equation for the appropriate array type to obtain "V/I", which is "V" assuming I=1 (the required datum).
  • Input data for IP can be in any of the standard forms (time domain in units of msec or mV/V, phase in units of mrad, or frequency domain in PFE). These are all directly proportional to "theoretical" chargeability. Therefore you can use recorded chargeabilities directly as input values, and recovered model chargeabilities will be in the same units. In the Li and Oldenburg (1994) paper this is noted when the field example is discussed. See also the induced polarization data section of the DCIP2D software manual.

Can I mix array types for a single inversion?

  • Well, yes and no (read on...). Only one type of survey array can be included in a single file, but arrays with different spacings of the same configuration can be mixed in the same file. For example, two pole-dipole arrays with a 50 m dipole and a 100 m dipole respectively can be in the same file.

Does it matter if I acquire pole-pole or dipole-dipole, etc.?

  • See the a short summary in the UBC-GIF tutorial on DC resistivity methods (in the IAG). This also illustrates the difference between pole-pole, dipole-dipole, pole-dipole and dipole-pole electrode configurations for 2D DC / IP surveys. Other configurations are not mentioned, but see more comments below.

What are the units of chargeability?

  • The scale for chargeability pseudosections and models is not labelled because it depends upon what type of data are supplied (time domain, PFE, frequency domain, etc). See also above (Input data for IP). The DCIP manual's page describing data also has relevant information.

What is "small" chargeability?

  • Intrinsic time domain chargeabilities of 70-100 msecs are considered large. In other words, a secondary voltage (at turn-off) that is 10% of the primary, on-time, voltage, would represent a "large" capacity for the ground to become charged. The IP inversion code in the DCIP2D package is linearlized by assuming chargeabilities are "small", which basically means m<0.1, or intrinsic time domain chargeabilities are less than 70msec or so.

Can you discuss how to forward model IP data using DCIP2D?

  • Of course. UBC-GIF forward modelling (not inversion) of induced polarization requires the earth's chargeability to be defined in unitless IP values scaled between 0 and 1. This is because the forward code does a complete forward modelling as per eqn 6 in the DCIP2D manual's background chapter. To convert "normal" chargeability values into unitless values, M,  use the conversion factors M = 0.1 ~ 10PFE ~ 70mrad ~ 70msec. The output (a pseudosection of data) can then be scaled back up to "normal" units using the reverse of your initial conversion.
  • Inversion of IP data can work happily with normal field units (see "Input data for IP" above) because the forward calculation within DCIP2D only needs to solve eqns 14 (see Inversion of IP data, in the DCIP2D manual), which are valid so long as chargeability is "small" (which means less than around 0.1 (unitless) or less than around 140msec).

I get the forward modelling error "Number of cells in the mesh is not the same as in the model"

  • The mesh used for forward modelling and inversion must be the same. It is common to generate a synthetic model, then invert it, and then not be able to view the result. This is often because you let the inversion program build it's own mesh for your synthetic data, and this may not be the same as the mesh used to define the synthetic earth. Make sure you specify the correct mesh in the inversion program rather than letting it make it's own mesh.

What are the default errors for DCIP2D?

  • They are explained under "ERRi" in the manual.

Do I need a conductivity/resistivity model for inversion of IP data?

  • Yes, the chargeability inversion requires a resistivity model to proceed. While a uniform half space can be used, the resulting chargeability model will not represent the true earth as closely as if the correct resistivity model is used. Please read the manuals, in particular the last paragraph ("NOTE 5") of the DCIP2D manual's page on inversion of IP data.

Should I include negative apparent chargeabilities?

  • There are several reasons why negative apparent chargeabilites might be measured. Therefore they should be included in data that are inverted. (Note however that there is no such thing as negative intrinsic (true) chargeability.) See the IP tutorial for more details.

How do I invert Wenner and Schlumberger Arrays?

  • All array configurations can be accommodated for inversion, but only pole-pole, pole-dipole or dipole-dipole can be specified on the input file's first line.
  • For Wenner, Schlumberger, gradient, or irregular survey arrays, you must enter all electrode positions explicitely and specify dipole-dipole on the second line of obs.dat. You must also mesh file, initial and reference models, and "alpha" parameters. See the page on input file parameters in the DCIP2D manual.
  • The Graphical User Interface for Windows95/98 can estimate default parameters and display pseudosections for pole-pole, pole-dipole or dipole-dipole arrays only. See the GUI documentation for details.
  • So, specifically Wenner and Schlumberger arrays are not recognized by the UBC-GIF graphical
    interface. It can not display raw data (pseudosections), and it can not build a
    mesh for you. Here is what to do:

  1. First make your own mesh file using a text editor. Instructions are in the manual under the heading "fdmesh.dat". 

  2. Build a data file according to the manual, and include estimates of error for each datum (don't forget that data are normalized potentials not apparent resistivities). You must put "dipole-dipole" on the second line of the data file so the program thinks it is working with dipole data. 

  3. If you get sign errors, try changing swapping the transmitter (or receiver) electrode columns. When the data set is specified according to the manual the inversion should run fine. Resulting models and log files are all normal, and the user interface is quite happy reading the resulting model because it is just a mesh of cells like any other 2D solution.

Can you invert gradient array data?

  • This is a little tricky for at least a couple of reasons, but the short answer is yes. The restriction that electrodes must be on mesh nodes results in large meshes because the source is so far apart yet potential electrodes tend to be relatively close together. Also, with such widely spaced source electrodes, there is a higher likelyhood of 3D effects creeping in. Current will flow (and may be channeled) in areas that are no where near the 2D survey line. This may make it difficult for a 2D inversion routine to find a suitable structure to account for the data.  In fact, gradient data are often used as a rapid reconnaisance tool, and area maps of response may be a better interpretation tool than 2D inversion.
  • It is probably better to invert gradient data using DCIP3D because of said 3D effects. However, this doesn't give that much more that a plan view of the data because there are so view transmitter locations.  It is only really worth inverting if there is other electrical data to constrain the depth of objects.
  • Another approach, would be to use MAG3D and define the inducing "magnetic" field to lie in the direction of the electrodes. When doing this, adjustment of the depth weighting for different runs would be useful to see how the model changes, and how well any other geologic information is supported.  Of course the model's physical property values will be on a relative scale and actual conductivities/chargeabilities will be hard to recover.

How do I generate a “DOI” image?

  • To generate a DOI image, two inversions must be run using two different reference models. A good choice is the reference used by a “default” inversion, and a second one that is near the minimum resistivity (or chargeability). NOTE: two inversions must be run from two separate directories - see Running the UBC-GIF codes FAQs above.

Can I interpret the dip of geologic structures from a recovered model?

  • Recall that when UBC-GIF inversion programs are run without adjusting any of the model objective function parameters, resulting models will be smooth and close to a reference. Therefore the actual dip of geologic structures may be masked by these "optimally smooth and small" models.

Can prior knowledge about dip be incorporated?

  • One approach to finding alternate models is to adjust the objective function parameters (alpha_x etc). The DCIP2D tutorial page on the model objective function describes the effects of adjusting these parameters.
  • Methods of augmented the model objective function, and the effects on inversion results are discussed in Li Y., and Oldenburg D.W. (2000), "Incorporating geologic dip information into geophysical inversions" , Geophysics, 65, #1, pp 148-157.
  • Currently licensable versions of DCIP2D do permit this kind of work but there is no documentation yet. Please contact UBC-GIF if you would like to know how to do this. It is not difficult!

Can I contoured plan maps from parallel 2D models?

  • Well, yes but not with any of our codes. UBC-GIF does not have a utility to extract resistivity or chargeability values so that you can contour these model values at a given depth from several parallel 2D models. You will need to build a utility program or spreadsheet that uses the mesh and model files to pick out model parameters from one specified depth (row in the model) for each inverted line. Then those rows can be concatinated, and appropriate x and y coordinates added, to build a file that can be contoured using a standard contouring package.

Can I invert 1D resistivity (IP) soundings?

  • Unfortunately, there are no UBC-GIF codes for inverting 1D resistivity (IP) soundings. Only 2D surveys can be inverted with DCIP2D. Truly 3D data sets need a 3D inversion code to invert, such as DCIP3D.

Can you briefly discuss 1D vs 2D vs 3D modelling?

  • Well, since you asked; we'll try to keep it brief. We would all like to have inversion and modelling codes that are fully 3D, but they are expensive and often tricky to use. If the earth varies significantly in the direction perpendicular to a line of survey electrodes then any 2D code, smooth, blocky, whatever, will be unable to recover a "true" model because 2D codes know nothing about the earth off to the sides of the survey. This issue is even more important for 1D codes - they can produce models that emmulate the "true" earth only if the earth can be modelled in terms of layers that are uniform in both horizontal directions. On the other hand, 1D codes often think in terms of a few discrete layers. If this is really what the earth is like under the survey then these interpretation methods may be the best choice. My feeling is that a 2D survey should be interpreted first using 2D methods. Then, if the result looks like layers, a 1D approach could be used in the vicinity of the most uniform looking region to constrain the layer properties and interface depths. But I would be unhappy using nothing but 1D intepretation methods because there is no way of telling from such surveys whether the earth is uniform in all directions under the interpretation location.


  • Are there any inexpensive interpretation codes?
    • The web-based geophysics course at the from Tom Boyd at Colorado School of Mines has applets to forward model Schlumberger or Wenner soundings over a 3-layer earth, and the notes and exercise instructions are very complete.
    • There are a couple of soundings programs advertised on the rockware web site under the software/geophysics/resistivity heading. For teaching, we (UBC) still use a very inexpensive (<$100 for academics) DOS program that was made available from Gradient Geophyiscs, 921 Spruce, Missoula, Montana, United States, 59802,  Phone: 406-542-0340, Fax: 406-542-0308, Contact: Garry J. Carlson. It is not complicated, nor sophisticated, but it serves our educational purposes. I doupt if it is still "for sale" although you might like to contact Garry Carlson.

What do I do for the error message: “Data has a wrong sign for current x, potential y”?

  • Try swapping the potential electrode columns, or the source electrode columns.
  • Note that if the resistivity / IP pseudosection data viewing program (dcip2d-data-viewer) shows data properly the data file is OK for input to the inversion programs.

What do I do for the error message (DCIPF2D): “*ERR* LI-04 argument(s) must not be zero” or similar?

  • The input file probably has a typing error somewhere in it.



What is the depth to a magnetic target?

  • It is important to realize that potential fields data (gravity and mangetics) actually contain no inherent information about the depth to a target. You can explain any data set using a susceptibility distribution confined to a single layer at any depth.
  • The MAG3D code does has a depth weighting term included in the model objective function which effectively allows all depths an equal probability of having susceptible material.  If the real earth only has susceptible material in a thin layer near the surface then this weighting term will cause the solution to appear too deep. There are parameters in the user interface (called "depth weighting") that can be adjusted. Normaly we recommend leaving these alone but if alternate information suggests a results should be shallower, by all means try adjusting these parameters. See the MAG3D manual, section 1.4 for more details.

What are the conventions for the Earth's magnetic field in Mag3D?

  • The conventions for MAG3D are: Inclination is positive in the northern hemisphere; Declination is positive to the west of D=0; Field strength is always positive. One way to check if everything is as expected is to generate data for a simple buried susceptible block.

Can you give me a brief outline of the data requirements?

  • Data input file
    • The data input file is essentially in XYZ format except for the top three lines. Most people generate an XYZ file with northing, easting, elevation, and value, then use a spreadsheet or hand-written software to add the error column. The inversion problem becomes inefficient if there are more than 1000 or 2000 data points, so handling data with spreadsheets or custom routines is usually not a problem. At UBC, the focus is on research and development of new algorithms and inversion methodologies, so we do not carry out routine processing of large numbers of data sets.
  • Number of data points
    • The solution to the 3D inversion problem involves working with matricies that have a size of (# data) times (# of discretization cells). For 1000 data points and an earth model consisting of 10,000 cells this is a fairly large problem - a matrix with 10,000,000 elements. A great deal of research has gone into reducing the mathematical size of this type of problem.
  • Standard practice for data preparation
  1. Discretizing the earth into cells with a size appropriate for the problem you are trying to solve. The total number of cells is commonly in the range of 10,000 - 100,000. For example a grid that is 50 x 50 x 25 cells would be considered large but reasonable.
  2. Decimating the data so that there are only one or two data points per surface cell. A reasonable number of data values for inversion is around 1000-5000, although more can be used at the expense of inversion speed. If the computer has to continuously hit the disk during the inversion you need more memory or fewer data points (or a smaller number of cells).
  3. Upward continuing the data so that they represent data gathered at an elevation of roughly half a cell-width,
  4. Removing any regional trend that would require the model to include susceptible material outside the region specified by the mesh.
  • Note: Step 3 may not be necessary for airborne data if the elevations average roughly half (or more) of a cell width.
  • Note: Step 4 may not be necessary if the anomalies are is well contained within the survey area. If there the anomalies extend off the edges of the data, this step is very important - see the section in the IAG (We know - broken record. It's worth it!). Adding padding cells is less important than for solving the DC resistivity or IP inversion problem (DCIP2D), but it will help if you have anomalies that extend beyond the data set. 


  • Errors arise from many sources including position errors, elevation errors, instrument noise, etc. Sometimes it is reasonable to assign a fixed value of nT for all data points - say around 5% of the average value. Some people apply errors as a percent of datum plus a fixed value; for example 5%datum + 5nT. Most of the information is on our website under Tutorials.

Can you use Mag3D for gradient data?

  • Mag3D can not handle Gradient data as the sensitivities are different than that of total-field data.

Can Mag3D handle extremely large susceptibilities or remenant magnetization?

  • MAG3D does not account for demagnetization or remenant magnetization. So it will give the wrong results if demagnetization is significant (i.e. if susceptibilty is extreme).
  • The code will allow users to input remenant magnetization directions for specific data points in order to best account for remenant magnetization. However, if you have self-demagnetization effects you will have to use other techniques (e.g. Lelievre and Oldenburg (2006) on the publications page)

How do I use susceptibilities from drill cores? 

  • Using susceptibility values from core (or borehole measurements) is definitely something that people want to do. UBC-GIF has students experimenting with this problem. It turns out to be rather complicated because relating physical rock properties at the scale of a few centimetres to properties at the scale of tens or hundreds of metres is complicated. It is encouraged to read Williams and Oldenburg (2009), located on the publications page.

Why won't my inversion run?

  • Check that the inclination, declination, and geomag (field strength) are correct on the 1st line of the data file. Geomag must NOT be zero.

Why am I getting artefacts on the model mesh edges?

  • MAG3D computes susceptibility models assuming that all sources come from within the model grid, and the sucseptibility outside the model is zero.  This means that if susceptibility-contrast anomalies are located near the border of the model, the inversion will create artefacts near the borders of the model.
  • Try adding padding cells following the mesh preparation discussed above in Meshes.

What do I do with the message: "Cannot complete line search without positivity ... "?

  • This indicates that the program is having trouble finding a regularization parameter in the inversion step that occurs before positivity is imposed. Try increasing ChiFact, or assign larger errors to the data, especially to any questionable data points. You could try one inversion using a ChiFact that is around 10 times what you expect it to be just to ensure that the program can deal with this data set. Then re-run with more sensible misfit specifications (i.e. Chifact and/or error assignments).

Upon what algorithm is the forward modelling in MAG3D based?

  • The code in MAG3D was initially based on Bhattacharyya's (Geophysics, 1964, p517-531) and a later simplification by Rao and Babu (Geophysics,1991). But the the code in version 3.0 is based more on Sharma (1966, Pure Appl. Geophys., vol 64, p89-109), which is basicaly the dyadic Green's tensor notation we had in the borehole paper.

Can I simultaneously invert ground and airborne data?

  • Yes. We have jointly inverted data sets at different levels and it hasn't posed a problem. Just a couple of comments:
    • One way to check the consistency is to upward/downward continue the different data sets to a common plane.
    • Also, if there is magnetic material near the surface then maybe the ground data should be upward continued to a height equal to half a cell size.

How should I design my mesh with my data elevations?

  • Enter the elevation of the sensor above the ground (eg. 2m for ground-based data sets). This must be greater than zero because data points can not be on mesh nodes or cell edges, or within mesh cells.
  • Adding the topography file with ground-based points will alleviate any problems with the observation locations (above the topography) being placed on nodes.



What are the data Grav3D inverts?

  • When inverting gravity data, the assumption is that the data input to the inversion algorith represents the gravitational attraction of the buried anomalous targets ONLY. In other words, it is assumed that all effects due to the geoid, the elevation, and "host" rocks around the target (including topographic effects) have been removed. Therefore the best data set you can use is one that includes all possible corrections, including terrain corrections if that topography is substantial. Of course it is assumed that the correct density for "host rocks" was used in the Bouguer correction.
  • Remember that complete Bouguer corrected data are NOT moved to some ficticious flat plane. All data points should remain at the locations and elevations at which they were collected. When topography is not severe, Bouguer corrected data will suffice.
  • You do not need to supply the densities used in the Bouguer correction.
  • Units should be mGal (milliGals).
  • Results are relative density contrast in g/cc, NOT absolute density.

What is the depth to a density contrast target?

  • Please read the related comment under MAG3D above - it is entirely relevant to GRAV3D. The reference in the GRAV3D manual is also section 1.4.

What if I have artefacts on the edge of the model mesh?

  • GRAV3D computes density-contrast models assuming that all sources come from within the density-contrast  model grid, and the density-contrast outside the model is zero.  This means that if density-contrast anomalies are located near the border of the density model, the inversion will create artefacts near the borders of the model.
  • See also mesh design under Meshes above.
  • Removal of a regional trend is an important, and not necessarily easy step. Try to end up with a residual data set that has anomalous values of zero near the edges of your data set. This may not be reasonable, so include padding cells.

What is the recommend depth for models?

  • This is related to the horizontal size of the survey and to the size of the anomalies. Try for a depth of interest that is 1/4 and 1/2 of the shortest horizontal dimension, then add padding cells to the base as per horizontal padding.



How do I create input data files?

  • Data input files for EM1DFM are complicated because the program can accomodate any conceivable combination of transmitter and receiver loop orientation and frequency combinations. See the EM1DFM documentation for detailed descriptions, and for examples of DIGEM-style helicopter EM, EM-31, and MaxMin data sets.

Are there any codes for converting column-style data sets (Geosoft, DIGEM, etc) into EM1DFM format?

  • There is a limited command-line code available. See the "Utility Programs" page.

Can I invert EM-31 or similar data?

  • EM1DFM is a 1D inversion program. We have experimented with some EM-31 data, but most work has involved multiple-frequency airborn or ground data. EM-31 "soundings" tend to be rather inappropriate for smooth 1D interpretation because at best there will only be a few measurements at each location (Quad- and in-phase, with two coil orientations, and 1 or more elevations above ground).

How do I determine the depth of penetration of the signals?

  • Penetration depth is usually described in terms of skin depth. This involves frequency, ground conductivity and magnetic permeability.

How do I eliminate direct coupling between the transmitter and receiver coils?

  • In common instruments, the direct coupling signal is usually "known" electronically (and involves maintaining fixed coil spacing and orientation in the field). Alternatively Using two coils oriented perpendicularly can eliminate direct coupling, but this is tricky unless coils are maintained with perfect orientation in the field. Direct coupling can also be avoided by working in the time domain using pulsed signals. Time domain EM is commonly available, but physics, math, and instrumentation are very complicated.

How do I obtain the in-phase and quadrature signals and how to incorporate and process these data?

  • Extracting in-phase and quadrature phase is an electronics problem which requires the receiver to be carefully synchronized to the transmitter.

How do I extract 3D information from the data?

  • Extracting 3D information from the data is a problem that no one has solved satisfactorily yet (2002) in the 50-60 years of EM geophysics. Researchers are getting close to developing solutions, but the details involve subjects that keep experienced professors and PhD graduates busy for many years. Many instruments today still generate only "apparent" resistivities, and interpetation of geology is attempted from these very simple results.

How do I quantify the signals received and hence obtain the conductivity (resistivity) information from the data?

  • Generating conductivity from raw EM data can be done using several different types of approximation. The references from Geonics (below) should help. 

Where can I get more information about linear inversion and software algorithms to process the data?

  • You must talk to computer specialists to learn about programming techniques. Some general references:
  1. Many very good technical notes are available from the Geonics website. They are free but to get some of them you may need to send in a request.
  2. Older text books often provide outlines of how instrumentation works. The SEG has many excellent books, student membership is not expensive, and students get price reductions for publications. As usual, most information is about using geophysical data, not how to generate the data.

Running codes | Meshes Data and errors | Inversion theory |  DCIP2D MAG3D GRAV3D EM1DFM Utility codes | Top of page


Utility Codes

Where can I find all the MeshTools3D features?

  • In the manual found on the Utility program page.
  • Note that the program can only work with 3D volumes of values that are defined using the UBC-GIF mesh / value file system.

How much do the utility codes cost?

  • The data and model plotting tools that are freely available from UBC-GIF are made to help expedite inversion and forward modelling, NOT for building publication or commercial qualtity plots or maps. All users are expected to make use of other graphing tools for generating final high quality output images.

What to I do for the error message "Could not find program DCINV2D" when running dcip2d-gui.exe?

  • The utility program dcip2d-gui.exe is a graphical front end for UBC-GIF inversion program. The inversion program (and forward modelling codes) must be licensed. See our web page on licensing for details. dcip2d-gui.exe is provided on the web as an update to currently licensed users.

I can not run an inversion through the Mag3D GUI!

  • Mag3dGUI is the graphical front end for the UBC-GIF inversion software, which carries out 3D inversion of magnetic data. It can not run unless the inversion program can be found in the same directory OR it is within a pathed directory . You must have a licensed copy of the inversion code, and all executable programs must reside in the same directory. It is listed in the utilities area of the UBC-GIF website so that fully licensed users of inversion codes can download the latest version of the graphical user interface tools.

How are the initial colour scales in meshTools3D determined in general?

  • The initial colour scales are determined by the minimum and maximum values of the data or model being plotted.

What if I want to change the colour scale values?

  • Then that is your prerogative. Use the Options menu, Min/Max option to change the colour scale. This option is very handy to compare several different plots use this option to set consistent colour scales in all plots.

Do these colour values have to be linear? Can I choose between conductivity or resistivity?

Short answer: yes; there are buttons for each. Long answer: in DCIP2D you can choose between conductivity or resistivity, and between linear or log colour scales.

How do I look at a bunch of models or data sets at once?

  • You can always have as many versions of any utility code running as you like.

Can I view DC resistivity / IP data as pseudosections in the data viewer?

  • The UBC-GIF utility dcip2d-data-viewer can display 2D survey data gathered in the pole-pole, pole-dipole, or dipole-dipole configurations. Unfortunately other formats can not be viewed. This utility and the necessary input file format is described in the program's manual.

What do I do if I am missing the OPENGL32.DLL file for MeshTools3D?

  • If you are still using Windows95 you may need to obtain this file from the microsoft website. The error should not appear with later versions of the Windows operating system.

In MeshTools3D, are conductivity models in units of S/m or log S/m?

  • Conductivity models are in S/m linearly. There is a log button in the top menu to view in log scale.