write an instruction file for a MODFLOW list file

    Parameters
    ----------
    ins_filename : str
        name of the instruction file to write
    df : pandas.DataFrame
        the dataframe of list file entries
    prefix : str
        the prefix to add to the column names to form
        obseravtions names

def _write_mflist_ins(ins_filename,df,prefix):
    """ write an instruction file for a MODFLOW list file

    Parameters
    ----------
    ins_filename : str
        name of the instruction file to write
    df : pandas.DataFrame
        the dataframe of list file entries
    prefix : str
        the prefix to add to the column names to form
        obseravtions names

    """

    dt_str = df.index.map(lambda x: x.strftime("%Y%m%d"))
    name_len = 11 - (len(prefix)+1)
    with open(ins_filename,'w') as f:
        f.write('pif ~\nl1\n')

        for dt in dt_str:
            f.write("l1 ")
            for col in df.columns:
                obsnme = "{0}_{1}_{2}".format(prefix,col[:name_len],dt)
                f.write(" w !{0}!".format(obsnme))
            f.write("\n")