~strainanalyser/strainanalyser/trunk

« back to all changes in this revision

Viewing changes to strainanalyser/datahandling.py

  • Committer: Malcolm Scott
  • Date: 2010-10-18 04:02:58 UTC
  • Revision ID: launchpad@malc.org.uk-20101018040258-bz6ch5qbrfgke87a
Correctly handle negative temperature dataset shift

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
                                                self.temperature_dataset.straindata]
194
194
                                        )[:self.temperature_dataset.len]
195
195
                        else:
196
 
                                # chop some data points off the near end
197
 
                                temperature_data_aligned = self.temperature_dataset.straindata[shift:]
 
196
                                # chop some data points off the near end (and add some filler points at the far end)
 
197
                                temperature_data_aligned = numpy.ma.concatenate(
 
198
                                                [self.temperature_dataset.straindata[-shift:],
 
199
                                                numpy.ma.masked_all(-shift, int)]
 
200
                                        )
198
201
 
199
202
                        assert(len(temperature_data_aligned) == len(self.strain_dataset.straindata))
200
203