docs: def huji(magfile="", dir_path=".", input_dir_path="", datafile="", codelist="",
           meas_file="measurements.txt", spec_file="specimens.txt",
           samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
           user="", specnum=0, samp_con="1", labfield=0, phi=0, theta=0,
           location="", CR_cooling_times=None, noave=False):
      """
      Convert HUJI format file to MagIC file(s)
  
      Parameters
      ----------
      magfile : str
         input file name
      dir_path : str
          working directory, default "."
      input_dir_path : str
          input file directory IF different from dir_path, default ""
      datafile : str
         HUJI datafile with sample orientations, default ""
      codelist : str
          colon-delimited protocols, include all that apply
          see info below
      meas_file : str
          output measurement file name, default "measurements.txt"
      spec_file : str
          output specimen file name, default "specimens.txt"
      samp_file: str
          output sample file name, default "samples.txt"
      site_file : str
          output site file name, default "sites.txt"
      loc_file : str
          output location file name, default "locations.txt"
      user : str
          user name, default ""
      specnum : int
          number of characters to designate a specimen, default 0
      samp_con : str
          sample/site naming convention, default '1', see info below
      labfield : float
          dc lab field (in micro tesla)
      labfield_phi : float
          declination 0-360
      labfield_theta : float
          inclination -90 - 90
      location : str
          location name, default "unknown"
      CR_cooling_times : list
          default None
          cooling times in [K/minutes] seperated by comma,
          ordered at the same order as XXX.10,XXX.20 ...XX.70
      noave : bool
         do not average duplicate measurements, default False (so by default, DO average)
  
      Info
      --------
      Code list:
          AF:  af demag
          T: thermal including thellier but not trm acquisition
          N: NRM only
          TRM: trm acquisition
          ANI: anisotropy experiment
          CR: cooling rate experiment.
              The treatment coding of the measurement file should be: XXX.00,XXX.10, XXX.20 ...XX.70 etc. (XXX.00 is optional)
              where XXX in the temperature and .10,.20... are running numbers of the cooling rates steps.
              XXX.00 is optional zerofield baseline. XXX.70 is alteration check.
              syntax in sio_magic is: -LP CR xxx,yyy,zzz,.....xx
              where xx, yyy,zzz...xxx  are cooling time in [K/minutes], seperated by comma, ordered at the same order as XXX.10,XXX.20 ...XX.70
              if you use a zerofield step then no need to specify the cooling rate for the zerofield
  
      Sample naming convention:
          [1] XXXXY: where XXXX is an arbitrary length site designation and Y
              is the single character sample designation.  e.g., TG001a is the
              first sample from site TG001.    [default]
          [2] XXXX-YY: YY sample from site XXXX (XXX, YY of arbitary length)
          [3] XXXX.YY: YY sample from site XXXX (XXX, YY of arbitary length)
          [4-Z] XXXX[YYY]:  YYY is sample designation with Z characters from site XXX
          [5] site name = sample name
          [6] site name entered in site_name column in the orient.txt format input file  -- NOT CURRENTLY SUPPORTED
          [7-Z] [XXX]YYY:  XXX is site designation with Z characters from samples  XXXYYY
  
  
      """
  
      # format and validate variables
      specnum = int(specnum)
      labfield = float(labfield) * 1e-6
      phi = int(theta)
      theta = int(theta)
      input_dir_path, dir_path = pmag.fix_directories(input_dir_path, dir_path)
      if magfile:
          try:
              fname = pmag.resolve_file_name(magfile, input_dir_path)
              infile = open(fname, 'r')
          except IOError as ex:
              print(ex)
              print("bad mag file name")
              return False, "bad mag file name"
      else:
          print("mag_file field is a required option")
          return False, "mag_file field is a required option"
  
      if specnum != 0:
          specnum = -specnum
      if "4" in samp_con:
          if "-" not in samp_con:
              print("option [4] must be in form 4-Z where Z is an integer")
              return False, "option [4] must be in form 4-Z where Z is an integer"
          else:
              Z = int(samp_con.split("-")[1])
              samp_con = "4"
      if "7" in samp_con:
          if "-" not in samp_con:
              print("option [7] must be in form 7-Z where Z is an integer")
              return False, "option [7] must be in form 7-Z where Z is an integer"
          else:
              Z = int(samp_con.split("-")[1])
              samp_con = "7"
      else:
          Z = 1
  
      if codelist:
          codes = codelist.split(':')
      else:
          print(
              "-E- Must select experiment type (codelist/-LP, options are: [AF, T, ANI, TRM, CR])")
          return False, "Must select experiment type (codelist/-LP, options are: [AF, T, ANI, TRM, CR])"
      if "AF" in codes:
          demag = 'AF'
          LPcode = "LP-DIR-AF"
      if "T" in codes:
          demag = "T"
          if not labfield:
              LPcode = "LP-DIR-T"
          if labfield:
              LPcode = "LP-PI-TRM"
          if "ANI" in codes:
              if not labfield:
                  print("missing lab field option")
                  return False, "missing lab field option"
              LPcode = "LP-AN-TRM"
  
      if "TRM" in codes:
          demag = "T"
          LPcode = "LP-TRM"
          # trm=1
  
      if "CR" in codes:
          demag = "T"
          # dc should be in the code
          if not labfield:
              print("missing lab field option")
              return False, "missing lab field option"
  
          LPcode = "LP-CR-TRM"  # TRM in different cooling rates
          if command_line:
              ind = sys.argv.index("-LP")
              CR_cooling_times = sys.argv[ind+2].split(",")
  
      version_num = pmag.get_version()
  
      # --------------------------------------
      # Read the file
      # Assumption:
      # 1. different lab protocolsa are in different files
      # 2. measurements are in the correct order
      # --------------------------------------
  
      Data = {}
      line_no = 0
      for line in infile.readlines():
          line_no += 1
          this_line_data = {}
          line_no += 1
          instcode = ""
          if len(line) < 2:
              continue
          if line[0] == "#":  # HUJI way of marking bad data points
              continue
  
          rec = line.strip('\n').split()
          specimen = rec[0]
          date = rec[2].split("/")
          hour = rec[3].split(":")
          treatment_type = rec[4]
          treatment = rec[5].split(".")
          dec_core = rec[6]
          inc_core = rec[7]
          moment_emu = float(rec[-1])
  
          if specimen not in list(Data.keys()):
              Data[specimen] = []
  
          # check duplicate treatments:
          # if yes, delete the first and use the second
  
          if len(Data[specimen]) > 0:
              if treatment == Data[specimen][-1]['treatment']:
                  del(Data[specimen][-1])
                  print("-W- Identical treatments in file %s magfile line %i: specimen %s, treatment %s ignoring the first. " %
                        (magfile, line_no, specimen, ".".join(treatment)))
  
          this_line_data = {}
          this_line_data['specimen'] = specimen
          this_line_data['date'] = date
          this_line_data['hour'] = hour
          this_line_data['treatment_type'] = treatment_type
          this_line_data['treatment'] = treatment
          this_line_data['dec_core'] = dec_core
          this_line_data['inc_core'] = inc_core
          this_line_data['moment_emu'] = moment_emu
          this_line_data['azimuth'] = ''
          this_line_data['dip'] = ''
          this_line_data['bed_dip_direction'] = ''
          this_line_data['bed_dip'] = ''
          this_line_data['lat'] = ''
          this_line_data['lon'] = ''
          this_line_data['volume'] = ''
          Data[specimen].append(this_line_data)
      infile.close()
      print("-I- done reading file %s" % magfile)
  
      if datafile:
          dinfile = open(datafile)
          for line in dinfile.readlines():
              data = line.split()
              if len(data) < 8 or data[0] == '':
                  continue
              elif data[0] in list(Data.keys()):
                  for i in range(len(Data[data[0]])):
                      Data[data[0]][i]['azimuth'] = data[1]
                      Data[data[0]][i]['dip'] = data[2]
                      try:
                          Data[data[0]][i]['bed_dip_direction'] = float(
                              data[3])+90
                      except ValueError:
                          Data[data[0]][i]['bed_dip_direction'] = ''
                      Data[data[0]][i]['bed_dip'] = data[4]
                      Data[data[0]][i]['lat'] = data[5]
                      Data[data[0]][i]['lon'] = data[6]
                      Data[data[0]][i]['volume'] = data[7]
              else:
                  print(
                      "no specimen %s found in magnetometer data file when reading specimen orientation data file, or data file record for specimen too short" % data[0])
          dinfile.close()
  
      # --------------------------------------
      # Convert to MagIC
      # --------------------------------------
  
      specimens_list = list(Data.keys())
      specimens_list.sort()
  
      MeasRecs, SpecRecs, SampRecs, SiteRecs, LocRecs = [], [], [], [], []
      for specimen in specimens_list:
          for i in range(len(Data[specimen])):
              this_line_data = Data[specimen][i]
              methcode = ""
              MeasRec, SpecRec, SampRec, SiteRec, LocRec = {}, {}, {}, {}, {}
              specimen = this_line_data['specimen']
              if specnum != 0:
                  sample = this_line_data['specimen'][:specnum]
              else:
                  sample = this_line_data['specimen']
              site = pmag.parse_site(sample, samp_con, Z)
              if not location:
                  location = site
              if specimen != "" and specimen not in [x['specimen'] if 'specimen' in list(x.keys()) else "" for x in SpecRecs]:
                  SpecRec['specimen'] = specimen
                  SpecRec['sample'] = sample
                  SpecRecs.append(SpecRec)
              if sample != "" and sample not in [x['sample'] if 'sample' in list(x.keys()) else "" for x in SampRecs]:
                  SampRec['sample'] = sample
                  SampRec['site'] = site
                  SampRec['azimuth'] = this_line_data['azimuth']
                  SampRec['dip'] = this_line_data['dip']
                  SampRec['bed_dip_direction'] = this_line_data['bed_dip_direction']
                  SampRec['bed_dip'] = this_line_data['bed_dip']
                  SampRecs.append(SampRec)
              if site != "" and site not in [x['site'] if 'site' in list(x.keys()) else "" for x in SiteRecs]:
                  SiteRec['site'] = site
                  SiteRec['location'] = location
                  SiteRec['lat'] = this_line_data['lat']
                  SiteRec['lon'] = this_line_data['lon']
                  SiteRecs.append(SiteRec)
              if location != "" and location not in [x['location'] if 'location' in list(x.keys()) else "" for x in LocRecs]:
                  LocRec['location'] = location
                  LocRec['lat_n'] = this_line_data['lat']
                  LocRec['lon_e'] = this_line_data['lon']
                  LocRec['lat_s'] = this_line_data['lat']
                  LocRec['lon_w'] = this_line_data['lon']
                  LocRecs.append(LocRec)
  
              MeasRec['specimen'] = specimen
              MeasRec["meas_temp"] = '%8.3e' % (273)  # room temp in kelvin
              MeasRec["magn_moment"] = '%10.3e' % (
                  float(this_line_data['moment_emu'])*1e-3)  # moment in Am^2 (from emu)
              MeasRec["dir_dec"] = this_line_data['dec_core']
              MeasRec["dir_inc"] = this_line_data['inc_core']
  
              date = this_line_data['date']
              hour = this_line_data['hour']
              if len(date[2]) < 4 and float(date[2]) >= 70:
                  yyyy = "19"+date[2]
              elif len(date[2]) < 4 and float(date[2]) < 70:
                  yyyy = "20"+date[2]
              else:
                  yyyy = date[2]
              if len(date[0]) == 1:
                  date[0] = "0"+date[0]
              if len(date[1]) == 1:
                  date[1] = "0"+date[1]
              dt = ":".join([date[0], date[1], yyyy, hour[0], hour[1], "0"])
              local = pytz.timezone("America/New_York")
              naive = datetime.datetime.strptime(dt, "%m:%d:%Y:%H:%M:%S")
              local_dt = local.localize(naive, is_dst=None)
              utc_dt = local_dt.astimezone(pytz.utc)
              timestamp = utc_dt.strftime("%Y-%m-%dT%H:%M:%S")+"Z"
  
              MeasRec['analysts'] = user
              MeasRec["citations"] = "This study"
              MeasRec["instrument_codes"] = "HUJI-2G"
              MeasRec["quality"] = "g"
              MeasRec["meas_n_orient"] = "1"
              MeasRec["standard"] = "u"
              MeasRec["description"] = ""
  
              # ----------------------------------------
              # AF demag
              # do not support AARM yet
              # ----------------------------------------
  
              if demag == "AF":
                  treatment_type = this_line_data['treatment_type']
                  # demag in zero field
                  if LPcode != "LP-AN-ARM":
                      MeasRec["treat_ac_field"] = '%8.3e' % (
                          float(this_line_data['treatment'][0])*1e-3)  # peak field in tesla
                      MeasRec["treat_dc_field"] = '0'
                      MeasRec["treat_dc_field_phi"] = '0'
                      MeasRec["treat_dc_field_theta"] = '0'
                      if treatment_type == "N":
                          methcode = "LP-DIR-AF:LT-NO"
                      elif treatment_type == "A":
                          methcode = "LP-DIR-AF:LT-AF-Z"
                      else:
                          print(
                              "ERROR in treatment field line %i... exiting until you fix the problem" % line_no)
                          print(this_line_data)
                          return False, "ERROR in treatment field line %i... exiting until you fix the problem" % line_no
                  # AARM experiment
                  else:
                      print("Don't support AARM in HUJI format yet. sorry... ")
                  MeasRec["method_codes"] = methcode
                  MeasRec["experiment"] = specimen + ":" + LPcode
                  MeasRec["treat_step_num"] = "%i" % i
                  MeasRec["description"] = ""
  
                  MeasRecs.append(MeasRec)
  
              # ----------------------------------------
              # Thermal:
              # Thellier experiment: "IZ", "ZI", "IZZI", pTRM checks
              # Thermal demag
              # Thermal cooling rate experiment
              # Thermal NLT
              # ----------------------------------------
  
              if demag == "T":
  
                  treatment = this_line_data['treatment']
                  treatment_type = this_line_data['treatment_type']
  
                  # ----------------------------------------
                  # Thellier experimet
                  # ----------------------------------------
  
                  if LPcode == "LP-PI-TRM":  # Thelllier experiment
                      MeasRec["experiment"] = specimen + ":" + LPcode
                      methcode = LPcode
                      if treatment_type == "N" or ((treatment[1] == '0' or treatment[1] == '00') and float(treatment[0]) == 0):
                          LT_code = "LT-NO"
                          MeasRec["treat_dc_field_phi"] = '0'
                          MeasRec["treat_dc_field_theta"] = '0'
                          MeasRec["treat_dc_field"] = '0'
                          MeasRec["treat_temp"] = '273.'
  
                      elif treatment[1] == '0' or treatment[1] == '00':
                          LT_code = "LT-T-Z"
                          MeasRec["treat_dc_field_phi"] = '0'
                          MeasRec["treat_dc_field_theta"] = '0'
                          MeasRec["treat_dc_field"] = '%8.3e' % (0)
                          MeasRec["treat_temp"] = '%8.3e' % (
                              float(treatment[0])+273.)  # temp in kelvin
  
                          # check if this is ZI or IZ:
                          #  check if the same temperature already measured:
                          methcode = "LP-PI-TRM:LP-PI-TRM-ZI"
                          for j in range(0, i):
                              if Data[specimen][j]['treatment'][0] == treatment[0]:
                                  if Data[specimen][j]['treatment'][1] == '1' or Data[specimen][j]['treatment'][1] == '10':
                                      methcode = "LP-PI-TRM:LP-PI-TRM-IZ"
                                  else:
                                      methcode = "LP-PI-TRM:LP-PI-TRM-ZI"
  
                      elif treatment[1] == '1' or treatment[1] == '10':
                          LT_code = "LT-T-I"
                          # labfield in tesla (convert from microT)
                          MeasRec["treat_dc_field"] = '%8.3e' % (labfield)
                          MeasRec["treat_dc_field_phi"] = '%7.1f' % (
                              phi)  # labfield phi
                          MeasRec["treat_dc_field_theta"] = '%7.1f' % (
                              theta)  # labfield theta
                          MeasRec["treat_temp"] = '%8.3e' % (
                              float(treatment[0])+273.)  # temp in kelvin
  
                          # check if this is ZI or IZ:
                          #  check if the same temperature already measured:
                          methcode = "LP-PI-TRM:LP-PI-TRM-IZ"
                          for j in range(0, i):
                              if Data[specimen][j]['treatment'][0] == treatment[0]:
                                  if Data[specimen][j]['treatment'][1] == '0' or Data[specimen][j]['treatment'][1] == '00':
                                      methcode = "LP-PI-TRM:LP-PI-TRM-ZI"
                                  else:
                                      methcode = "LP-PI-TRM:LP-PI-TRM-IZ"
                      elif treatment[1] == '2' or treatment[1] == '20':
                          LT_code = "LT-PTRM-I"
                          # labfield in tesla (convert from microT)
                          MeasRec["treat_dc_field"] = '%8.3e' % (labfield)
                          MeasRec["treat_dc_field_phi"] = '%7.1f' % (
                              phi)  # labfield phi
                          MeasRec["treat_dc_field_theta"] = '%7.1f' % (
                              theta)  # labfield theta
                          MeasRec["treat_temp"] = '%8.3e' % (
                              float(treatment[0])+273.)  # temp in kelvin
                          methcode = "LP-PI-TRM:LP-PI-TRM-IZ"
  
                      else:
                          print(
                              "ERROR in treatment field line %i... exiting until you fix the problem" % line_no)
                          return False, "ERROR in treatment field line %i... exiting until you fix the problem" % line_no
                      MeasRec["method_codes"] = LT_code+":"+methcode
                      MeasRec["treat_step_num"] = "%i" % i
                      MeasRec["description"] = ""
                      MeasRecs.append(MeasRec)
  
                  # ----------------------------------------
                  # demag experimet
                  # ----------------------------------------
  
                  if LPcode == "LP-DIR-T":
                      MeasRec["experiment"] = specimen + ":" + LPcode
                      methcode = LPcode
                      if treatment_type == "N":
                          LT_code = "LT-NO"
                      else:
                          LT_code = "LT-T-Z"
                          methcode = LPcode+":"+"LT-T-Z"
                      MeasRec["treat_dc_field_phi"] = '0'
                      MeasRec["treat_dc_field_theta"] = '0'
                      MeasRec["treat_dc_field"] = '%8.3e' % (0)
                      MeasRec["treat_temp"] = '%8.3e' % (
                          float(treatment[0])+273.)  # temp in kelvin
                      MeasRec["method_codes"] = LT_code+":"+methcode
                      MeasRec["treat_step_num"] = "%i" % i
                      MeasRec["description"] = ""
                      MeasRecs.append(MeasRec)
                      # continue
  
                  # ----------------------------------------
                  # ATRM measurements
                  # The direction of the magnetization is used to determine the
                  # direction of the lab field.
                  # ----------------------------------------
  
                  if LPcode == "LP-AN-TRM":
                      MeasRec["experiment"] = specimen + ":" + LPcode
                      methcode = LPcode
  
                      if float(treatment[1]) == 0:
                          MeasRec["method_codes"] = "LP-AN-TRM:LT-T-Z"
                          MeasRec["treat_dc_field_phi"] = '0'
                          MeasRec["treat_dc_field_theta"] = '0'
                          MeasRec["treat_temp"] = '%8.3e' % (
                              float(treatment[0])+273.)  # temp in kelvin
                          MeasRec["treat_dc_field"] = '0'
                      else:
                          if float(treatment[1]) == 7:
                              # alteration check
                              methcode = "LP-AN-TRM:LT-PTRM-I"
                              MeasRec["treat_step_num"] = '7'  # -z
                          else:
                              MeasRec["method_codes"] = "LP-AN-TRM:LT-T-I"
                              inc = float(MeasRec["dir_inc"])
                              dec = float(MeasRec["dir_dec"])
                              if abs(inc) < 45 and (dec < 45 or dec > 315):  # +x
                                  tdec, tinc = 0, 0
                                  MeasRec["treat_step_num"] = '1'
                              if abs(inc) < 45 and (dec < 135 and dec > 45):
                                  tdec, tinc = 90, 0
                                  MeasRec["treat_step_num"] = '2'  # +y
                              if inc > 45:
                                  tdec, tinc = 0, 90
                                  MeasRec["treat_step_num"] = '3'  # +z
                              if abs(inc) < 45 and (dec < 225 and dec > 135):
                                  tdec, tinc = 180, 0
                                  MeasRec["treat_step_num"] = '4'  # -x
                              if abs(inc) < 45 and (dec < 315 and dec > 225):
                                  tdec, tinc = 270, 0
                                  MeasRec["treat_step_num"] = '5'  # -y
                              if inc < -45:
                                  tdec, tinc = 0, -90
                                  MeasRec["treat_step_num"] = '6'  # -z
  
                          MeasRec["treat_dc_field_phi"] = '%7.1f' % (tdec)
                          MeasRec["treat_dc_field_theta"] = '%7.1f' % (tinc)
                          MeasRec["treat_temp"] = '%8.3e' % (
                              float(treatment[0])+273.)  # temp in kelvin
                          MeasRec["treat_dc_field"] = '%8.3e' % (labfield)
                      MeasRec["description"] = ""
                      MeasRecs.append(MeasRec)
                      # continue
  
                  # ----------------------------------------
                  # NLT measurements
                  # or TRM acquisistion experiment
                  # ----------------------------------------
  
                  if LPcode == "LP-TRM":
                      MeasRec["experiment"] = specimen + ":" + LPcode
                      MeasRec["method_codes"] = "LP-TRM:LT-T-I"
                      if float(treatment[1]) == 0:
                          labfield = 0
                      else:
                          labfield = float(float(treatment[1]))*1e-6
                      MeasRec["treat_temp"] = '%8.3e' % (
                          float(treatment[0])+273.)  # temp in kelvin
                      # labfield in tesla (convert from microT)
                      MeasRec["treat_dc_field"] = '%8.3e' % (labfield)
                      MeasRec["treat_dc_field_phi"] = '%7.1f' % (
                          phi)  # labfield phi
                      MeasRec["treat_dc_field_theta"] = '%7.1f' % (
                          theta)  # labfield theta
                      MeasRec["treat_step_num"] = "%i" % i
                      MeasRec["description"] = ""
                      MeasRecs.append(MeasRec)
                      # continue
  
                  # ----------------------------------------
                  # Cooling rate experiments
                  # ----------------------------------------
  
                  if LPcode == "LP-CR-TRM":
                      index = int(treatment[1][0])
                      # print index,"index"
                      # print CR_cooling_times,"CR_cooling_times"
                      # print CR_cooling_times[index-1]
                      # print CR_cooling_times[0:index-1]
                      if index == 7 or index == 70:  # alteration check as final measurement
                          meas_type = "LT-PTRM-I:LP-CR-TRM"
                          CR_cooling_time = CR_cooling_times[-1]
                      else:
                          meas_type = "LT-T-I:LP-CR-TRM"
                          CR_cooling_time = CR_cooling_times[index-1]
                      MeasRec["method_codes"] = meas_type
                      MeasRec["experiment"] = specimen + ":" + LPcode
                      MeasRec["treat_temp"] = '%8.3e' % (
                          float(treatment[0])+273.)  # temp in kelvin
                      # labfield in tesla (convert from microT)
                      MeasRec["treat_dc_field"] = '%8.3e' % (labfield)
                      MeasRec["treat_dc_field_phi"] = '%7.1f' % (
                          phi)  # labfield phi
                      MeasRec["treat_dc_field_theta"] = '%7.1f' % (
                          theta)  # labfield theta
                      MeasRec["treat_step_num"] = "%i" % index
                      MeasRec["description"] = "cooling_rate" + \
                          ":"+CR_cooling_time+":"+"K/min"
                      #MeasRec["description"]="%.1f minutes per cooling time"%int(CR_cooling_time)
                      MeasRecs.append(MeasRec)
                      # continue
  
      con = cb.Contribution(dir_path, read_tables=[])
  
      con.add_magic_table_from_data(dtype='specimens', data=SpecRecs)
      con.add_magic_table_from_data(dtype='samples', data=SampRecs)
      con.add_magic_table_from_data(dtype='sites', data=SiteRecs)
      con.add_magic_table_from_data(dtype='locations', data=LocRecs)
      MeasOuts = pmag.measurements_methods3(MeasRecs, noave)
      con.add_magic_table_from_data(dtype='measurements', data=MeasOuts)
  
      con.tables['specimens'].write_magic_file(custom_name=spec_file,dir_path=dir_path)
      con.tables['samples'].write_magic_file(custom_name=samp_file,dir_path=dir_path)
      con.tables['sites'].write_magic_file(custom_name=site_file,dir_path=dir_path)
      con.tables['locations'].write_magic_file(custom_name=loc_file,dir_path=dir_path)
      con.tables['measurements'].write_magic_file(custom_name=meas_file,dir_path=dir_path)
  
      return True, meas_file