Index: src/sans/dataloader/data_info.py
===================================================================
--- src/sans/dataloader/data_info.py	(revision be577e73697f1bbd3f93250dd594d00eff510718)
+++ src/sans/dataloader/data_info.py	(revision 76cd1aeb8047424a5dc9e1d0e5c3eaa0f17c3bb4)
@@ -425,12 +425,13 @@
     def __str__(self):
         _str  = "Transmission Spectrum:\n"
-        _str += "   Name:       {0}".format(self.name)
-        _str += "   Timestamp:  {1}".format(self.timestamp)
-        _str += "   Wavelength [{0}] | Transmission [{1}] | Trans Dev [{2}]\n".format(self.wavelength_unit, self.transmission_unit, self.transmission_deviation_unit)
-        for i in range(len(self.wavelength)):
-            _str += "   {0}, {1}".format(self.wavelength[i], self.transmission[i])
-            if len(self.transmission_deviation > i):
-                _str += ", {0}".format(self.transmission_deviation[i])
-            _str += "\n"
+        _str += "   Name:             \t{0}\n".format(self.name)
+        _str += "   Timestamp:        \t{0}\n".format(self.timestamp)
+        _str += "   Wavelength unit:  \t{0}\n".format(self.wavelength_unit)
+        _str += "   Transmission unit:\t{0}\n".format(self.transmission_unit)
+        _str += "   Trans. Dev. unit:  \t{0}\n".format(\
+                                            self.transmission_deviation_unit)
+        length_list = [len(self.wavelength), len(self.transmission), \
+                len(self.transmission_deviation)]
+        _str += "   Number of Pts:    \t{0}\n".format(max(length_list))
         return _str
     
@@ -498,5 +499,5 @@
         self.collimation = []
         ## Transmission Spectrum
-        self.trans_spectrum = TransmissionSpectrum()
+        self.trans_spectrum = []
         ## Additional meta-data
         self.meta_data  = {}
@@ -533,5 +534,6 @@
         for item in self.notes:
             _str += "%s\n" % str(item)
-
+        for item in self.trans_spectrum:
+            _str += "%s\n" % str(item)
         return _str
             
@@ -757,16 +759,17 @@
             clone = Data1D(x, y, dx=dx, dy=dy)
         
-        clone.title       = self.title
-        clone.run         = self.run
-        clone.filename    = self.filename
-        clone.instrument  = self.instrument
-        clone.notes       = deepcopy(self.notes)
-        clone.process     = deepcopy(self.process)
-        clone.detector    = deepcopy(self.detector)
-        clone.sample      = deepcopy(self.sample)
-        clone.source      = deepcopy(self.source)
-        clone.collimation = deepcopy(self.collimation)
-        clone.meta_data   = deepcopy(self.meta_data)
-        clone.errors      = deepcopy(self.errors)
+        clone.title          = self.title
+        clone.run            = self.run
+        clone.filename       = self.filename
+        clone.instrument     = self.instrument
+        clone.notes          = deepcopy(self.notes)
+        clone.process        = deepcopy(self.process)
+        clone.detector       = deepcopy(self.detector)
+        clone.sample         = deepcopy(self.sample)
+        clone.source         = deepcopy(self.source)
+        clone.collimation    = deepcopy(self.collimation)
+        clone.trans_spectrum = deepcopy(self.trans_spectrum)
+        clone.meta_data      = deepcopy(self.meta_data)
+        clone.errors         = deepcopy(self.errors)
         
         return clone
Index: src/sans/dataloader/readers/cansas_constants.py
===================================================================
--- src/sans/dataloader/readers/cansas_constants.py	(revision 75eeb4259b6c50a745eb6eec9691323e3c4f077f)
+++ src/sans/dataloader/readers/cansas_constants.py	(revision 76cd1aeb8047424a5dc9e1d0e5c3eaa0f17c3bb4)
@@ -1,5 +1,17 @@
-## Left off at SASInstrument, line 178
-
+"""
+Information relating to the CanSAS data format. These constants are used in
+the cansas_reader.py file to read in any version of the cansas format.
+"""
 class cansasConstants:
+    
+    ns = ''
+    format = ''
+    
+    def __init__(self):
+        self.ns = self.CANSAS_NS
+        self.format = self.CANSAS_FORMAT
+    """
+    CANSAS_NS holds the base namespace and the default schema file information
+    """
     CANSAS_NS = {
                  "1.0" : {
@@ -12,4 +24,656 @@
                           }
                  }
