code: def write_const_tpl(name, tpl_file, suffix, zn_array=None, shape=None, spatial_reference=None,
                      longnames=False):
      
  
  
      if shape is None and zn_array is None:
          raise Exception("must pass either zn_array or shape")
      elif shape is None:
          shape = zn_array.shape
  
      parnme = []
      with open(tpl_file, 'w') as f:
          f.write("ptf ~\n")
          for i in range(shape[0]):
              for j in range(shape[1]):
                  if zn_array is not None and zn_array[i, j] < 1:
                      pname = " 1.0  "
                  else:
                      if longnames:
                          pname = "const_{0}_{1}".format(name,suffix)
                      else:
                          pname = "{0}{1}".format(name, suffix)
                          if len(pname) > 12:
                              raise("zone pname too long:{0}". \
                                                 format(pname))
                      parnme.append(pname)
                      pname = " ~   {0}    ~".format(pname)
                  f.write(pname)
              f.write("\n")
      df = pd.DataFrame({"parnme": parnme}, index=parnme)
      # df.loc[:,"pargp"] = "{0}{1}".format(self.cn_suffixname)
      df.loc[:, "pargp"] = "{0}_{1}".format(name, suffix.replace('_', ''))
      df.loc[:, "tpl"] = tpl_file
      return df
docs: write a constant (uniform) template file
  
      Parameters
      ----------
      name : str
          the base parameter name
      tpl_file : str
          the template file to write - include path
      zn_array : numpy.ndarray
          an array used to skip inactive cells
  
      Returns
      -------
      df : pandas.DataFrame
          a dataframe with parameter information