<commit_before>import numpy as np
import scipy as sp
from scipy.sparse import csr_matrix
from SimPEG import mkvc
import scipy.optimize as op
from em_examples.Base import widgetify
from ipywidgets import interact,interactive, IntSlider, FloatSlider, FloatText, ToggleButtons, HBox
import matplotlib.pyplot as plt
from IPython.display import display
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection



##############################################################################
#       DEFINE WIDGET CALL
##############################################################################

def ImageUXOWidget():

    Out = interactive(fcnImageUXOWidget,psi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\psi$"),\
            theta=FloatSlider(min=0, max=180., value=-0., step=10., continuous_update=False, description = "$\\theta$"),\
            phi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\phi$"),\
            k1=FloatSlider(min=100., max=1000., value=400., step=10., continuous_update=False, description = "$k_{x'}$"),\
            alpha1=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{x'}$"),\
            beta1=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{x'}$"),\
            gamma1=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{x'}$)"),\
            k2=FloatSlider(min=100., max=1000., value=300., step=10., continuous_update=False, description = "$k_{y'}$"),\
            alpha2=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{y'}$"),\
            beta2=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{y'}$"),\
            gamma2=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{y'}$)"),\
            k3=FloatSlider(min=100., max=1000., value=1000., step=10., continuous_update=False, description = "$k_{z'}$"),\
            alpha3=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{z'}$"),\
            beta3=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{z'}$"),\
            gamma3=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{z'}$)"),\
            tn=IntSlider(min=1, max=11, value=1., step=1, continuous_update=False, description = "Time channel"))
    
    return Out









def ImageDataWidget(TxType):

    # TxType MUST be: "EM61", "TEMTADS" or "MPV"
    
    if TxType is "EM61":

        Out = interactive(fcnImageDataWidgetEM61,x0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$x_0$"),\
            y0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$y_0$"),\
            z0=FloatSlider(min=-2., max=-0.1, value=-0.5, step=0.05, continuous_update=False, description = "$z_0$"),\
            psi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\psi$"),\
            theta=FloatSlider(min=0, max=180., value=-0., step=10., continuous_update=False, description = "$\\theta$"),\
            phi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\phi$"),\
            k1=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{x'}$"),\
            alpha1=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{x'}$"),\
            beta1=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{x'}$"),\
            gamma1=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{x'}$)"),\
            k2=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{y'}$"),\
            alpha2=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{y'}$"),\
            beta2=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{y'}$"),\
            gamma2=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{y'}$)"),\
            k3=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{z'}$"),\
            alpha3=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{z'}$"),\
            beta3=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{z'}$"),\
            gamma3=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{z'}$)"),\
            tn=IntSlider(min=1, max=11, value=1., step=1, continuous_update=False, description = "Time channel"),\
            xTx=FloatSlider(min=-3., max=3., value=0., step=0.25, continuous_update=False, description = "X location"),\
            yTx=FloatSlider(min=-3., max=3., value=0., step=0.25, continuous_update=False, description = "Y location"))
    
    elif TxType is "TEMTADS":
        Out = interactive(fcnImageDataWidgetTEMTADS,x0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$x_0$"),\
            y0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$y_0$"),\
            z0=FloatSlider(min=-2., max=-0.1, value=-0.5, step=0.05, continuous_update=False, description = "$z_0$"),\
            psi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\psi$"),\
            theta=FloatSlider(min=0, max=180., value=-0., step=10., continuous_update=False, description = "$\\theta$"),\
            phi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\phi$"),\
            k1=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{x'}$"),\
            alpha1=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{x'}$"),\
            beta1=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{x'}$"),\
            gamma1=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{x'}$)"),\
            k2=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{y'}$"),\
            alpha2=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{y'}$"),\
            beta2=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{y'}$"),\
            gamma2=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{y'}$)"),\
            k3=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{z'}$"),\
            alpha3=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{z'}$"),\
            beta3=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{z'}$"),\
            gamma3=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{z'}$)"),\
            tn=IntSlider(min=1, max=11, value=1., step=1, continuous_update=False, description = "Time channel"),\
            xTx=FloatSlider(min=-3, max=3, value=0., step=0.25, continuous_update=False, description = "Tx x location"),\
            yTx=FloatSlider(min=-3, max=3, value=0., step=0.25, continuous_update=False, description = "Tx y location"))

    elif TxType is "MPV":
        Out = interactive(fcnImageDataWidgetMPV,x0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$x_0$"),\
            y0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$y_0$"),\
            z0=FloatSlider(min=-2., max=-0.1, value=-0.5, step=0.05, continuous_update=False, description = "$z_0$"),\
            psi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\psi$"),\
            theta=FloatSlider(min=0, max=180., value=-0., step=10., continuous_update=False, description = "$\\theta$"),\
            phi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\phi$"),\<commit_msg>Filled in markdown<commit_after>import numpy as np
import scipy as sp
from scipy.sparse import csr_matrix
from SimPEG import mkvc
import scipy.optimize as op
from em_examples.Base import widgetify
from ipywidgets import interact,interactive, IntSlider, FloatSlider, FloatText, ToggleButtons, HBox
import matplotlib.pyplot as plt
from IPython.display import display
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection



##############################################################################
#       DEFINE WIDGET CALL
##############################################################################