+    
+    """
+    The constants below hold information on where to store the CanSAS data when
+    loaded in using sasview
+    """
+    META_DATA = "{0}.meta_data[\"{2}\"] = \"{1}\""
+    ANY = {
+           "variable" : "{0}.meta_data[\"{2}\"] = \'{1}\'",
+           "storeas" : "content",
+           }
+    TITLE = {"variable" : "{0}.title = \"{1}\""}
+    SASNOTE = {"variable" : "{0}.notes.append(\'{1}\')"}
+    SASPROCESS_TERM = {
+                       "variable" : None,
+                       "attributes" : {
+                                       "unit" : {"variable" : None},
+                                       "name" : {"variable" : None}
+                                       }
+                       }
+    SASPROCESS_SASPROCESSNOTE = {
+                                 "variable" : None,
+                                 "children" : {"<any>" : ANY}
+                                 }
+    SASPROCESS = {
+                  "variable" : None,
+                  "children" : {
+                                "name" : {"variable" : "{0}.name = \'{1}\'"},
+                               "date" : {"variable" : "{0}.date = \'{1}\'"},
+                               "description" : {"variable" : \
+                                                "{0}.description = \'{1}\'"},
+                               "term" : SASPROCESS_TERM,
+                               "SASprocessnote" : SASPROCESS_SASPROCESSNOTE,
+                               "<any>" : ANY
+                               },
+                 }
+    RUN = {
+           "variable" : "{0}.run.append(\"{1}\")",
+           "attributes" : {"name" : {"variable" : \
+                                     "{0}.run_name[node_value] = \"{1}\""}}
+           }
+    SASDATA_IDATA_Q = {
+                       "variable" : "{0}.x = numpy.append({0}.x, {1})",
+                       "unit" : "x_unit",
+                       "attributes" : {
+                                       "unit" : {
+                                                 "variable" : \
+                                                    "{0}._xunit = \"{1}\"",
+                                                    "storeas" : "content"
+                                                    }
+                                       }
+                       }
+    SASDATA_IDATA_I = {
+                       "variable" : "{0}.y = numpy.append({0}.y, {1})",
+                       "unit" : "y_unit",
+                       "attributes" : {
+                                       "unit" : {
+                                                 "variable" : \
+                                                    "{0}._yunit = \"{1}\"",
+                                                    "storeas" : "content"
+                                                }
+                                       }
+                       }
+    SASDATA_IDATA_IDEV = {
+                          "variable" : \
+                          "{0}.dy = numpy.append({0}.dy, {1})",
+                          "unit" : "y_unit",
+                          "attributes" : {
+                                          "unit" : {
+                                                    "variable" : META_DATA,
+                                                    "storeas" : "content"
+                                                    }
+                                          },
+                          }
+    SASDATA_IDATA_QDEV = {
+                          "variable" : \
+                          "{0}.dx = numpy.append({0}.dx, {1})",
+                          "unit" : "x_unit",
+                          "attributes" : {
+                                          "unit" : {
+                                                    "variable" : META_DATA,
+                                                    "storeas" : "content"
+                                                    }
+                                          },
+                          }
+    SASDATA_IDATA_DQL = {
+                         "variable" : \
+                         "{0}.dxl = numpy.append({0}.dxl, {1})",
+                         "unit" : "x_unit",
+                         "attributes" : {
+                                         "unit" : {
+                                                   "variable" : META_DATA,
+                                                "storeas" : "content"
+                                                }
+                                         },
+                         }
+    SASDATA_IDATA_DQW = {
+                         "variable" : \
+                         "{0}.dxw = numpy.append({0}.dxw, {1})",
+                         "unit" : "x_unit",
+                         "attributes" : {
+                                         "unit" : {
+                                                   "variable" : META_DATA,
+                                                   "storeas" : "content"
+                                                   }
+                                         },
+                         }
+    SASDATA_IDATA_QMEAN = {
+                           "storeas" : "content",
+                           "unit" : "x_unit",
+                           "variable" : META_DATA,
+                           "attributes" : {"unit" : {"variable" : META_DATA}},
+                           }
+    SASDATA_IDATA_SHADOWFACTOR = {
+                                  "variable" : META_DATA,
+                                  "storeas" : "content",
+                                  }
+    SASDATA_IDATA = {
+                     "storeas" : "float",
+                     "units_optional" : False,
+                     "variable" : None,
+                     "attributes" : {
+                                     "name" : {
+                                               "variable" : META_DATA,
+                                               "storeas" : "content",
+                                               },
+                                     "timestamp" : {
+                                                    "variable" : META_DATA,
+                                                    "storeas" : "content",
+                                                    }
+                                     },
+                     "children" : {
+                                   "Q" : SASDATA_IDATA_Q,
+                                   "I" : SASDATA_IDATA_I,
+                                   "Idev" : SASDATA_IDATA_IDEV,
+                                   "Qdev" : SASDATA_IDATA_QDEV,
+                                   "dQw" : SASDATA_IDATA_DQW,
+                                   "dQl" : SASDATA_IDATA_DQL,
+                                   "Qmean" : SASDATA_IDATA_QMEAN,
+                                   "Shadowfactor" : SASDATA_IDATA_SHADOWFACTOR,
+                                   "<any>" : ANY
+                                   }
+                   }
+    SASDATA = {
+               "attributes" : {"name" : {"variable" : META_DATA,}},
+               "variable" : None,
+               "children" : {
+                             "Idata" : SASDATA_IDATA,
+                             "<any>" : ANY
+                             }
+               }
+    SASTRANSSPEC_TDATA_LAMDBA = {
+                                 "variable" : "{0}.wavelength.append({1})",
+                                 "unit" : "wavelength_unit",
+                                 "attributes" : {
+                                                 "unit" : {
+                                                            "variable" : "{0}.wavelength_unit = \"{1}\"",
+                                                            "storeas" : "content"
+                                                            }
+                                                 }
+                                 }
+    SASTRANSSPEC_TDATA_T = {
+                            "variable" : "{0}.transmission.append({1})",
+                            "unit" : "transmission_unit",
+                            "attributes" : {
+                                            "unit" : {
+                                                      "variable" : "{0}.transmission_unit = \"{1}\"",
+                                                      "storeas" : "content"
+                                                      }
+                                            }
+                            }
+    SASTRANSSPEC_TDATA_TDEV = {
+                               "variable" : \
+                                    "{0}.transmission_deviation.append({1})",
+                               "unit" : "transmission_deviation_unit",
+                                "attributes" : {
+                                                "unit" : {
+                                                          "variable" : "{0}.transmission_deviation_unit = \"{1}\"",
+                                                          "storeas" : "content"
+                                                          }
+                                                }
+                               }
+    SASTRANSSPEC_TDATA = {
+                          "storeas" : "float",
+                          "variable" : None,
+                          "children" : {
+                                        "Lambda" : SASTRANSSPEC_TDATA_LAMDBA,
+                                        "T" : SASTRANSSPEC_TDATA_T,
+                                        "Tdev" : SASTRANSSPEC_TDATA_TDEV,
+                                        "<any>" : ANY,
+                                        }
+                          }
+    SASTRANSSPEC = {
+                    "variable" : None,
+                    "children" : {
+                                  "Tdata" : SASTRANSSPEC_TDATA,
+                                  "<any>" : ANY,
+                                  },
+                    "attributes" : {"name" : {"variable" : \
+                                              "{0}.name = \"{1}\""},
+                                    "timestamp" : {"variable" : \
+                                                   "{0}.timestamp = \"{1}\""},
+                                    }
+                    }
+    SASSAMPLE_THICK = {
+                       "variable" : "{0}.sample.thickness = {1}",
+                       "unit" : "sample.thickness_unit",
+                       "storeas" : "float",
+                       "attributes" : {
+                                       "units" : {
+                                                  "variable" : "{0}.sample.thickness_unit = \"{1}\"",
+                                                  "storeas" : "content"
+                                                  }
+                                       },
+                       }
+    SASSAMPLE_TRANS = {
+                       "variable" : "{0}.sample.transmission = {1}",
+                       "storeas" : "float",
+                       }
+    SASSAMPLE_TEMP = {
+                      "variable" : "{0}.sample.temperature = {1}",
+                      "unit" : "sample.temperature_unit",
+                      "storeas" : "float",
+                      "attributes" : {
+                                      "units" : {
+                                                 "variable" : "{0}.sample.temperature_unit = \"{1}\"",
+                                                 "storeas" : "content"
+                                                 }
+                                      },
+                      }
+    SASSAMPLE_POS_ATTR = {
+                          "units" : {
+                                     "variable" : \
+                                        "{0}.sample.position_unit = \"{1}\"",
+                                     "storeas" : "content"
+                                     }
+                          }
+    SASSAMPLE_POS_X = {
+                       "variable" : "{0}.sample.position.x = {1}",
+                       "unit" : "sample.position_unit",
+                       "storeas" : "float",
+                       "attributes" : SASSAMPLE_POS_ATTR
+                       }
+    SASSAMPLE_POS_Y = {
+                       "variable" : "{0}.sample.position.y = {1}",
+                       "unit" : "sample.position_unit",
+                       "storeas" : "float",
+                       "attributes" : SASSAMPLE_POS_ATTR
+                       }
+    SASSAMPLE_POS_Z = {
+                       "variable" : "{0}.sample.position.z = {1}",
+                       "unit" : "sample.position_unit",
+                       "storeas" : "float",
+                       "attributes" : SASSAMPLE_POS_ATTR
+                       }
+    SASSAMPLE_POS = {
+                     "children" : {
+                                   "variable" : None,
+                                   "x" : SASSAMPLE_POS_X,
+                                   "y" : SASSAMPLE_POS_Y,
+                                   "z" : SASSAMPLE_POS_Z,
+                                   },
+                     }
+    SASSAMPLE_ORIENT_ATTR = {
+                             "units" : {
+                                        "variable" : "{0}.sample.orientation_unit = \"{1}\"",
+                                        "storeas" : "content"
+                                        }
+                             }
+    SASSAMPLE_ORIENT_ROLL = {
+                             "variable" : "{0}.sample.orientation.x = {1}",
+                             "unit" : "sample.orientation_unit",
+                             "storeas" : "float",
+                             "attributes" : SASSAMPLE_ORIENT_ATTR
+                             }
+    SASSAMPLE_ORIENT_PITCH = {
+                             "variable" : "{0}.sample.orientation.y = {1}",
+                             "unit" : "sample.orientation_unit",
+                             "storeas" : "float",
+                             "attributes" : SASSAMPLE_ORIENT_ATTR
+                             }
+    SASSAMPLE_ORIENT_YAW = {
+                             "variable" : "{0}.sample.orientation.z = {1}",
+                             "unit" : "sample.orientation_unit",
+                             "storeas" : "float",
+                             "attributes" : SASSAMPLE_ORIENT_ATTR
+                             }
+    SASSAMPLE_ORIENT = {
+                        "variable" : None,
+                        "children" : {
+                                      "roll" : SASSAMPLE_ORIENT_ROLL,
+                                      "pitch" : SASSAMPLE_ORIENT_PITCH,
+                                      "yaw" : SASSAMPLE_ORIENT_YAW,
+                                      },
+                        }
+    SASSAMPLE = {
+                 "attributes" : {"name" : {\
+                                    "variable" : "{0}.sample.name = \"{1}\""},},
+                 "variable" : None,
+                 "children" : {
+                               "ID" : {"variable" : "{0}.sample.ID = \"{1}\""},
+                               "thickness" : SASSAMPLE_THICK,
+                               "transmission" : SASSAMPLE_TRANS, 
+                               "temperature" : SASSAMPLE_TEMP, 
+                               "position" : SASSAMPLE_POS,
+                               "orientation" : SASSAMPLE_ORIENT,
+                               "details" : {"variable" : \
+                                        "{0}.sample.details.append(\"{1}\")"},
+                               "<any>" : ANY
+                               },
+                 }
+    SASINSTR_SRC_BEAMSIZE_ATTR = {
+                                  "unit" : \
+                                    "{0}.source.beam_size_unit = \"{1}\"",
+                                  "storeas" : "content"
+                                  }
+    SASINSTR_SRC_BEAMSIZE_X = {
+                               "variable" : "{0}.source.beam_size.x = {1}",
+                               "unit" : "source.beam_size_unit",
+                               "storeas" : "float",
+                               "attributes" : SASINSTR_SRC_BEAMSIZE_ATTR
+                               }
+    SASINSTR_SRC_BEAMSIZE_Y = {
+                               "variable" : "{0}.source.beam_size.y = {1}",
+                               "unit" : "source.beam_size_unit",
+                               "storeas" : "float",
+                               "attributes" : SASINSTR_SRC_BEAMSIZE_ATTR
+                               }
+    SASINSTR_SRC_BEAMSIZE_Z = {
+                               "variable" : "{0}.source.beam_size.z = {1}",
+                               "unit" : "source.beam_size_unit",
+                               "storeas" : "float",
+                               "attributes" : SASINSTR_SRC_BEAMSIZE_ATTR
+                               }
+    SASINSTR_SRC_BEAMSIZE = {
+                             "attributes" : {"name" : {"variable" : \
+                                        "{0}.source.beam_size_name = \"{1}\""}},
+                             "variable" : None,
+                             "children" : {
+                                           "x" : SASINSTR_SRC_BEAMSIZE_X,
+                                           "y" : SASINSTR_SRC_BEAMSIZE_Y,
+                                           "z" : SASINSTR_SRC_BEAMSIZE_Z,
+                                           }
+                             }
+    SASINSTR_SRC_WL = {
+                       "variable" : "{0}.source.wavelength = {1}",
+                       "unit" : "source.wavelength_unit",
+                       "storeas" : "float",
+                       "attributes" : {
+                                       "unit" : {
+                                                 "variable" : "{0}.source.wavelength_unit = \"{1}\"",
+                                                 "storeas" : "content"
+                                                 },
+                                       }
+                       }
+    SASINSTR_SRC_WL_MIN = {
+                           "variable" : "{0}.source.wavelength_min = {1}",
+                           "unit" : "source.wavelength_min_unit",
+                           "storeas" : "float",
+                           "attributes" : {
+                                           "unit" : {
+                                                     "variable" : "{0}.source.wavelength_min_unit = \"{1}\"",  
+                                                     "storeas" : "content"
+                                                     },
+                                           }
+                           }
+    SASINSTR_SRC_WL_MAX = {
+                           "variable" : "{0}.source.wavelength_max = {1}",
+                           "unit" : "source.wavelength_max_unit",
+                           "storeas" : "float",
+                           "attributes" : {
+                                           "unit" : {
+                                                     "variable" : "{0}.source.wavelength_max_unit = \"{1}\"",  
+                                                     "storeas" : "content"
+                                                     },
+                                           }
+                           }
+    SASINSTR_SRC_WL_SPR = {
+                           "variable" : "{0}.source.wavelength_spread = {1}",
+                           "unit" : "source.wavelength_spread_unit",
+                           "storeas" : "float",
+                           "attributes" : {
+                                           "unit" : {
+                                                     "variable" : "{0}.source.wavelength_spread_unit = \"{1}\"",  
+                                                     "storeas" : "content"
+                                                     },
+                                           }
+                           }
+    SASINSTR_SRC = {
+                    "attributes" : {"name" : {"variable" : "{0}.source.name = \"{1}\""}},
+                    "variable" : None,
+                    "children" : {
+                                  "radiation" : {"variable" : "{0}.source.radiation = \"{1}\""},
+                                  "beam_size" : SASINSTR_SRC_BEAMSIZE,
+                                  "beam_shape" : {"variable" : \
+                                            "{0}.source.beam_shape = \"{1}\""},
+                                  "wavelength" : SASINSTR_SRC_WL,
+                                  "wavelength_min" : SASINSTR_SRC_WL_MIN,
+                                  "wavelength_max" : SASINSTR_SRC_WL_MAX,
+                                  "wavelength_spread" : SASINSTR_SRC_WL_SPR,
+                                  },
+                    }
+    SASINSTR_COLL_APER_ATTR = {
+                               "unit" : {
+                                         "variable" : "{0}.size_unit = \"{1}\"",
+                                         "storeas" : "content"
+                                         },                                    
+                               }
+    SASINSTR_COLL_APER_X = {
+                            "variable" : "{0}.size.x = {1}",
+                            "unit" : "size_unit",
+                            "storeas" : "float",
+                            "attributes" : SASINSTR_COLL_APER_ATTR
+                            }
+    SASINSTR_COLL_APER_Y = {
+                            "variable" : "{0}.size.y = {1}",
+                            "unit" : "size_unit",
+                            "storeas" : "float",
+                            "attributes" : SASINSTR_COLL_APER_ATTR
+                            }
+    SASINSTR_COLL_APER_Z = {
+                            "variable" : "{0}.size.z = {1}",
+                            "unit" : "size_unit",
+                            "storeas" : "float",
+                            "attributes" : SASINSTR_COLL_APER_ATTR
+                            }
+    SASINSTR_COLL_APER_SIZE = {
+                               "attributes" : {"unit" : {"variable" : \
+                                                    "{0}.size_unit = \"{1}\""}},
+                               "children" : {
+                                             "storeas" : "float",
+                                            "x" : SASINSTR_COLL_APER_X,
+                                            "y" : SASINSTR_COLL_APER_Y,
+                                            "z" : SASINSTR_COLL_APER_Z,
+                                            }
+                               }
+    SASINSTR_COLL_APER_DIST = {
+                               "storeas" : "float",
+                               "attributes" : {
+                                               "storeas" : "content",
+                                               "unit" : {"variable" : \
+                                                "{0}.distance_unit = \"{1}\""}},
+                               "variable" : "{0}.distance = {1}",
+                               "unit" : "distance_unit",
+                               }
+    SASINSTR_COLL_APER = {
+                          "variable" : None,
+                          "attributes" : {
+                                          "name" : {"variable" : \
+                                                    "{0}.name = \"{1}\""},
+                                          "type" : {"variable" : \
+                                                    "{0}.type = \"{1}\""},
+                                          },
+                          "children" : {
+                                        "size" : SASINSTR_COLL_APER_SIZE,
+                                        "distance" : SASINSTR_COLL_APER_DIST
+                                        }
+                          }
+    SASINSTR_COLL = {
+                     "attributes" : {"name" : {"variable" : \
+                                               "{0}.name = \"{1}\""}},
+                     "variable" : None,
+                     "children" : {
+                                   "length" : {
+                                            "variable" : "{0}.length = {1}",
+                                            "unit" : "length_unit",
+                                            "storeas" : "float",
+                                            "attributes" : {
+                                                            "storeas" : \
+                                                                "content",
+                                                            "unit" : {"variable" : "{0}.length_unit = \"{1}\""}
+                                                            },
+                                            },
+                                   "aperture" : SASINSTR_COLL_APER,
+                                   },
+                     }
+    SASINSTR_DET_SDD = {
+                        "variable" : "{0}.distance = {1}",
+                        "unit" : "distance_unit",
+                        "attributes" : {
+                                        "unit" : {
+                                                  "variable" : \
+                                                  "{0}.distance_unit = \"{1}\"",
+                                                  "storeas" : "content"
+                                                  }
+                                        },
+                        }
+    SASINSTR_DET_OFF_ATTR = {
+                            "unit" : {
+                                      "variable" : "{0}.offset_unit = \"{1}\"",
+                                      "storeas" : "content"
+                                      },
+                            }
+    SASINSTR_DET_OFF_X = {
+                         "variable" : "{0}.offset.x = {1}",
+                         "unit" : "offset_unit",
+                         "attributes" : SASINSTR_DET_OFF_ATTR
+                         }
+    SASINSTR_DET_OFF_Y = {
+                         "variable" : "{0}.offset.y = {1}",
+                         "unit" : "offset_unit",
+                         "attributes" : SASINSTR_DET_OFF_ATTR
+                         }
+    SASINSTR_DET_OFF_Z = {
+                         "variable" : "{0}.offset.z = {1}",
+                         "unit" : "offset_unit",
+                         "attributes" : SASINSTR_DET_OFF_ATTR
+                         }
+    SASINSTR_DET_OFF = {
+                        "variable" : None,
+                        "children" : {
+                                      "x" : SASINSTR_DET_OFF_X,
+                                      "y" : SASINSTR_DET_OFF_Y,
+                                      "z" : SASINSTR_DET_OFF_Z,
+                                      }
+                        }
+    SASINSTR_DET_OR_ATTR = {
+                            "unit" : "{0}.orientation_unit = \"{1}\"",
+                            "storeas" : "content"
+                            }
+    SASINSTR_DET_OR_ROLL = {
+                            "variable" : "{0}.orientation.x = {1}",
+                            "unit" : "orientation_unit",
+                            "attributes" : SASINSTR_DET_OR_ATTR
+                            }
+    SASINSTR_DET_OR_PITCH = {
+                             "variable" : "{0}.orientation.y = {1}",
+                             "unit" : "orientation_unit",
+                             "attributes" : SASINSTR_DET_OR_ATTR
+                             }
+    SASINSTR_DET_OR_YAW = {
+                           "variable" : "{0}.orientation.z = {1}",
+                           "unit" : "orientation_unit",
+                           "attributes" : SASINSTR_DET_OR_ATTR
+                           }
+    SASINSTR_DET_OR = {
+                       "variable" : None,
+                       "children" : {
+                                     "roll" : SASINSTR_DET_OR_ROLL,
+                                     "pitch" : SASINSTR_DET_OR_PITCH,
+                                     "yaw" : SASINSTR_DET_OR_YAW,
+                                     }
+                       }
+    SASINSTR_DET_BC_X = {
+                         "variable" : "{0}.beam_center.x = {1}",
+                         "unit" : "beam_center_unit",
+                         "attributes" : {
+                                         "unit" : \
+                                            "{0}.beam_center_unit = \"{1}\"",
+                                         "storeas" : "content"
+                                         }
+                         }
+    SASINSTR_DET_BC_Y = {
+                         "variable" : "{0}.beam_center.y = {1}",
+                         "unit" : "beam_center_unit",
+                         "attributes" : {
+                                         "unit" : \
+                                            "{0}.beam_center_unit = \"{1}\"",
+                                         "storeas" : "content"
+                                         }
+                         }
+    SASINSTR_DET_BC_Z = {
+                         "variable" : "{0}.beam_center.z = {1}",
+                         "unit" : "beam_center_unit",
+                         "attributes" : {
+                                         "unit" : \
+                                            "{0}.beam_center_unit = \"{1}\"",
+                                         "storeas" : "content"
+                                         }
+                         }
+    SASINSTR_DET_BC = {
+                       "variable" : None,
+                       "children" : {
+                                    "x" : SASINSTR_DET_BC_X,
+                                    "y" : SASINSTR_DET_BC_Y,
+                                    "z" : SASINSTR_DET_BC_Z,
+                                    }
+                      }
+    SASINSTR_DET_PIXEL_X = {
+                        "variable" : "{0}.pixel_size.x = {1}",
+                        "unit" : "pixel_size_unit",
+                        "attributes" : {
+                                        "unit" : "{0}.pixel_size_unit = \"{1}\"",
+                                        "storeas" : "content"
+                                        }
+                        }
+    SASINSTR_DET_PIXEL_Y = {
+                        "variable" : "{0}.pixel_size.y = {1}",
+                        "unit" : "pixel_size_unit",
+                        "attributes" : {
+                                        "unit" : "{0}.pixel_size_unit = \"{1}\"",
+                                        "storeas" : "content"
+                                        }
+                        }
+    SASINSTR_DET_PIXEL_Z = {
+                        "variable" : "{0}.pixel_size.z = {1}",
+                        "unit" : "pixel_size_unit",
+                        "attributes" : {
+                                        "unit" : "{0}.pixel_size_unit = \"{1}\"",
+                                        "storeas" : "content"
+                                        }
+                        }
+    SASINSTR_DET_PIXEL = {
+                      "variable" : None,
+                      "children" : {
+                                    "x" : SASINSTR_DET_PIXEL_X,
+                                    "y" : SASINSTR_DET_PIXEL_Y,
+                                    "z" : SASINSTR_DET_PIXEL_Z,
+                                    }
+                      }
+    SASINSTR_DET_SLIT = {
+                         "variable" : "{0}.slit_length = {1}",
+                         "unit" : "slit_length_unit",
+                         "attributes" : {
+                                         "unit" : {
+                                                   "variable" : "{0}.slit_length_unit = \"{1}\"",
+                                                   "storeas" : "content"
+                                                   }
+                                         }
+                         }
+    SASINSTR_DET = {
+                    "storeas" : "float",
+                    "variable" : None,
+                    "attributes" : {
+                                    "name" : {
+                                              "storeas" : "content",
+                                              "variable" : "{0}.name = \"{1}\"",
+                                              }
+                                    },
+                    "children" : {
+                                  "name" : {
+                                            "storeas" : "content",
+                                            "variable" : "{0}.name = \"{1}\"",
+                                            },
+                                  "SDD" : SASINSTR_DET_SDD,
+                                  "offset" : SASINSTR_DET_OFF,
+                                  "orientation" : SASINSTR_DET_OR,
+                                  "beam_center" : SASINSTR_DET_BC,
+                                  "pixel_size" : SASINSTR_DET_PIXEL,
+                                  "slit_length" : SASINSTR_DET_SLIT,
+                                  }
+                    }
+    SASINSTR = {
+                "variable" : None,
+                "children" : {
+                              "variable" : None,
+                              "name" : {"variable" : \
+                                            "{0}.instrument = \"{1}\""},
+                              "SASsource" : SASINSTR_SRC,
+                              "SAScollimation" : SASINSTR_COLL,
+                              "SASdetector" : SASINSTR_DET,
+                              },
+                }
     CANSAS_FORMAT = {
                      "SASentry" : {
@@ -17,602 +681,19 @@
                                    "variable" : None,
                                    "storeas" : "content",
-                                   "attributes" : {"name" : {"variable" : "{0}.run_name[node_value] = \"{1}\""}},
+                                   "attributes" : {"name" : {"variable" : \
+                                        "{0}.run_name[node_value] = \"{1}\""}},
                                    "children" : {
-                                                 "Title" : {"variable" : "{0}.title = \"{1}\""},
-                                                 "Run" : {
-                                                          "variable" : "{0}.run.append(\"{1}\")",
-                                                          "attributes" : {"name" : {"variable" : "{0}.run_name[node_value] = \"{1}\""}}
-                                                          },
-                                                 "SASdata" : {
-                                                              "attributes" : {"name" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",}},
-                                                              "variable" : None,
-                                                              "children" : {"Idata" : {
-                                                                                       "storeas" : "float",
-                                                                                       "units_optional" : False,
-                                                                                       "variable" : None,
-                                                                                       "attributes" : {
-                                                                                                       "name" : {
-                                                                                                                 "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                 "storeas" : "content",
-                                                                                                                 },
-                                                                                                       "timestamp" : {
-                                                                                                                      "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                      "storeas" : "content",
-                                                                                                                      }
-                                                                                                        },
-                                                                                       "children" : {
-                                                                                                     "Q" : {
-                                                                                                            "variable" : "{0}.x = numpy.append({0}.x, {1})",
-                                                                                                            "unit" : "x_unit",
-                                                                                                            "attributes" : {
-                                                                                                                            "unit" : {
-                                                                                                                                      "variable" : "{0}._xunit = \"{1}\"",
-                                                                                                                                      "storeas" : "content"
-                                                                                                                                      }
-                                                                                                                            }
-                                                                                                            },
-                                                                                                     "I" : {
-                                                                                                            "variable" : "{0}.y = numpy.append({0}.y, {1})",
-                                                                                                            "unit" : "y_unit",
-                                                                                                            "attributes" : {
-                                                                                                                            "unit" : {
-                                                                                                                                      "variable" : "{0}._yunit = \"{1}\"",
-                                                                                                                                      "storeas" : "content"
-                                                                                                                                      }
-                                                                                                                            }
-                                                                                                            },
-                                                                                                     "Idev" : {
-                                                                                                               "variable" : "{0}.dy = numpy.append({0}.dy, {1})",
-                                                                                                               "unit" : "y_unit",
-                                                                                                               "attributes" : {
-                                                                                                                               "unit" : {
-                                                                                                                                         "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                                         "storeas" : "content"
-                                                                                                                                         }
-                                                                                                                               },
-                                                                                                               },
-                                                                                                     "Qdev" : {
-                                                                                                               "variable" : "{0}.dx = numpy.append({0}.dx, {1})",
-                                                                                                               "unit" : "x_unit",
-                                                                                                               "attributes" : {
-                                                                                                                               "unit" : {
-                                                                                                                                         "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                                         "storeas" : "content"
-                                                                                                                                         }
-                                                                                                                               },
-                                                                                                               },
-                                                                                                     "dQw" : {
-                                                                                                              "variable" : "{0}.dxw = numpy.append({0}.dxw, {1})",
-                                                                                                              "unit" : "x_unit",
-                                                                                                              "attributes" : {
-                                                                                                                              "unit" : {
-                                                                                                                                        "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                                        "storeas" : "content"
-                                                                                                                                        }
-                                                                                                                              },
-                                                                                                              },
-                                                                                                     "dQl" : {
-                                                                                                              "variable" : "{0}.dxl = numpy.append({0}.dxl, {1})",
-                                                                                                              "unit" : "x_unit",
-                                                                                                              "attributes" : {
-                                                                                                                              "unit" : {
-                                                                                                                                        "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                                        "storeas" : "content"
-                                                                                                                                        }
-                                                                                                                              },
-                                                                                                              },
-                                                                                                     "Qmean" : {
-                                                                                                                "storeas" : "content",
-                                                                                                                "unit" : "x_unit",
-                                                                                                                "variable" : "{0}.meta_data[\"{2}\"] = {1}",
-                                                                                                                "attributes" : {"unit" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""}},
-                                                                                                                },
-                                                                                                     "Shadowfactor" : {
-                                                                                                                       "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                       "storeas" : "content",
-                                                                                                                       },
-                                                                                                     "<any>" : {
-                                                                                                                "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                "storeas" : "content",
-                                                                                                                }
-                                                                                                     }
-                                                                                       },
-                                                                            "<any>" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",}
-                                                                            }
-                                                              },
-                                                 "SAStransmission_spectrum" : {
-                                                                               "variable" : None,
-                                                                               "children" : {
-                                                                                             "Tdata" : {
-                                                                                                        "storeas" : "float",
-                                                                                                        "variable" : None,
-                                                                                                        "children" : {
-                                                                                                                      "Lambda" : {
-                                                                                                                                  "variable" : "{0}.trans_spectrum.wavelength.append({1})",
-                                                                                                                                  "unit" : "trans_spectrum.wavelength_unit",
-                                                                                                                                  "attributes" : {
-                                                                                                                                                  "unit" : {
-                                                                                                                                                            "variable" : "{0}.trans_spectrum.wavelength_unit = \"{1}\"",
-                                                                                                                                                            "storeas" : "content"
-                                                                                                                                                            }
-                                                                                                                                                  }
-                                                                                                                                  },
-                                                                                                                      "T" : {
-                                                                                                                             "variable" : "{0}.trans_spectrum.transmission.append({1})",
-                                                                                                                             "unit" : "trans_spectrum.transmission_unit",
-                                                                                                                             "attributes" : {
-                                                                                                                                             "unit" : {
-                                                                                                                                                       "variable" : "{0}.trans_spectrum.transmission_unit = \"{1}\"",
-                                                                                                                                                       "storeas" : "content"
-                                                                                                                                                       }
-                                                                                                                                             }
-                                                                                                                             },
-                                                                                                                      "Tdev" : {
-                                                                                                                                "variable" : "{0}.trans_spectrum.transmission_deviation.append({1})",
-                                                                                                                                "unit" : "trans_spectrum.transmission_deviation_unit",
-                                                                                                                                "attributes" : {
-                                                                                                                                             "unit" : {
-                                                                                                                                                       "variable" : "{0}.trans_spectrum.transmission_deviation_unit = \"{1}\"",
-                                                                                                                                                       "storeas" : "content"
-                                                                                                                                                       }
-                                                                                                                                             }
-                                                                                                                                },
-                                                                                                                      "<any>" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""},
-                                                                                                                      }
-                                                                                                        },
-                                                                                             "<any>" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""},
-                                                                                             },
-                                                                               "attributes" : {"name" : {"variable" : "{0}.trans_spectrum.name = \"{1}\""},
-                                                                                               "timestamp" : {"variable" : "{0}.trans_spectrum.timestamp = \"{1}\""},}
-                                                                               },
-                                                 "SASsample" : {
-                                                                "attributes" : {"name" : {"variable" : "{0}.sample.name = \"{1}\""},},
-                                                                "variable" : None,
-                                                                "children" : {
-                                                                              "ID" : {"variable" : "{0}.sample.ID = \"{1}\""},
-                                                                              "thickness" : {
-                                                                                             "variable" : "{0}.sample.thickness = {1}",
-                                                                                             "unit" : "sample.thickness_unit",
-                                                                                             "storeas" : "float",
-                                                                                             "attributes" : {
-                                                                                                             "units" : {
-                                                                                                                        "variable" : "{0}.sample.thickness_unit = \"{1}\"",
-                                                                                                                        "storeas" : "content"
-                                                                                                                        }
-                                                                                                             },
-                                                                                             },
-                                                                              "transmission" : {
-                                                                                                "variable" : "{0}.sample.transmission = {1}",
-                                                                                                "storeas" : "float",
-                                                                                                }, 
-                                                                              "temperature" : {
-                                                                                               "variable" : "{0}.sample.temperature = {1}",
-                                                                                               "unit" : "sample.temperature_unit",
-                                                                                               "storeas" : "float",
-                                                                                               "attributes" : {
-                                                                                                               "units" : {
-                                                                                                                          "variable" : "{0}.sample.temperature_unit = \"{1}\"",
-                                                                                                                          "storeas" : "content"
-                                                                                                                          }
-                                                                                                               },
-                                                                                               }, 
-                                                                              "position" : {
-                                                                                            "children" : {
-                                                                                                          "variable" : None,
-                                                                                                          "x" : {
-                                                                                                                 "variable" : "{0}.sample.position.x = {1}",
-                                                                                                                 "unit" : "sample.position_unit",
-                                                                                                                 "storeas" : "float",
-                                                                                                                 "attributes" : {
-                                                                                                                                 "units" : {
-                                                                                                                                            "variable" : "{0}.sample.position_unit = \"{1}\"",
-                                                                                                                                            "storeas" : "content"
-                                                                                                                                            }
-                                                                                                                                 }
-                                                                                                                 },
-                                                                                                          "y" : {
-                                                                                                                 "variable" : "{0}.sample.position.y = {1}",
-                                                                                                                 "unit" : "sample.position_unit",
-                                                                                                                 "attributes" : {
-                                                                                                                                 "units" : {
-                                                                                                                                            "variable" : "{0}.sample.position_unit = \"{1}\"",
-                                                                                                                                            "storeas" : "content"
-                                                                                                                                            }
-                                                                                                                                 }
-                                                                                                                 },
-                                                                                                          "z" : {
-                                                                                                                 "variable" : "{0}.sample.position.z = {1}",
-                                                                                                                 "unit" : "sample.position_unit",
-                                                                                                                 "attributes" : {
-                                                                                                                                 "units" : {
-                                                                                                                                            "variable" : "{0}.sample.position_unit = \"{1}\"",
-                                                                                                                                            "storeas" : "content"
-                                                                                                                                            }
-                                                                                                                                 }
-                                                                                                                 },
-                                                                                                          },
-                                                                                            },
-                                                                              "orientation" : {
-                                                                                               "variable" : None,
-                                                                                               "children" : {
-                                                                                                             "roll" : {
-                                                                                                                       "variable" : "{0}.sample.orientation.x = {1}",
-                                                                                                                       "unit" : "sample.orientation_unit",
-                                                                                                                       "storeas" : "float",
-                                                                                                                       "attributes" : {
-                                                                                                                                       "units" : {
-                                                                                                                                                  "variable" : "{0}.sample.orientation_unit = \"{1}\"",
-                                                                                                                                                  "storeas" : "content"
-                                                                                                                                                  }
-                                                                                                                                       }
-                                                                                                                       },
-                                                                                                             "pitch" : {
-                                                                                                                       "variable" : "{0}.sample.orientation.y = {1}",
-                                                                                                                       "unit" : "sample.orientation_unit",
-                                                                                                                       "storeas" : "float",
-                                                                                                                       "attributes" : {
-                                                                                                                                       "units" : {
-                                                                                                                                                  "variable" : "{0}.sample.orientation_unit = \"{1}\"",
-                                                                                                                                                  "storeas" : "content"
-                                                                                                                                                  }
-                                                                                                                                       }
-                                                                                                                       },
-                                                                                                             "yaw" : {
-                                                                                                                       "variable" : "{0}.sample.orientation.z = {1}",
-                                                                                                                       "unit" : "sample.orientation_unit",
-                                                                                                                       "storeas" : "float",
-                                                                                                                       "attributes" : {
-                                                                                                                                       "units" : {
-                                                                                                                                                  "variable" : "{0}.sample.orientation_unit = \"{1}\"",
-                                                                                                                                                  "storeas" : "content"
-                                                                                                                                                  }
-                                                                                                                                       }
-                                                                                                                       },
-                                                                                                             },
-                                                                                               },
-                                                                              "details" : {"variable" : "{0}.sample.details.append(\"{1}\")"},
-                                                                              "<any>" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""}
-                                                                              },
-                                                                },
-                                                 "SASinstrument" : {
-                                                                    "variable" : None,
-                                                                    "children" : {
-                                                                                  "variable" : None,
-                                                                                  "name" : {"variable" : "{0}.instrument = \"{1}\""},
-                                                                                  "SASsource" : {
-                                                                                                 "attributes" : {"name" : {"variable" : "{0}.source.name = \"{1}\""}},
-                                                                                                 "variable" : None,
-                                                                                                 "children" : {
-                                                                                                               "radiation" : {"variable" : "{0}.source.radiation = \"{1}\""},
-                                                                                                               "beam_size" : {
-                                                                                                                              "attributes" : {"name" : {"variable" : "{0}.source.beam_size_name = \"{1}\""}},
-                                                                                                                              "variable" : None,
-                                                                                                                              "children" : {
-                                                                                                                                            "x" : {
-                                                                                                                                                   "variable" : "{0}.source.beam_size.x = {1}",
-                                                                                                                                                   "unit" : "source.beam_size_unit",
-                                                                                                                                                   "storeas" : "float",
-                                                                                                                                                   "attributes" : {
-                                                                                                                                                                   "unit" : "{0}.source.beam_size_unit = \"{1}\"",
-                                                                                                                                                                   "storeas" : "content"
-                                                                                                                                                                   }
-                                                                                                                                                   },
-                                                                                                                                            "y" : {
-                                                                                                                                                   "variable" : "{0}.source.beam_size.y = {1}",
-                                                                                                                                                   "unit" : "source.beam_size_unit",
-                                                                                                                                                   "storeas" : "float",
-                                                                                                                                                   "attributes" : {
-                                                                                                                                                                   "unit" : "{0}.source.beam_size_unit = \"{1}\"",
-                                                                                                                                                                   "storeas" : "content"
-                                                                                                                                                                   }
-                                                                                                                                                   },
-                                                                                                                                            "z" : {
-                                                                                                                                                   "variable" : "{0}.source.beam_size.z = {1}",
-                                                                                                                                                   "unit" : "source.beam_size_unit",
-                                                                                                                                                   "storeas" : "float",
-                                                                                                                                                   "attributes" : {
-                                                                                                                                                                   "unit" : "{0}.source.beam_size_unit = \"{1}\"",
-                                                                                                                                                                   "storeas" : "content"
-                                                                                                                                                                   }
-                                                                                                                                                   },
-                                                                                                                                            }
-                                                                                                                              },
-                                                                                                               "beam_shape" : {"variable" : "{0}.source.beam_shape = \"{1}\""},
-                                                                                                               "wavelength" : {
-                                                                                                                               "variable" : "{0}.source.wavelength = {1}",
-                                                                                                                               "unit" : "source.wavelength_unit",
-                                                                                                                               "storeas" : "float",
-                                                                                                                               "attributes" : {
-                                                                                                                                               "unit" : {
-                                                                                                                                                         "variable" : "{0}.source.wavelength_unit = \"{1}\"",
-                                                                                                                                                         "storeas" : "content"
-                                                                                                                                                         },
-                                                                                                                                               }
-                                                                                                                               },
-                                                                                                               "wavelength_min" : {
-                                                                                                                                  "variable" : "{0}.source.wavelength_min = {1}",
-                                                                                                                                  "unit" : "source.wavelength_min_unit",
-                                                                                                                                  "storeas" : "float",
-                                                                                                                                  "attributes" : {
-                                                                                                                                                  "unit" : {
-                                                                                                                                                            "variable" : "{0}.source.wavelength_min_unit = \"{1}\"",  
-                                                                                                                                                            "storeas" : "content"
-                                                                                                                                                            },
-                                                                                                                                                  }
-                                                                                                                                  },
-                                                                                                               "wavelength_max" : {
-                                                                                                                                   "variable" : "{0}.source.wavelength_max = {1}",
-                                                                                                                                   "unit" : "source.wavelength_max_unit",
-                                                                                                                                   "storeas" : "float",
-                                                                                                                                   "attributes" : {
-                                                                                                                                                   "unit" : {
-                                                                                                                                                             "variable" : "{0}.source.wavelength_max_unit = \"{1}\"",
-                                                                                                                                                             "storeas" : "content"
-                                                                                                                                                             },
-                                                                                                                                                   }
-                                                                                                                                   },
-                                                                                                               "wavelength_spread" : {
-                                                                                                                                      "variable" : "{0}.source.wavelength_spread = {1}",
-                                                                                                                                      "unit" : "source.wavelength_spread_unit",
-                                                                                                                                      "storeas" : "float",
-                                                                                                                                      "attributes" : {
-                                                                                                                                                      "unit" : {"variable" : "{0}.source.wavelength_spread_unit = \"{1}\""},
-                                                                                                                                                      "storeas" : "content"
-                                                                                                                                                      }
-                                                                                                                                      },
-                                                                                                               },
-                                                                                                 },
-                                                                                  "SAScollimation" : {
-                                                                                                      "attributes" : {"name" : {"variable" : "{0}.name = \"{1}\""}},
-                                                                                                      "variable" : None,
-                                                                                                      "children" : {
-                                                                                                                    "length" : {
-                                                                                                                                "variable" : "{0}.length = {1}",
-                                                                                                                                "unit" : "length_unit",
-                                                                                                                                "storeas" : "float",
-                                                                                                                                "attributes" : {
-                                                                                                                                                "storeas" : "content",
-                                                                                                                                                "unit" : {"variable" : "{0}.length_unit = \"{1}\""}
-                                                                                                                                                },
-                                                                                                                                },
-                                                                                                                    "aperture" : {
-                                                                                                                                  "variable" : None,
-                                                                                                                                  "attributes" : {
-                                                                                                                                                  "name" : {"variable" : "{0}.name = \"{1}\""},
-                                                                                                                                                  "type" : {"variable" : "{0}.type = \"{1}\""},
-                                                                                                                                                  },
-                                                                                                                                  "children" : {
-                                                                                                                                                "size" : {
-                                                                                                                                                          "attributes" : {"unit" : {"variable" : "{0}.size_unit = \"{1}\""}},
-                                                                                                                                                          "children" : {
-                                                                                                                                                                        "storeas" : "float",
-                                                                                                                                                                        "x" : {
-                                                                                                                                                                               "variable" : "{0}.size.x = {1}",
-                                                                                                                                                                               "unit" : "size_unit",
-                                                                                                                                                                               "storeas" : "float",
-                                                                                                                                                                               "attributes" : {
-                                                                                                                                                                                               "unit" : {
-                                                                                                                                                                                                         "variable" : "{0}.size_unit = \"{1}\"",
-                                                                                                                                                                                                         "storeas" : "content"
-                                                                                                                                                                                                         },                                    }
-                                                                                                                                                                               },
-                                                                                                                                                                        "y" : {
-                                                                                                                                                                               "variable" : "{0}.size.y = {1}",
-                                                                                                                                                                               "unit" : "size_unit",
-                                                                                                                                                                               "storeas" : "float",
-                                                                                                                                                                               "attributes" : {
-                                                                                                                                                                                               "unit" : {
-                                                                                                                                                                                                         "variable" : "{0}.size_unit = \"{1}\"",
-                                                                                                                                                                                                         "storeas" : "content"
-                                                                                                                                                                                                         },
-                                                                                                                                                                                               }
-                                                                                                                                                                               },
-                                                                                                                                                                        "z" : {
-                                                                                                                                                                               "variable" : "{0}.size.z = {1}",
-                                                                                                                                                                               "unit" : "size_unit",
-                                                                                                                                                                               "storeas" : "float",
-                                                                                                                                                                               "attributes" : {
-                                                                                                                                                                                               "unit" : {
-                                                                                                                                                                                                         "variable" : "{0}.size_unit = \"{1}\"",
-                                                                                                                                                                                                         "storeas" : "content"
-                                                                                                                                                                                                         },
-                                                                                                                                                                                              }
-                                                                                                                                                                               },
-                                                                                                                                                                        }
-                                                                                                                                                          },
-                                                                                                                                                "distance" : {
-                                                                                                                                                              "storeas" : "float",
-                                                                                                                                                              "attributes" : {
-                                                                                                                                                                              "storeas" : "content",
-                                                                                                                                                                              "unit" : {"variable" : "{0}.distance_unit = \"{1}\""}},
-                                                                                                                                                              "variable" : "{0}.distance = {1}",
-                                                                                                                                                              "unit" : "distance_unit",
-                                                                                                                                                              }
-                                                                                                                                                }
-                                                                                                                                  },
-                                                                                                                    },
-                                                                                                      },
-                                                                                  "SASdetector" : {
-                                                                                                   "storeas" : "float",
-                                                                                                   "variable" : None,
-                                                                                                   "attributes" : {
-                                                                                                                   "name" : {
-                                                                                                                             "storeas" : "content",
-                                                                                                                             "variable" : "{0}.name = \"{1}\"",
-                                                                                                                             }
-                                                                                                                   },
-                                                                                                   "children" : {
-                                                                                                                 "name" : {
-                                                                                                                           "storeas" : "content",
-                                                                                                                           "variable" : "{0}.name = \"{1}\"",
-                                                                                                                           },
-                                                                                                                 "SDD" : {
-                                                                                                                          "variable" : "{0}.distance = {1}",
-                                                                                                                          "unit" : "distance_unit",
-                                                                                                                          "attributes" : {
-                                                                                                                                          "unit" : {
-                                                                                                                                                    "variable" : "{0}.distance_unit = \"{1}\"",
-                                                                                                                                                    "storeas" : "content"
-                                                                                                                                                    }
-                                                                                                                                          },
-                                                                                                                          },
-                                                                                                                 "offset" : {
-                                                                                                                             "variable" : None,
-                                                                                                                             "children" : {
-                                                                                                                                           "x" : {
-                                                                                                                                                  "variable" : "{0}.offset.x = {1}",
-                                                                                                                                                  "unit" : "offset_unit",
-                                                                                                                                                  "attributes" : {
-                                                                                                                                                                  "unit" : {
-                                                                                                                                                                            "variable" : "{0}.offset_unit = \"{1}\"",
-                                                                                                                                                                            "storeas" : "content"
-                                                                                                                                                                            },
-                                                                                                                                                                  }
-                                                                                                                                                  },
-                                                                                                                                           "y" : {
-                                                                                                                                                  "variable" : "{0}.offset.y = {1}",
-                                                                                                                                                  "unit" : "offset_unit",
-                                                                                                                                                  "attributes" : {
-                                                                                                                                                                  "unit" : {
-                                                                                                                                                                            "variable" : "{0}.offset_unit = \"{1}\"",
-                                                                                                                                                                            "storeas" : "content"
-                                                                                                                                                                            },
-                                                                                                                                                                  }
-                                                                                                                                                  },
-                                                                                                                                           "z" : {
-                                                                                                                                                  "variable" : "{0}.offset.z = {1}",
-                                                                                                                                                  "unit" : "offset_unit",
-                                                                                                                                                  "attributes" : {
-                                                                                                                                                                  "unit" : {
-                                                                                                                                                                            "variable" : "{0}.offset_unit = \"{1}\"",
-                                                                                                                                                                            "storeas" : "content"
-                                                                                                                                                                            },
-                                                                                                                                                                  }
-                                                                                                                                                  },
-                                                                                                                                           }
-                                                                                                                             },
-                                                                                                                 "orientation" : {
-                                                                                                                                  "variable" : None,
-                                                                                                                                  "children" : {
-                                                                                                                                                "roll" : {
-                                                                                                                                                          "variable" : "{0}.orientation.x = {1}",
-                                                                                                                                                          "unit" : "orientation_unit",
-                                                                                                                                                          "attributes" : {
-                                                                                                                                                                          "unit" : "{0}.orientation_unit = \"{1}\"",
-                                                                                                                                                                          "storeas" : "content"
-                                                                                                                                                                          }
-                                                                                                                                                          },
-                                                                                                                                                "pitch" : {
-                                                                                                                                                           "variable" : "{0}.orientation.y = {1}",
-                                                                                                                                                           "unit" : "orientation_unit",
-                                                                                                                                                           "attributes" : {
-                                                                                                                                                                           "unit" : "{0}.orientation_unit = \"{1}\"",
-                                                                                                                                                                           "storeas" : "content"
-                                                                                                                                                                           }
-                                                                                                                                                           },
-                                                                                                                                                "yaw" : {
-                                                                                                                                                         "variable" : "{0}.orientation.z = {1}",
-                                                                                                                                                         "unit" : "orientation_unit",
-                                                                                                                                                         "attributes" : {
-                                                                                                                                                                         "unit" : "{0}.orientation_unit = \"{1}\"",
-                                                                                                                                                                         "storeas" : "content"
-                                                                                                                                                                         }
-                                                                                                                                                         },
-                                                                                                                                                }
-                                                                                                                                  },
-                                                                                                                 "beam_center" : {
-                                                                                                                                  "variable" : None,
-                                                                                                                                  "children" : {
-                                                                                                                                                "x" : {
-                                                                                                                                                       "variable" : "{0}.beam_center.x = {1}",
-                                                                                                                                                       "unit" : "beam_center_unit",
-                                                                                                                                                       "attributes" : {
-                                                                                                                                                                       "unit" : "{0}.beam_center_unit = \"{1}\"",
-                                                                                                                                                                       "storeas" : "content"
-                                                                                                                                                                       }
-                                                                                                                                                  },
-                                                                                                                                                "y" : {
-                                                                                                                                                       "variable" : "{0}.beam_center.y = {1}",
-                                                                                                                                                       "unit" : "beam_center_unit",
-                                                                                                                                                       "attributes" : {
-                                                                                                                                                                       "unit" : "{0}.beam_center_unit = \"{1}\"",
-                                                                                                                                                                       "storeas" : "content"
-                                                                                                                                                                       }
-                                                                                                                                                       },
-                                                                                                                                                "z" : {
-                                                                                                                                                       "variable" : "{0}.beam_center.z = {1}",
-                                                                                                                                                       "unit" : "beam_center_unit",
-                                                                                                                                                       "attributes" : {
-                                                                                                                                                                       "unit" : "{0}.beam_center_unit = \"{1}\"",
-                                                                                                                                                                       "storeas" : "content"
-                                                                                                                                                                       }
-                                                                                                                                                       },
-                                                                                                                                                }
-                                                                                                                                  },
-                                                                                                                 "pixel_size" : {
-                                                                                                                                 "variable" : None,
-                                                                                                                                 "children" : {
-                                                                                                                                               "x" : {
-                                                                                                                                                      "variable" : "{0}.pixel_size.x = {1}",
-                                                                                                                                                      "unit" : "pixel_size_unit",
-                                                                                                                                                      "attributes" : {
-                                                                                                                                                                      "unit" : "{0}.pixel_size_unit = \"{1}\"",
-                                                                                                                                                                      "storeas" : "content"
-                                                                                                                                                                      }
-                                                                                                                                                      },
-                                                                                                                                                "y" : {
-                                                                                                                                                       "variable" : "{0}.pixel_size.y = {1}",
-                                                                                                                                                       "unit" : "pixel_size_unit",
-                                                                                                                                                      "attributes" : {
-                                                                                                                                                                       "unit" : "{0}.pixel_size_unit = \"{1}\"",
-                                                                                                                                                                       "storeas" : "content"
-                                                                                                                                                                       }
-                                                                                                                                                       },
-                                                                                                                                                "z" : {
-                                                                                                                                                       "variable" : "{0}.pixel_size.z = {1}",
-                                                                                                                                                       "unit" : "pixel_size_unit",
-                                                                                                                                                      "attributes" : {
-                                                                                                                                                                       "unit" : "{0}.pixel_size_unit = \"{1}\"",
-                                                                                                                                                                       "storeas" : "content"
-                                                                                                                                                                       }
-                                                                                                                                                       },
-                                                                                                                                                }
-                                                                                                                                  },
-                                                                                                                 "slit_length" : {
-                                                                                                                                  "variable" : "{0}.slit_length = {1}",
-                                                                                                                                  "unit" : "slit_length_unit",
-                                                                                                                                  "attributes" : {
-                                                                                                                                                  "unit" : {
-                                                                                                                                                            "variable" : "{0}.slit_length_unit = \"{1}\"",
-                                                                                                                                                            "storeas" : "content"
-                                                                                                                                                            }
-                                                                                                                                                  }
-                                                                                                                                  }
-                                                                                                                  },
-                                                                                                   },
-                                                                                   },
-                                                                    },
-                                                 "SASprocess" : {
-                                                                 "variable" : None,
-                                                                 "children" : {
-                                                                               "name" : {"variable" : "{0}.name = \'{1}\'"},
-                                                                               "date" : {"variable" : "{0}.date = \'{1}\'"},
-                                                                               "description" : {"variable" : "{0}.description = \'{1}\'"},
-                                                                               "term" : {
-                                                                                         "variable" : None,
-                                                                                         "attributes" : {
-                                                                                                         "unit" : {"variable" : None},
-                                                                                                         "name" : {"variable" : None}
-                                                                                                         }
-                                                                                         },
-                                                                               "SASprocessnote" : {
-                                                                                                   "variable" : None,
-                                                                                                   "children" : {"<any>" : {"variable" : "{0}.notes.append(\'2}: {1}\')"}}},
-                                                                               "<any>" : {"variable" : "{0}.notes.append(\'{2}: {1}\')",}
-                                                                               },
-                                                                 },
-                                                 "SASnote" : {"variable" : "{0}.notes.append(\'{1}\')"},
-                                                 "<any>" : {"variable" : "{0}.meta_data[\"{2}\"] = \'{1}\'"},
+                                                 "Title" : TITLE,
+                                                 "Run" : RUN,
+                                                 "SASdata" : SASDATA,
+                                                 "SAStransmission_spectrum" : \
+                                                    SASTRANSSPEC,
+                                                 "SASsample" : SASSAMPLE,
+                                                 "SASinstrument" : SASINSTR,
+                                                 "SASprocess" : SASPROCESS,
+                                                 "SASnote" : SASNOTE,
+                                                 "<any>" : ANY,
                                                  }
                                    }
                      }
