Index: sodar/trunk/sodar/rawData.py =================================================================== --- sodar/trunk/sodar/rawData.py (revision 120) +++ sodar/trunk/sodar/rawData.py (revision 272) @@ -137,9 +137,14 @@ def __getitem__(self, index): - """Index Sample by body attribute.""" + """Index Sample by body or header attribute.""" try: return self.body[index] except TypeError: # sample.body may not exist raise IndexError('Sample index out of range') + except IndexError: # sample.body out of range + try: + return self.header[index] + except KeyError: # sample.header may not exist + raise IndexError('Sample index out of range') def data(self): @@ -218,5 +223,5 @@ continue return altitude - raise IndexError('Body index, out of range') + raise IndexError('Body index out of range') def data(self):