docs: def sortshaw(s, datablock):
      """
       sorts data block in to ARM1,ARM2 NRM,TRM,ARM1,ARM2=[],[],[],[]
       stick  first zero field stuff into first_Z
      """
      for rec in datablock:
          methcodes = rec["magic_method_codes"].split(":")
          step = float(rec["treatment_ac_field"])
          str = float(rec["measurement_magn_moment"])
          if "LT-NO" in methcodes:
              NRM.append([0, str])
          if "LT-T-I" in methcodes:
              TRM.append([0, str])
              field = float(rec["treatment_dc_field"])
          if "LT-AF-I" in methcodes:
              ARM1.append([0, str])
          if "LT-AF-I-2" in methcodes:
              ARM2.append([0, str])
          if "LT-AF-Z" in methcodes:
              if "LP-ARM-AFD" in methcodes:
                  ARM1.append([step, str])
              elif "LP-TRM-AFD" in methcodes:
                  TRM.append([step, str])
              elif "LP-ARM2-AFD" in methcodes:
                  ARM2.append([step, str])
              else:
                  NRM.append([step, str])
      cont = 1
      while cont == 1:
          if len(NRM) != len(TRM):
              print("Uneven NRM/TRM steps: ")
              NRM, TRM, cont = cleanup(TRM, NRM)
          else:
              cont = 0
      cont = 1
      while cont == 1:
          if len(ARM1) != len(ARM2):
              print("Uneven ARM1/ARM2 steps: ")
              ARM1, ARM2, cont = cleanup(ARM2, ARM1)
          else:
              cont = 0
  #
  # final check
  #
      if len(NRM) != len(TRM) or len(ARM1) != len(ARM2):
          print(len(NRM), len(TRM), len(ARM1), len(ARM2))
          print(" Something wrong with this specimen! Better fix it or delete it ")
          input(" press return to acknowledge message")
  # now do the ratio to "fix" NRM/TRM data
  # a
      TRM_ADJ = []
      for kk in range(len(TRM)):
          step = TRM[kk][0]
          for k in range(len(ARM1)):
              if ARM1[k][0] == step:
                  TRM_ADJ.append([step, TRM[kk][1] * ARM1[k][1] / ARM2[k][1]])
                  break
      shawblock = (NRM, TRM, ARM1, ARM2, TRM_ADJ)
      return shawblock, field