+    
Index: src/sans/dataloader/readers/cansas_reader.py
===================================================================
--- src/sans/dataloader/readers/cansas_reader.py	(revision 1ce36f37f9ee74bf08c2b41dd32ab808d66c3f12)
+++ src/sans/dataloader/readers/cansas_reader.py	(revision 76cd1aeb8047424a5dc9e1d0e5c3eaa0f17c3bb4)
@@ -1,4 +1,4 @@
 """
-    CanSAS data reader - new recursive cansasVersion.
+    CanSAS data reader - new recursive cansas_version.
 """
 ############################################################################
@@ -19,10 +19,11 @@
 from sans.dataloader.data_info import Data1D
 from sans.dataloader.data_info import Collimation
+from sans.dataloader.data_info import TransmissionSpectrum
 from sans.dataloader.data_info import Detector
 from sans.dataloader.data_info import Process
 from sans.dataloader.data_info import Aperture
-import xml_reader
+import sans.dataloader.readers.xml_reader as xml_reader
 import xml.dom.minidom
-from cansas_constants import cansasConstants
+from sans.dataloader.readers.cansas_constants import cansasConstants
 
 _ZERO = 1e-16
@@ -32,7 +33,8 @@
 except:
     HAS_CONVERTER = False
-    
-CANSAS_FORMAT = cansasConstants.CANSAS_FORMAT
-CANSAS_NS = cansasConstants.CANSAS_NS
+
+constants = cansasConstants()    
+CANSAS_FORMAT = constants.format
+CANSAS_NS = constants.ns
 ALLOW_ALL = True
 
