set form {
  GuidoForm form_1 {
    -default_buttons
    -label "Ordinary kriging"
    GuidoPanel panel_1 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_1 {
      -height 26
      -width 80
        GuidoTextArea text_1 {
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
Ordinary kriging will now be performed to estimate values using an anisotropic search.  Six forms will be presented.

The first form is used to enter the name of the attribute (anisotropic_kriged_gold) to receive the estimated value.

The second form allows you to optionally name new or existing attributes to receive values for:
- anisotropic distance from the block centroid to the nearest data point
- average anisotropic distance from the block centroid to all data points used in the estimation of the block
- number of samples used in the estimation of the block
- block kriging variance
(These attributes will not be used in this example.)

The third form is where the string file, string number(s) and description field containing the data is entered.
In this case, we will use the D1 values from strings 1 and 2 of gold_cut17.str 

The values from the anisotropy ellipsoid report are entered on the fourth form.

The fifth form allows you to open a variogram parameter file (major_axis.vgm).  
Doing this inserts the variogram values of nugget, sill, and range into the form.

The sixth form displays the constraint which is used to limit the blocks which receive estimated values.

Review the information presented on each form and press APPLY.  Do not modify any values.
"
        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}


set status [ SclFunction "BM CLEAR ATTRIBUTES" {
  frm20514={
    {
      all="N"
      constrain="N"
      atts={
        {
          att="anisotropic_kriged_gold"
        }
      }
    }
  }
}]

set status [ SclFunction "BM FILL OK" {
  frm20030={
    {
      _action=display
      attname="anisotropic_kriged_gold"
    }
  }
  frm20601={
    {
      _action=display
      dist_att=""
      avgdist_att=""
      numsam_att=""
      kgvar_att=""
    }
  }
  frm20040={
    {
      _action=display
      datasrc="STRING FILE"
      location="gold_cut"
      id="17"
      range="1,2"
      field="1"
      constrain="N"
    }
  }
  frm20080={
    {
      _action=display
      search="ELLIPSOID"
      minsamples="3"
      maxsamples="10"
      majordist="99999"
      vertdist="99999"
      const_by_id="N"
      majorbrg="207"
      dip="-45"
      tilt="-10"
      semimajfact="1.7"
      minorfact="5.1"
      string_file_source="true"
      rotationTypes="Surpac ZXY LRL"
      first_axis_rotation="L"
      sec_axis_rotation="R"
      third_axis_rotation="L"
      sec_axis="X"
      third_axis="Y"
    }
  }
  frm20101={
    {
      _action=display
      vg_model_file_name="major_axis.vgm"
      model="SPHERICAL"
      co="0.4"
      c1="0.6"
      a1="168"
      azimuth1="207"
      plunge1="-10"
      dip1="-45"
      semi_ratio1="1.7"
      minor_ratio1="5.1"
      dpt0="1"
      dpt1="1"
      dpt2="1"
      outfile="anisotropic_ok_report.not"
      debug="Y"
      constrain="Y"
    }
  }
  frm20111={
    {
    _action=display
      constraints=table { not op contype location id rnga rngb lbound ubound ext } {
        { "" "INSIDE" "CONSTRAINT" "qv1" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
      }
      conexp=""
      confile=""
      keep_blocks="N"
    }
  }
  frm00121={
    {
      _action="apply"
    }
  }
}]

set status [ SclFunction "BM GRAPHICS ATTRIBUTE COLOUR" {
  frm20504={
    {
      default_face="pink"
      default_edge="blue"
      attribute="anisotropic_kriged_gold"
      range="0;0.5;1,5;10;15;20"
      legend_location="left"
      legend_title="aniso_gold"
      numdecimals="2"
      zzzasd=table { color } {
        { "r=0.0 g=0.2 b=0.6" }
        { "r=0.152 g=0.486 b=0.721" }
        { "r=0.058 g=0.874 b=0.737" }
        { "r=0.031 g=0.741 b=0.388" }
        { "yellow" }
        { "r=0.964 g=0.776 b=0.027" }
        { "r=0.921 g=0.474 b=0.058" }
        { "r=0.8 g=0.2 b=0.0" }
        { "r=0.6 g=0.0 b=0.4" }
        { "r=0.8 g=0.0 b=0.8" }
      }
    }
  }
}]

SclPause 2

set form {
  GuidoForm form_2 {
    -default_buttons
    -label "Ordinary kriging"
    GuidoPanel panel_2 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_2 {
      -height 13
      -width 80
        GuidoTextArea text_2 {
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
Ordinary kriging will now be performed to estimate values using an isotropic search.

This is done on the fourth form, where the anisotropy ratios are both set to 1:
major/semi-major = 1
major/minor = 1

Note that on the fifth form, the variogram model is the same as before.

Review the information presented on each form and press APPLY.  Do not modify any values.
"
        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}

set status [ SclFunction "BM CLEAR ATTRIBUTES" {
  frm20514={
    {
      all="N"
      constrain="N"
      atts={
        {
          att="isotropic_kriged_gold"
        }
      }
    }
  }
}]

set status [ SclFunction "BM FILL OK" {
  frm20030={
    {
      _action=display
      attname="isotropic_kriged_gold"
    }
  }
  frm20601={
    {
      _action=display
      dist_att=""
      avgdist_att=""
      numsam_att=""
      kgvar_att=""
    }
  }
  frm20040={
    {
      _action=display
      datasrc="STRING FILE"
      location="gold_cut"
      id="17"
      range="1,2"
      field="1"
      constrain="N"
    }
  }
  frm20080={
    {
      _action=display
      search="ELLIPSOID"
      minsamples="3"
      maxsamples="10"
      majordist="99999"
      vertdist="99999"
      const_by_id="N"
      majorbrg="0"
      dip="0"
      tilt="0"
      semimajfact="1"
      minorfact="1"
      string_file_source="true"
      rotationTypes="Surpac ZXY LRL"
      first_axis_rotation="L"
      sec_axis_rotation="R"
      third_axis_rotation="L"
      sec_axis="X"
      third_axis="Y"
    }
  }
  frm20101={
    {
      _action=display
      vg_model_file_name="major_axis.vgm"
      model="SPHERICAL"
      co="0.4"
      c1="0.6"
      a1="168"
      azimuth1="0"
      plunge1="0"
      dip1="0"
      semi_ratio1="1"
      minor_ratio1="1"
      dpt0="1"
      dpt1="1"
      dpt2="1"
      outfile="isotropic_ok_report.not"
      debug="Y"
      constrain="Y"
    }
  }
  frm20111={
    {
      _action=display
      constraints=table { not op contype location id rnga rngb lbound ubound ext } {
        { "" "INSIDE" "CONSTRAINT" "qv1" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
      }
      conexp=""
      confile=""
      keep_blocks="N"
    }
  }
  frm00121={
    {
      _action="apply"
    }
  }
}]


set status [ SclFunction "BM SAVE MODEL" {
  frm00121={
    {
      _action="apply"
    }
  }
}]

set status [ SclFunction "BM GRAPHICS ATTRIBUTE COLOUR" {
  frm20504={
    {
      default_face="pink"
      default_edge="blue"
      attribute="isotropic_kriged_gold"
      range="0;0.5;1,5;10;15;20"
      legend_location="left"
      legend_title="iso_gold"
      numdecimals="2"
      zzzasd=table { color } {
        { "r=0.0 g=0.2 b=0.6" }
        { "r=0.152 g=0.486 b=0.721" }
        { "r=0.058 g=0.874 b=0.737" }
        { "r=0.031 g=0.741 b=0.388" }
        { "yellow" }
        { "r=0.964 g=0.776 b=0.027" }
        { "r=0.921 g=0.474 b=0.058" }
        { "r=0.8 g=0.2 b=0.0" }
        { "r=0.6 g=0.0 b=0.4" }
        { "r=0.8 g=0.0 b=0.8" }
      }
    }
  }
}]

SclPause 2

set status [ SclFunction "BM GRAPHICS ATTRIBUTE COLOUR" {
  frm20504={
    {
      default_face="pink"
      default_edge="blue"
      attribute="aniso_iso_diff"
      range="-5,5,1"
      legend_location="left"
      legend_title="aniso_iso_diff"
      numdecimals="2"
      zzzasd=table { color } {
        { "r=0.0 g=0.2 b=0.6" }
        { "r=0.152 g=0.486 b=0.721" }
        { "r=0.058 g=0.874 b=0.737" }
        { "r=0.031 g=0.741 b=0.388" }
        { "yellow" }
        { "r=0.964 g=0.776 b=0.027" }
        { "r=0.921 g=0.474 b=0.058" }
        { "r=0.8 g=0.2 b=0.0" }
        { "r=0.6 g=0.0 b=0.4" }
        { "r=0.8 g=0.0 b=0.8" }
      }
    }
  }
}]
puts ""
puts ""
puts " macro _10_ordinary kriging.tcl completed"
puts ""


