def iodp_dscr_lore(dscr_file,dscr_ex_file="", dir_path=".", input_dir_path="",volume=7,noave=False,\
              meas_file="measurements.txt", offline_meas_file="",spec_file="specimens.txt"):
    """
    Convert IODP discrete measurement files in MagIC file(s). This program
    assumes that you have created the specimens, samples, sites and location
    files using convert_2_magic.iodp_samples_csv from files downloaded from the LIMS online
    repository and that all samples are in that file.

    If there are offline treatments, you will also need the extended version of the SRM discrete
    download file from LORE.

    Parameters
    ----------
    dscr_file : str
        input csv file downloaded from LIMS online repository
    dscr_ex_file : str
        input extended csv file downloaded from LIMS online repository
    dir_path : str
        output directory, default "."
    input_dir_path : str
        input file directory IF different from dir_path, default ""
    meas_file : str
        output measurement file name, default "measurements.txt"
    offline_meas_file : str
        output measurement file for offline measurements , default "". must be specified if dscr_ex_file supplied
    spec_file : str
        specimens file name created by, for example, convert_2_magic.iodp_samples_csv, default "specimens.txt"
        file should already be in dir_path
    volume : float
        volume in cm^3 assumed during measurement on SRM.  The so-called "Japanese" cubes have a volume of 7cc
    noave : Boolean
         if False, average replicate measurements

    Returns
    --------
    type - Tuple : (True or False indicating if conversion was sucessful, meas_file name written)
    """
    # initialize defaults
    version_num = pmag.get_version()
    # format variables
    input_dir_path, output_dir_path = pmag.fix_directories(input_dir_path, dir_path)
    # convert cc to m^3
    volume = volume * 1e-6
    meas_reqd_columns=['specimen','measurement','experiment','sequence','quality','method_codes',\
                       'instrument_codes','citations',\
                       'treat_temp','treat_ac_field','treat_dc_field',\
                      'treat_dc_field_phi','treat_dc_field_theta','meas_temp',\
                      'dir_dec','dir_inc','magn_moment','magn_volume',\
                       'description','timestamp','software_packages',\
                       'external_database_ids','treat_step_num','meas_n_orient']
    dscr_file = pmag.resolve_file_name(dscr_file, input_dir_path)
    if dscr_ex_file:dscr_ex_file = pmag.resolve_file_name(dscr_ex_file, input_dir_path)
    spec_file = pmag.resolve_file_name(spec_file, dir_path)
    specimens_df=pd.read_csv(spec_file,sep='\t',header=1)
    if len(specimens_df)==0:
        print ('you must download and process the samples table from LORE prior to using this')
        print ('see convert_2_magic.iodp_samples_csv for help')
        return False
    LORE_specimens=list(specimens_df.specimen.unique())
    in_df=pd.read_csv(dscr_file)
    in_df['offline_treatment']=""
    if dscr_ex_file:
        ex_df=pd.read_csv(dscr_ex_file)
        ex_df['Test No.']=ex_df['test test_number']
        ex_df['offline_treatment']=ex_df['comments']
        ex_df=ex_df[['Test No.','offline_treatment']]
        in_df=in_df.merge(ex_df,on='Test No.')
        in_df['offline_treatment']=in_df['offline_treatment_y']
        in_df['offline_treatment'].fillna("",inplace=True)
    in_df.drop_duplicates(inplace=True)
    if len(in_df)==0:
        print ('you must download a csv file from the LIMS database and place it in your input_dir_path')
        return False
    in_df.sort_values(by='Test No.',inplace=True)
    in_df.reset_index(inplace=True)
    measurements_df=pd.DataFrame(columns=meas_reqd_columns)
    meas_out = os.path.join(output_dir_path, meas_file)
    if offline_meas_file:
        offline_meas_out = os.path.join(output_dir_path, offline_meas_file)
    if dscr_ex_file and not offline_meas_file:
        print ("You must specify an output file for the offline measurements with dscr_ex_file")
        return
    hole,srm_specimens=iodp_sample_names(in_df)
    for spec in list(srm_specimens.unique()):
        if spec not in LORE_specimens:
            print (' -W- ',spec, ' not found in specimens table ')
            print ( 'check your sample name or add to specimens table by hand\n')
    # set up defaults
    measurements_df['specimen']=srm_specimens
    measurements_df['offline_treatment']=in_df['offline_treatment']
    measurements_df['sequence']=in_df['Test No.']
    measurements_df['offline_list']=""
    measurements_df['quality']='g'
    measurements_df['citations']='This study'
    measurements_df['meas_temp']=273
    measurements_df['software_packages']=version_num
    measurements_df["treat_temp"] = '%8.3e' % (273)  # room temp in kelvin
    measurements_df["meas_temp"] = '%8.3e' % (273)  # room temp in kelvin
    measurements_df['meas_n_orient']=1 # at least one orientation
    measurements_df["treat_ac_field"] = '0'
    measurements_df["treat_dc_field"] = '0'
    measurements_df["treat_dc_field_phi"] = '0'
    measurements_df["treat_dc_field_theta"] = '0'
    measurements_df["treat_step_num"] = '1'
    measurements_df["standard"] = 'u'  # assume all data are "good"
    measurements_df["dir_csd"] = '0'  # assume all data are "good"
    measurements_df["method_codes"] = 'LT-NO' # assume all are NRMs
    measurements_df['instrument_codes']="IODP-SRM" # assume all measurements on shipboard 2G
    measurements_df['timestamp']=pd.to_datetime(\
                               in_df['Timestamp (UTC)']).dt.strftime("%Y-%m-%dT%H:%M:%S")+'Z'
    measurements_df['dir_dec']=in_df['Declination background & drift corrected (deg)'] # declination
    measurements_df['dir_inc']=in_df['Inclination background & drift corrected (deg)'] # inclination
    measurements_df['magn_volume']=in_df['Intensity background & drift corrected (A/m)'] # magnetization
    measurements_df['magn_moment']=measurements_df['magn_volume']*volume # moment in Am^2
    measurements_df['description']=in_df['Treatment Type'] # temporary column
    measurements_df['treat_ac_field']=in_df['Treatment Value']*1e-3 # assume all treatments are AF
    measurements_df.loc[measurements_df['description']=='IN-LINE AF DEMAG',\
                        'method_codes']='LT-AF-Z'
    measurements_df.loc[measurements_df['description']=='IN-LINE AF DEMAG',\
                        'instrument_codes']='IODP-SRM:IODP-SRM-AF'
    measurements_df['external_database_ids']='LORE['+in_df['Test No.'].astype('str')+']'
    measurements_df.fillna("",inplace=True)
    measurements_df.sort_values(by='sequence',inplace=True)
    if dscr_ex_file:
        meas_df=measurements_df[measurements_df.offline_treatment==""] # all the records with no offline treatments
        offline_df=pd.DataFrame(columns=meas_df.columns) # make a container for offline measurements
        arm_df=measurements_df[measurements_df['offline_treatment'].str.contains('ARM')]
        if len(arm_df)>0: # there are ARM treatment steps
           arm_df['offline_list']=arm_df['offline_treatment'].str.split(":")
           arm_list=arm_df.specimen.unique()
           for spc in arm_list: # get all the ARM treated specimens
               spc_df=arm_df[arm_df.specimen.str.match(spc)] # get all the measurements for this specimen
               seq_no=spc_df[spc_df.specimen.str.match(spc)].sequence.values[0] # get the sequence number of the ARM step
               end_seq_no=spc_df[spc_df.specimen.str.match(spc)].sequence.values[-1] # get the sequence number of the last ARM demag step
               arm_df.loc[arm_df.sequence==seq_no,'method_codes']='LT-AF-I:LP-ARM-AFD' # label the ARM record
               arm_df.loc[arm_df.sequence==seq_no,'experiment']=spc+'_LT-AF-I_LT-AF-Z_LP-ARM-AFD' # label the ARM record
               arm_df.loc[arm_df.sequence==seq_no,'treat_ac_field']=arm_df['offline_list'].str.get(1).astype('float')*1e-3 # AF peak field in mT converted to tesla
               arm_df.loc[arm_df.sequence==seq_no,'treat_dc_field']=arm_df['offline_list'].str.get(2).astype('float')*1e-3 # AF peak field in mT converted to tesla
               arm_df.loc[arm_df.sequence==seq_no,'instrument_codes']='IODP-SRM:IODP-DTECH'
               arm_df.loc[(arm_df.specimen.str.match(spc)) &
                          (arm_df.sequence>seq_no) &
                          (arm_df.sequence<=end_seq_no),'method_codes']= 'LT-AF-Z:LP-ARM-AFD'
               arm_df.loc[(arm_df.specimen.str.match(spc)) &
                          (arm_df.sequence>seq_no) &
                          (arm_df.sequence<=end_seq_no),'experiment']= spc+'LT-AF-I_LT-AF-Z_LP-ARM-AFD'
               arm_df.loc[(arm_df.specimen.str.match(spc)) &
                          (arm_df.sequence>seq_no) &
                          (arm_df.sequence<=end_seq_no),'instrument_codes']= 'IODP-SRM:IODP-SRM-AF'
           strings=[]
           for i in range(len(arm_df)):strings.append(str(i))
           arm_df['measurement']=arm_df['experiment']+strings
           arm_df['description']=arm_df['offline_treatment']
           offline_df=pd.concat([offline_df,arm_df])  # put the arm data into the offline dataframe
        irm_in_df=measurements_df[measurements_df['offline_treatment'].str.contains('IRM')]
        if len(irm_in_df)>0: # there are IRM treatment steps
           irm_in_df['offline_list']=irm_in_df['offline_treatment'].str.split(":")
           irm_list=irm_in_df.specimen.unique()
           irm_out_df=pd.DataFrame(columns=irm_in_df.columns) # make an output container
           for spc in irm_list: # get all the IRM treated specimens
               # first do IRM acquisition steps
               spc_df=irm_in_df[irm_in_df.specimen.str.match(spc)] # get all the measurements for this specimen
               spc_acq_df=spc_df[spc_df.treat_ac_field==0] # IRM acquisition step
               spc_acq_df['method_codes']='LT-IRM:LP-IRM' # label the IRM records
               spc_acq_df['experiment']=spc+'_LT-IRM_LP-IRM' # label the IRM experiment
               spc_acq_df['treat_dc_field']=spc_acq_df['offline_list'].str.get(1).astype('float')*1e-3 # IRM field in mT converted to tesla
               spc_acq_df['instrument_codes']='IODP-SRM:IODP-IM-10'
               # do the AF demag of the IRM
               sirm_seq_no=spc_acq_df[spc_acq_df.specimen.str.match(spc)].sequence.values[-1] # get the sequence number of the last IRM step
               spc_afd_df=spc_df[(spc_df.treat_ac_field!=0)] #
               spc_afd_df['method_codes']= 'LP-IRM:LP-IRM-AFD'
               spc_afd_df['experiment']= spc+'LP-IRM:LP-IRM-AFD'
               spc_afd_df['instrument_codes']= 'IODP-SRM:IODP-SRM-AFD'
               irm_out_df=pd.concat([irm_out_df,spc_acq_df,spc_afd_df])
           strings=[]
           for i in range(len(irm_out_df)):strings.append(str(i))
           irm_out_df['measurement']=irm_out_df['experiment']+strings
           irm_out_df['description']=irm_out_df['offline_treatment']
           offline_df=pd.concat([offline_df,irm_out_df])  # put the irm data into the offline dataframe
    if dscr_ex_file:
        offline_df.drop(columns=['offline_list'],inplace=True)
        offline_df.drop(columns=['offline_treatment'],inplace=True)
        offline_df.sort_values(by='sequence',inplace=True)
        offline_df.drop_duplicates(subset=['sequence'],inplace=True)
        offline_df.fillna("",inplace=True)
        offline_dicts = offline_df.to_dict('records')
        pmag.magic_write(offline_meas_out, offline_dicts, 'measurements')
        measurements_df=meas_df # put all the non-offline treatments back into measurements_df
    if 'offline_treatment' in measurements_df.columns:
        measurements_df.drop(columns=['offline_treatment'],inplace=True)
    if 'offline_list' in measurements_df.columns:
        measurements_df.drop(columns=['offline_list'],inplace=True)
    measurements_df.sort_values(by='sequence',inplace=True)
    measurements_df.drop_duplicates(subset=['sequence'],inplace=True)
    measurements_df['treat_step_num']=measurements_df['sequence']
    measurements_df.fillna("",inplace=True)
    meas_dicts = measurements_df.to_dict('records')
    meas_dicts=pmag.measurements_methods3(meas_dicts,noave=noave)
    pmag.magic_write(meas_out, meas_dicts, 'measurements')

    return True