@@ -118,5 +120,5 @@
     """
     ##CanSAS version - defaults to version 1.0
-    cansasVersion = "1.0"
+    cansas_version = "1.0"
     ##Data reader
     reader = xml_reader.XMLreader()
@@ -137,5 +139,5 @@
         self.errors = []
         
-    def isCansas(self):
+    def is_cansas(self):
         """
         Checks to see if the xml file is a CanSAS file
@@ -143,5 +145,6 @@
         if self.reader.validateXML():
             xmlns = self.reader.xmlroot.keys()
-            if (CANSAS_NS.get(self.cansasVersion).get("ns") == self.reader.xmlroot.get(xmlns[1]).rsplit(" ")[0]):
+            if (CANSAS_NS.get(self.cansas_version).get("ns") == \
+                    self.reader.xmlroot.get(xmlns[1]).rsplit(" ")[0]):
                 return True
         return False
@@ -176,14 +179,15 @@
                 base = base_name.split("/sans/")[0]
                 
-                # Load in the xml file and get the cansas version from the header
+                # Load in xml file and get the cansas version from the header
                 self.reader.setXMLFile(xml)
                 root = self.reader.xmlroot
                 if root is None:
                     root = {}
-                self.cansasVersion = root.get("version", "1.0")
+                self.cansas_version = root.get("version", "1.0")
                 
                 # Generic values for the cansas file based on the version