def ImageUXOWidget():

    Out = interactive(fcnImageUXOWidget,psi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\psi$"),\
            theta=FloatSlider(min=0, max=180., value=-0., step=10., continuous_update=False, description = "$\\theta$"),\
            phi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\phi$"),\
            k1=FloatSlider(min=100., max=1000., value=400., step=10., continuous_update=False, description = "$k_{x'}$"),\
            alpha1=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{x'}$"),\
            beta1=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{x'}$"),\
            gamma1=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{x'}$)"),\
            k2=FloatSlider(min=100., max=1000., value=300., step=10., continuous_update=False, description = "$k_{y'}$"),\
            alpha2=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{y'}$"),\
            beta2=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{y'}$"),\
            gamma2=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{y'}$)"),\
            k3=FloatSlider(min=100., max=1000., value=1000., step=10., continuous_update=False, description = "$k_{z'}$"),\
            alpha3=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{z'}$"),\
            beta3=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{z'}$"),\
            gamma3=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{z'}$)"),\
            tn=IntSlider(min=1, max=11, value=1., step=1, continuous_update=False, description = "Time channel"))
    
    return Out









def ImageDataWidget(TxType):

    # TxType MUST be: "EM61", "TEMTADS" or "MPV"
    
    if TxType is "EM61":

        Out = interactive(fcnImageDataWidgetEM61,x0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$x_{true}$"),\
            y0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$y_{true}$"),\
            z0=FloatSlider(min=-2., max=-0.1, value=-0.5, step=0.05, continuous_update=False, description = "$z_{true}$"),\
            psi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\psi$"),\
            theta=FloatSlider(min=0, max=180., value=-0., step=10., continuous_update=False, description = "$\\theta$"),\
            phi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\phi$"),\
            k1=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{x'}$"),\
            alpha1=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{x'}$"),\
            beta1=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{x'}$"),\
            gamma1=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{x'}$)"),\
            k2=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{y'}$"),\
            alpha2=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{y'}$"),\
            beta2=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{y'}$"),\
            gamma2=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{y'}$)"),\
            k3=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{z'}$"),\
            alpha3=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{z'}$"),\
            beta3=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{z'}$"),\
            gamma3=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{z'}$)"),\
            tn=IntSlider(min=1, max=11, value=1., step=1, continuous_update=False, description = "Time channel"),\
            xTx=FloatSlider(min=-3., max=3., value=0., step=0.25, continuous_update=False, description = "X location"),\
            yTx=FloatSlider(min=-3., max=3., value=0., step=0.25, continuous_update=False, description = "Y location"))
    
    elif TxType is "TEMTADS":
        Out = interactive(fcnImageDataWidgetTEMTADS,x0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$x_{true}$"),\
            y0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$y_{true}$"),\
            z0=FloatSlider(min=-2., max=-0.1, value=-0.5, step=0.05, continuous_update=False, description = "$z_{true}$"),\
            psi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\psi$"),\
            theta=FloatSlider(min=0, max=180., value=-0., step=10., continuous_update=False, description = "$\\theta$"),\
            phi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\phi$"),\
            k1=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{x'}$"),\
            alpha1=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{x'}$"),\
            beta1=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{x'}$"),\
            gamma1=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{x'}$)"),\
            k2=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{y'}$"),\
            alpha2=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{y'}$"),\
            beta2=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{y'}$"),\
            gamma2=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{y'}$)"),\
            k3=FloatSlider(min=100., max=1000., value=500., step=10., continuous_update=False, description = "$k_{z'}$"),\
            alpha3=FloatSlider(min=1., max=2., value=1.4, step=0.1, continuous_update=False, description = "$\\alpha_{z'}$"),\
            beta3=FloatSlider(min=1., max=1.5, value=1.3, step=0.1, continuous_update=False, description = "$\\beta_{z'}$"),\
            gamma3=FloatSlider(min=-4., max=-2., value=-3., step=0.1, continuous_update=False, description = "log($\gamma_{z'}$)"),\
            tn=IntSlider(min=1, max=11, value=1., step=1, continuous_update=False, description = "Time channel"),\
            xTx=FloatSlider(min=-3, max=3, value=0., step=0.25, continuous_update=False, description = "Tx x location"),\
            yTx=FloatSlider(min=-3, max=3, value=0., step=0.25, continuous_update=False, description = "Tx y location"))

    elif TxType is "MPV":
        Out = interactive(fcnImageDataWidgetMPV,x0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$x_{true}$"),\
            y0=FloatSlider(min=-2., max=2., value=0., step=0.05, continuous_update=False, description = "$y_{true}$"),\
            z0=FloatSlider(min=-2., max=-0.1, value=-0.5, step=0.05, continuous_update=False, description = "$z_{true}$"),\
            psi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\psi$"),\
            theta=FloatSlider(min=0, max=180., value=-0., step=10., continuous_update=False, description = "$\\theta$"),\
            phi=FloatSlider(min=-180., max=180., value=-0., step=10., continuous_update=False, description = "$\phi$"),\
{'fraction_non_alphanumeric': 0.22063261428411757, 'fraction_numerical': 0.05929361797250475, 'mean_word_length': 3.8325681879557116, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1182598', 'n_tokens_mistral': 6331, 'n_tokens_neox': 6063, 'n_words': 1077}