Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > dealing with piecewise arrays

Reply
Thread Tools

dealing with piecewise arrays

 
 
Yaj Bhattacharya
Guest
Posts: n/a
 
      03-17-2009
I want to perform the following in Ruby, could someone please help
translate this pseudocode?

1. Read in a time series in a columnar format from an external file
(covered elsewhere in this forum, including for completeness)
given data triplets: time, value, error

2. Check for discontinuities in data:
if [time(i+1) - time(i)] > some_value, then
store this piece of triplet array and give
it a address (say piece_1)
continue reading until another discontinuity is
encountered
store the new piece of triplet array with
new address (piece_2)
until end of file

3. Write out each piece as a separate file with meaningful filenames
based on the time of the array above, so the file written for piece_1
would be called "time(i)_time(i+n).dat" where the time array is a
continuous array without gaps (no gaps greater than some_value deduced
in step 2).

Thanks in advance
Yaj



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multidimensional arrays and arrays of arrays Philipp Java 21 01-20-2009 08:33 AM
are there any "Piecewise Cubic Hermite Interpolating Polynomial" in python jitasi Python 1 03-04-2007 07:20 AM
piecewise function dilou VHDL 4 05-30-2006 06:02 PM
Piecewise-cubic lookup table generator Will Ware Python 0 11-21-2005 10:19 PM
Piecewise fetching using perl dbi JonL Perl Misc 1 02-12-2005 12:37 AM



Advertisments