-                cansas_defaults = CANSAS_NS.get(self.cansasVersion, "1.0")
-                schema_path = "{0}/sans/dataloader/readers/schema/{1}".format(base, cansas_defaults.get("schema")).replace("\\", "/")
+                cansas_defaults = CANSAS_NS.get(self.cansas_version, "1.0")
+                schema_path = "{0}/sans/dataloader/readers/schema/{1}".format\
+                        (base, cansas_defaults.get("schema")).replace("\\", "/")
                 
                 # Link a schema to the XML file.
@@ -193,34 +197,36 @@
                 # Check the file matches the XML schema
                 try:
-                    if self.isCansas():
-                        # Get each SASentry from the XML file and add it to a list.
+                    if self.is_cansas():
+                        # Get each SASentry from XML file and add it to a list.
                         entry_list = root.xpath('/ns:SASroot/ns:SASentry',
-                                                     namespaces={'ns': cansas_defaults.get("ns")})
+                                namespaces={'ns': cansas_defaults.get("ns")})
                         ns.append("SASentry")
                         
-                        # If there are multiple files, modify the name for each is unique
-                        multipleFiles = len(entry_list) - 1
-                        n = 0
+                        # If multiple files, modify the name for each is unique
+                        multiple_files = len(entry_list) - 1
+                        increment = 0
                         name = basename
                         # Parse each SASentry item
                         for entry in entry_list:
