gimli icon indicating copy to clipboard operation
gimli copied to clipboard

Separate IP inversion

Open jcmefra opened this issue 1 year ago • 5 comments

Hello, hope you are doing good. I want to know if there is a way to do a separate IP inversion instead of a joint ip-ert inversion with the ERTIPmanager(). Thank you so much in advance.

Also, if it's possible, how do I access to the individual error metrics of each inversion in the joint inversion? I'm particularly interested in the ABS error % to compare with Res2Dinv. I know the inversion method is different but that's why I want to use both to see how much my results differ.

image image

jcmefra avatar Feb 17 '24 05:02 jcmefra

In contrast to frequency domain, where one could invert for complex resistivity, there is no "joint inversion" in time-domain IP. Instead, first a resistivity inversion is done (calling the normal ERTManager inversion) and then a IP inversion that can also be called by ERTIPManager.invertTDIP(). You should see things like RMS in the output but I just see that the inversion object is not kept for further analysis. I will change this.

halbmy avatar Feb 17 '24 09:02 halbmy

So it's okay to save both inversion objects by doing inv_ert, inv_ip = mgr2.invert(args) ? I have access to the inversion verbose, but I don't know how to access to certain metrics specifically. Thank you.

Edit: does the inversion work for msec as well? I just changed the label, but I see that the ip domain is "mV/V".

Also, when I do this to invert only IP:

inv_ip = mgr.invertTDIP(secNodes=1, paraMaxCellSize=10.0,
                        zWeight=0.2, verbose=1)

I get this error:

RuntimeError: RegionManager knows no mesh.

But when I do the regular mgr.invert(secNodes=1, paraMaxCellSize=10.0, zWeight=0.2, verbose=1, it just does both inversions without defining any mesh.

jcmefra avatar Feb 19 '24 00:02 jcmefra

  1. No, the inversion object is not returned. We have to change this in the source code (to keep it as a member of the manager).
  2. Formally it is working and the results will be ok as a first-order approximation but the inversion is based on a instantaneous and not integrated chargeability.
  3. Before calling mgr.invertTDIP() you need to do a resistivity inversion through mgr.invert() (which will already do an IP inversion).

Thank you for pointing out the shortcomings in the code.

halbmy avatar Feb 19 '24 06:02 halbmy

Alright, thank you so much. I've got another question, is there a way to remove those data points where data/response relation is very high or very low and therefore lead to a higher error%? Probably doing a scatterplot for data vs response and delete those exceeding certain thereshold. so I can reduce the chi2 directly with the inversion data.

I'm not pretty sure how to actually handle errors post-inversion. Thanks in advance.

jcmefra avatar Feb 22 '24 02:02 jcmefra

Yes, of course. The data vector is in data['rhoa'] and the response vector in mgr.inv.response. You can compute the rms or error-weighted misfit and look at the histogram or the misfit distribution and then remove points

misfit = (data['rhoa'] - mgr.inv.response) / data['err']
data.remove(np.abs(misfit) > 10)

halbmy avatar May 07 '24 12:05 halbmy

As already discussed in other issues, you can separately call mgr.invertDC() and mgr.invertTDIP() with their own options. The IP inversion instance is now also stored in the manager so that everything can be accessed. Closing this issue. Thank you reporting that directly lead to code improvements.

halbmy avatar Aug 27 '24 20:08 halbmy