def constructEmptyMDS(self):        
        
        field_data_CSV = csv.reader(open(self.fieldData, "r"))
        orig_header = field_data_CSV.next()
        full_header = ["x", "y"]
        if orig_header[2].lower not in ["responsebinary", "responsecount"]:
            #inputs not conforming to our expected format will be assumed
            #to be binary data
            full_header.append("responseBinary")
        else:
            full_header.append(orig_header[2])
        
        inputs_CSV = csv.reader(open(self.inputsCSV, "r"))
        inputs_header = inputs_CSV.next()
        self.inputs = []

        #each row contains a covariate raster layer
        #item 0 is the full path to the file
        #item 1 is 0/1 indicating categorical
        #Construct our output header by extracting each individual 
        #file (raster) name and appending '_categorical' if the flag is 1
        rasters = {}
        for row in inputs_CSV:
            temp_raster = row[0]
#            self.inputs.append(temp_raster)
            raster_shortname = os.path.split(temp_raster)[1]
            raster_shortname = os.path.splitext(raster_shortname)[0]
            if len(row) > 1 and row[1] == '1':
                raster_shortname += "_categorical"
            rasters[raster_shortname] = temp_raster
            
        keys = rasters.keys()
        keys.sort(key=lambda s: s.lower())
        keys.sort(key=lambda s: s.lower())
        for key in keys:
            self.inputs.append(rasters[key])
            full_header.append(key)

        #Open up and write to an output file
        oFile = open(self.outputMDS, 'wb')
        fOut = csv.writer(oFile, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
        
        #Format and write out our three header lines
        #    the original template, fieldData, and parc folder are 
        #    stored in spots 1,2,3 in the second header line
        if len(orig_header) > 7 and os.path.exists(orig_header[7]):
            #The input is an output from Field data query
            original_field_data = orig_header[7]
            field_data_template = orig_header[8]
        else:
            #The input is a raw field data file
            original_field_data = self.fieldData
            field_data_template = "NA"
        
        if len(inputs_header) > 5:
            parc_template = inputs_header[5]
            parc_workspace = inputs_header[6]
        else:
            parc_template = "Unknown"
            parc_workspace = "Unknown"
        
        secondRow = [original_field_data, field_data_template, ""] + ["1" for elem in self.inputs]
        thirdRow = [parc_template, parc_workspace, ""] + self.inputs
        fOut.writerow(full_header)
        fOut.writerow(secondRow)
        fOut.writerow(thirdRow)
        oFile.close()
        del fOut
Creates the triple header line format of our output file.
dataset/ETHPy150Open VisTrails/VisTrails/contrib/sahm/pySAHM/MDSBuilder.py/MDSBuilder.constructEmptyMDS