+                            # Define a new Data1D object with zeroes for x and y
+                            data1d = Data1D(x,y,dx,dy)
+                            data1d.dxl = dxl
+                            data1d.dxw = dxw
                             
-                            # Define a new Data1D object with zeroes for x and y
-                            data1D = Data1D(x,y,dx,dy)
-                            data1D.dxl = dxl
-                            data1D.dxw = dxw
+                            # If more than one SASentry, increment each in order
+                            if multiple_files:
+                                name += "_{0}".format(increment)
+                                increment += 1
                             
-                            # If more than one SASentry, number each in order
-                            if multipleFiles:
-                                name += "_{0}".format(n)
-                                n += 1
-                            
-                            # Set the Data1D name and then parse the entry. The entry is appended to a list of entry values
-                            data1D.filename = name
-                            data1D.meta_data["loader"] = "CanSAS 1D"
-                            return_value, extras = self._parse_entry(entry, ns, data1D)
+                            # Set the Data1D name and then parse the entry. 
+                            # The entry is appended to a list of entry values
+                            data1d.filename = name
+                            data1d.meta_data["loader"] = "CanSAS 1D"
+                            return_value, extras = \
+                                self._parse_entry(entry, ns, data1d)
                             del extras[:]
                             
-                            #Final cleanup - Remove empty nodes, verify array sizes are correct
+                            # Final cleanup
+                            # Remove empty nodes, verify array sizes are correct
                             for error in self.errors:
                                 return_value.errors.append(error)
