iamlikeme / rainflow

Implementation of the rainflow-counting algorythm in Python
MIT License
105 stars 34 forks source link

Returning Peaks and Valleys intermediate steps. #5

Closed seahawks8 closed 7 years ago

seahawks8 commented 7 years ago

I need to pull the Peaks and valleys for my analysis, just to review.

Edit - I pasted code earlier, but it was not correct. just writing the correct one.

seahawks8 commented 7 years ago

my apologies, this was easily solved by doing the following.

`

   self.peaks_valleys = array([x for x in rf.reversals(
        self.pressure_data)])

    # append last record
    self.peaks_valleys = append(self.peaks_valleys, self.pressure_data[-1])

    # insert first record
    self.peaks_valleys = insert(self.peaks_valleys,0, self.pressure_data[
        0])

`