@@ -241,5 +247,4 @@
                                 numpy.trim_zeros(return_value.dxl)
                                 numpy.trim_zeros(return_value.dxw)
-                            
                             output.append(return_value)
                     else:
@@ -248,5 +253,5 @@
                 except:
                     # If the file does not match the schema, raise this error
-                    raise RuntimeError, "%s cannot be read \n" % xml
+                    raise RuntimeError, "%s cannot be read \increment" % xml
                 return output
         # Return a list of parsed entries that dataloader can manage
@@ -254,4 +259,12 @@
     
     def _create_unique_key(self, dictionary, name, i):
+        """
+        Create a unique key value for any dictionary to prevent overwriting
+        
+        
+        :param dictionary: A dictionary with any number of entries
+        :param name: The index of the item to be added to dictionary
+        :param i: The number to be appended to the name
+        """
         if dictionary.get(name) is not None:
             i += 1
@@ -261,5 +274,12 @@
         return name
     
-    def _iterate_namespace(self, ns):
+    def _iterate_namespace(self, namespace):
+        """
+        Method to iterate through a cansas constants tree based on a list of
+        names
+        
+        :param namespace: A list of names that match the tree structure of
+            cansas_constants
+        """
         # The current level to look through in cansas_constants.
         current_level = CANSAS_FORMAT.get("SASentry")
@@ -268,5 +288,5 @@
         ns_datatype = "content"
         ns_optional = True
-        for name in ns:
+        for name in namespace:
             if name != "SASentry":
                 current_level = current_level.get("children").get(name, "")
@@ -277,11 +297,25 @@
                 cl_units_optional = current_level.get("units_required", "")
                 # Where are how to store the variable for the given namespace
-                # The CANSAS_CONSTANTS tree is hierarchical, so is no value, inherit
+                # CANSAS_CONSTANTS tree is hierarchical, so is no value, inherit
                 ns_variable = cl_variable if cl_variable != "" else ns_variable
                 ns_datatype = cl_datatype if cl_datatype != "" else ns_datatype
-                ns_optional = cl_units_optional if cl_units_optional != ns_optional else ns_optional
+                ns_optional = cl_units_optional if cl_units_optional != \
+                                    ns_optional else ns_optional
         return current_level, ns_variable, ns_datatype, ns_optional
     
-    def _unit_conversion(self, new_current_level, attr, data1D, node_value, optional = True):
+    
+    def _unit_conversion(self, new_current_level, attr, data1d, \
+                                    node_value, optional = True):
+        """
+        A unit converter method used to convert the data included in the file
+        to the default units listed in data_info
+        
+        :param new_current_level: cansas_constants level as returned by 
+            _iterate_namespace
+        :param attr: The attributes of the node
+        :param data1d: Where the values will be saved
+        :param node_value: The value of the current dom node
+        :param optional: Boolean that says if the units are required
+        """
         value_unit = ''
         if 'unit' in attr and new_current_level.get('unit') is not None:
@@ -291,17 +325,18 @@
                 default_unit = None
                 unitname = new_current_level.get("unit")
-                exec "default_unit = data1D.{0}".format(unitname)
+                exec "default_unit = data1d.{0}".format(unitname)
                 local_unit = attr['unit']
-                if local_unit.lower() != default_unit.lower() and local_unit is not None\
-                    and local_unit.lower() != "none" and default_unit is not None:
+                if local_unit.lower() != default_unit.lower() and \
+                    local_unit is not None and local_unit.lower() != "none" and\
+                     default_unit is not None:
                     if HAS_CONVERTER == True:
                         try:
                             data_conv_q = Converter(attr['unit'])
                             value_unit = default_unit
-                            exec "node_value = data_conv_q(node_value, units=data1D.{0})".format(unitname)
+                            exec "node_value = data_conv_q(node_value, units=data1d.{0})".format(unitname)
                         except:
                             err_msg = "CanSAS reader: could not convert "
                             err_msg += "Q unit {0}; ".format(local_unit)
-                            intermediate = "err_msg += \"expecting [{1}]  {2}\".format(data1D.{0}, sys.exc_info()[1])".format(unitname, "{0}", "{1}")
+                            intermediate = "err_msg += \"expecting [{1}]  {2}\".format(data1d.{0}, sys.exc_info()[1])".format(unitname, "{0}", "{1}")
                             exec intermediate
                             self.errors.append(err_msg)
@@ -325,5 +360,5 @@
                 err_msg = "CanSAS reader: could not convert "
                 err_msg += "Q unit [%s]; " % attr['unit'],
-                exec "err_msg += \"expecting [%s]\n  %s\" % (data1D.{0}, sys.exc_info()[1])".format(unitname)
+                exec "err_msg += \"expecting [%s]\n  %s\" % (data1d.{0}, sys.exc_info()[1])".format(unitname)
                 self.errors.append(err_msg)
                 if optional:
@@ -336,5 +371,5 @@
         return node_value, value_unit
     
-    def _parse_entry(self, dom, ns, data1D, extras = []):
+    def _parse_entry(self, dom, ns, data1d, extras = []):
         """
         Parse a SASEntry - new recursive method for parsing the dom of
@@ -344,9 +379,12 @@
         :param dom: dom object with a namespace base of ns
         :param ns: A list of element names that lead up to the dom object
-        :param data1D: The data1D object that will be modified
+        :param data1d: The data1d object that will be modified
+        :param extras: Any values that should go into meta_data when data1d
+            is not a Data1D object
         """
          
         # A portion of every namespace entry
-        base_ns = "{0}{1}{2}".format("{", CANSAS_NS.get(self.cansasVersion).get("ns"), "}")
+        base_ns = "{0}{1}{2}".format("{", \
+                            CANSAS_NS.get(self.cansas_version).get("ns"), "}")
         unit = ''
         
@@ -361,28 +399,33 @@
                 
                 # Look for special cases
-                save_data1D = data1D
+                save_data1d = data1d
                 if tagname == "SASdetector":
-                    data1D = Detector()
+                    data1d = Detector()
                 elif tagname == "SAScollimation":
-                    data1D = Collimation()
+                    data1d = Collimation()
+                elif tagname == "SAStransmission_spectrum":
+                    data1d = TransmissionSpectrum()
                 elif tagname == "SASprocess":
-                    data1D = Process()
+                    data1d = Process()
                     for child in node:
                         if child.tag.replace(base_ns, "") == "term":
                             term_attr = {}
                             for attr in child.keys():
-                                term_attr[attr] = ' '.join(child.get(attr).split())
+                                term_attr[attr] = \
+                                    ' '.join(child.get(attr).split())
                             if child.text is not None:
-                                term_attr['value'] = ' '.join(child.text.split())
-                            data1D.term.append(term_attr)
+                                term_attr['value'] = \
+                                    ' '.join(child.text.split())
+                            data1d.term.append(term_attr)
                 elif tagname == "aperture":
-                    data1D = Aperture()
+                    data1d = Aperture()
                 
                 # Get where to store content
-                new_current_level, ns_variable, ns_datatype, optional = self._iterate_namespace(ns)
+                new_current_level, ns_var, ns_datatype, \
+                                    optional = self._iterate_namespace(ns)
                 # If the element is a child element, recurse
                 if node.getchildren() is not None:
                     # Returned value is new Data1D object with all previous and new values in it.
-                    data1D, extras = self._parse_entry(node, ns, data1D, extras)
+                    data1d, extras = self._parse_entry(node, ns, data1d, extras)
                     
                 #Get the information from the node
@@ -396,27 +439,30 @@
                 if ns_datatype == "float":
                     # If an empty value is given, store as zero.
-                    if node_value is None or node_value.isspace() or node_value.lower() == "nan":
+                    if node_value is None or node_value.isspace() \
+                                            or node_value.lower() == "nan":
                         node_value = "0.0"
-                    node_value, unit = self._unit_conversion(new_current_level, attr, data1D, node_value, optional)
+                    node_value, unit = self._unit_conversion(new_current_level,\
+                                             attr, data1d, node_value, optional)
                     
                 # If appending to a dictionary (meta_data | run_name), name sure the key is unique
-                if ns_variable == "{0}.meta_data[\"{2}\"] = \"{1}\"":
-                    # If we are within a Process, Detector, Collimation or Aperture instance, pull out old data1D
-                    tagname = self._create_unique_key(data1D.meta_data, tagname, 0)
-                    if isinstance(data1D, Data1D) == False:
-                        store_me = ns_variable.format("data1D", node_value, tagname)
+                if ns_var == "{0}.meta_data[\"{2}\"] = \"{1}\"":
+                    # If we are within a Process, Detector, Collimation or Aperture instance, pull out old data1d
+                    tagname = self._create_unique_key(data1d.meta_data, tagname, 0)
+                    if isinstance(data1d, Data1D) == False:
+                        store_me = ns_var.format("data1d", node_value, tagname)
                         extras.append(store_me)
-                        ns_variable = None
-                if ns_variable == "{0}.run_name[\"{2}\"] = \"{1}\"":
-                    tagname = self._create_unique_key(data1D.run_name, tagname, 0)
+                        ns_var = None
+                if ns_var == "{0}.run_name[\"{2}\"] = \"{1}\"":
+                    tagname = self._create_unique_key(data1d.run_name, tagname, 0)
                 
                 # Check for Data1D object and any extra commands to save
-                if isinstance(data1D, Data1D):
+                if isinstance(data1d, Data1D):
                     for item in extras:
                         exec item
                 # Don't bother saving empty information unless it is a float
-                if ns_variable is not None and node_value is not None and node_value.isspace() == False:
+                if ns_var is not None and node_value is not None and \
+                            node_value.isspace() == False:
                     # Format a string and then execute it.
-                    store_me = ns_variable.format("data1D", node_value, tagname)
+                    store_me = ns_var.format("data1d", node_value, tagname)
                     exec store_me
                 # Get attributes and process them
@@ -430,5 +476,6 @@
                             else:
                                 attrib_value = node.attrib[key]
-                            store_attr = attrib_variable.format("data1D", attrib_value, key)
+                            store_attr = attrib_variable.format("data1d", \
+                                                            attrib_value, key)
                             exec store_attr
                         except AttributeError as e:
@@ -441,20 +488,23 @@
                 print(e, exc_type, fname, exc_tb.tb_lineno, tagname, exc_obj)
             finally:
-                # Save special cases in original data1D object and then restore the data1D
+                # Save special cases in original data1d object
+                # then restore the data1d
                 if tagname_original == "SASdetector":
-                    save_data1D.detector.append(data1D)
+                    save_data1d.detector.append(data1d)
                 elif tagname_original == "SAScollimation":
-                    save_data1D.collimation.append(data1D)
+                    save_data1d.collimation.append(data1d)
+                elif tagname == "SAStransmission_spectrum":
+                    save_data1d.trans_spectrum.append(data1d)
                 elif tagname_original == "SASprocess":
-                    save_data1D.process.append(data1D)
+                    save_data1d.process.append(data1d)
                 elif tagname_original == "aperture":
-                    save_data1D.aperture.append(data1D)
+                    save_data1d.aperture.append(data1d)
                 else:
-                    save_data1D = data1D
-                data1D = save_data1D
+                    save_data1d = data1d
+                data1d = save_data1d
                 # Remove tagname from ns to restore original base
                 ns.remove(tagname_original)
         
-        return data1D, extras
+        return data1d, extras
         
     def _to_xml_doc(self, datainfo):
@@ -468,8 +518,8 @@
             raise RuntimeError, "The cansas writer expects a Data1D instance"
         
-        ns = CANSAS_NS.get(self.cansasVersion).get("ns")
+        ns = CANSAS_NS.get(self.cansas_version).get("ns")
         doc = xml.dom.minidom.Document()
         main_node = doc.createElement("SASroot")
-        main_node.setAttribute("version", self.cansasVersion)
+        main_node.setAttribute("version", self.cansas_version)
         main_node.setAttribute("xmlns", ns)
         main_node.setAttribute("xmlns:xsi",
@@ -502,32 +552,34 @@
                 write_node(doc, pt, "I", datainfo.y[i],
                             {'unit': datainfo.y_unit})
-            if datainfo.dy != None and len(datainfo.dy) >= i:
+            if datainfo.dy != None and len(datainfo.dy) > i:
                 write_node(doc, pt, "Idev", datainfo.dy[i],
                             {'unit': datainfo.y_unit})
-            if datainfo.dx != None and len(datainfo.dx) >= i:
+            if datainfo.dx != None and len(datainfo.dx) > i:
                 write_node(doc, pt, "Qdev", datainfo.dx[i],
                             {'unit': datainfo.x_unit})
-            if datainfo.dxw != None and len(datainfo.dxw) >= i:
+            if datainfo.dxw != None and len(datainfo.dxw) > i:
                 write_node(doc, pt, "dQw", datainfo.dxw[i],
                             {'unit': datainfo.x_unit})
-            if datainfo.dxl != None and len(datainfo.dxl) >= i:
+            if datainfo.dxl != None and len(datainfo.dxl) > i:
                 write_node(doc, pt, "dQl", datainfo.dxl[i],
                             {'unit': datainfo.x_unit})
 
         # Transmission Spectrum Info
-        if len(datainfo.trans_spectrum.wavelength) > 0:
+        for i in range(len(datainfo.trans_spectrum)):
+            spectrum = datainfo.trans_spectrum[i]
             node = doc.createElement("SAStransmission_spectrum")
             entry_node.appendChild(node)
-            for i in range(len(datainfo.trans_spectrum.wavelength)):
+            for i in range(len(spectrum.wavelength)):
                 pt = doc.createElement("Tdata")
                 node.appendChild(pt)
-                write_node(doc, pt, "Lambda", datainfo.trans_spectrum.wavelength[i], 
-                           {'unit': datainfo.trans_spectrum.wavelength_unit})
-                write_node(doc, pt, "T", datainfo.trans_spectrum.transmission[i], 
-                           {'unit': datainfo.trans_spectrum.transmission_unit})
-                if datainfo.trans_spectrum.transmission_deviation != None \
-                and len(datainfo.trans_spectrum.transmission_deviation) >= i:
-                    write_node(doc, pt, "Tdev", datainfo.trans_spectrum.transmission_deviation[i], 
-                               {'unit': datainfo.trans_spectrum.transmission_deviation_unit})
+                write_node(doc, pt, "Lambda", spectrum.wavelength[i], 
+                           {'unit': spectrum.wavelength_unit})
+                write_node(doc, pt, "T", spectrum.transmission[i], 
+                           {'unit': spectrum.transmission_unit})
+                if spectrum.transmission_deviation != None \
+                and len(spectrum.transmission_deviation) >= i:
+                    write_node(doc, pt, "Tdev", \
+                               spectrum.transmission_deviation[i], \
+                               {'unit': spectrum.transmission_deviation_unit})
 
         # Sample info
Index: src/sans/dataloader/readers/xml_reader.py
===================================================================
--- src/sans/dataloader/readers/xml_reader.py	(revision 17a25d48c622dfa40686483f011c736f44b7ffe7)
+++ src/sans/dataloader/readers/xml_reader.py	(revision 76cd1aeb8047424a5dc9e1d0e5c3eaa0f17c3bb4)
@@ -17,4 +17,10 @@
 
 class XMLreader():
+    
+    xml = None
+    xmldoc = None
+    xmlroot = None
+    schema = None
+    schemadoc = None
     
     def __init__(self, xml = None, schema = None, root = None):
@@ -47,6 +53,7 @@
             self.xmlroot = self.xmldoc.getroot()
         except Exception:
-            ##!TODO: raise exception if no xml is passed to this function
-            print "No xml file was found!"
+            self.xml = None
+            self.xmldoc = None
+            self.xmlroot = None
     
     def setSchema(self, schema):
@@ -55,6 +62,6 @@
             self.schemadoc = etree.parse(self.schema, parser = parser)
         except Exception:
-            ##!TODO: raise exception if no schema is passed to this function
-            print "No schema file was found!"
+            self.schema = None
+            self.schemadoc = None
     
     def validateXML(self):
