All of c come from a CT or similar equipment.
a and b come from a instrument that are put into the CT.

The CT gives exposure and in c come the times - and lots of other
information when the exposure is made.

a and b come from the instrument - a probe in a phantom - measure doses and
such and also register time.

I have been making program to find the place where the probe was on the
image.

I have gathered the information from different files I get.

I may not be getting the correct files, files may be missing.

I know a,b and c came from the same session.

The person did some exposures before the probe was connected so some values
are missing.

It is quite obvious that the clock in the probe (a and b) and in the CT (c)
are not in sync.
The time difference is ca 18 minutes and 56 seconds as you can see doing the
calculations.

I have a gap at the beginning introducing d to fill the gap.
The gap could have been in the middle.
I have no way of knowing in advance.

I am trying to make a reasonable guess which times fit so I can match the
exposure doses gathered from the probe (a and b) and not having to do it
manually.

The time difference is not exactly 18 minutes and 56 seconds between all
corresponding lines in c and the lines in a and b. I do not know in advance
if I do have a time difference and I do not know which way the difference is
going to be.

It is fair to assume all the times in c to be sorted.
It is also fair to assume the the individual files a and b are sorted.

I have to find where lines in a matches lines in c
I have to find where lines in b matches lines in c

The time difference in all cases should be roughly the same.

I guess if I get a file - lets call it e - I would have to try to be able to
make an educated guess that I could not find any match and it would be from
some other test.

Hope that explains the task at hand fairly well.

Up to now I have done this part manually but would like to be able to see if
I could get this to work.
I have never tried to match something like this with a program before.
Most of the time there is an exact match or there is not.
Not such a fuzzy match of matching roughly.

Obviously I have to match the dates as well and both the formats of the date
and the time were different.
I also added 000 in both a and b
If I am not lucky the test person could be sending in files from different
tests.
I am working on what requirements the test persons are supposed to have.
Try to exclude complete morons somehow politely.

2007/3/29, Devon McCormick <[EMAIL PROTECTED]>:

Gosi - I don't understand what you're trying to do here.
Are these timestamps that need to be matched?  If so, it looks like
all of "c" comes after everything in "a" and "b".

   gv=. /:c,a,b
   gv<#c
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Also, is there any reason to complicate the problem by having a separate
"a"
and "b"?
Aren't you dealing with ab=. a,b versus c?

Maybe I need either more context or a simpler version of this.

On 3/29/07, Björn Helgason <[EMAIL PROTECTED]> wrote:
>
> Does anyone have a good way of matching times?
>
> Here I have an example they happen to be somewhat in order.
> c contains 35 lines that need to be matched with a and b.
> There is an excess of 5 lines in c compared to a+b so d contains 5
> dummies.
>
> The times need not be sorted like this and they may be missing in either
> direction.
>
> The task is to get a best match which gives the least time difference
and
> get the indexes for c that give the best match for a+b
>
> There are a lot of fields in each line but only connection between them
is
> the time field.
> In this example the time difference between the equipment is roughly 19
> minutes
>
>
>
> NB. -----------------head
>
> a=:".;._2 (0 : 0)
> 11 00 29 000
> 11 00 38 000
> 11 00 44 000
> 11 00 52 000
> 11 01 00 000
> 11 03 20 000
> 11 03 28 000
> 11 03 35 000
> 11 03 43 000
> 11 03 51 000
> 11 05 09 000
> 11 05 17 000
> 11 05 25 000
> 11 05 32 000
> 11 05 40 000
> )
>
> NB. -------------------- abdomen
>
> b=:".;._2 (0 : 0)
> 11 11 04 000
> 11 11 11 000
> 11 11 19 000
> 11 11 27 000
> 11 11 34 000
> 11 12 46 000
> 11 12 54 000
> 11 13 02 000
> 11 13 10 000
> 11 13 17 000
> 11 14 36 000
> 11 14 44 000
> 11 14 52 000
> 11 15 00 000
> 11 15 07 000
> )
>
> NB. ----------------- dcm
>
> c=:".;._2 (0 : 0)
> 11 16 47 450
> 11 16 55 150
> 11 17 02 950
> 11 17 10 600
> 11 17 18 300
> 11 19 25 350
> 11 19 33 200
> 11 19 41 000
> 11 19 48 700
> 11 19 56 450
> 11 22 16 250
> 11 22 24 050
> 11 22 31 750
> 11 22 39 500
> 11 22 47 200
> 11 24 05 650
> 11 24 13 450
> 11 24 21 150
> 11 24 28 850
> 11 24 36 600
> 11 29 59 550
> 11 30 07 350
> 11 30 15 050
> 11 30 22 750
> 11 30 30 450
> 11 31 42 600
> 11 31 50 400
> 11 31 58 100
> 11 32 05 850
> 11 32 13 550
> 11 33 32 400
> 11 33 40 200
> 11 33 47 900
> 11 33 55 600
> 11 34 03 300
> )
>
> NB. ------------------ auka
> d=:".;._2 (0 : 0)
> 0 0 0 0
> 0 0 0 0
> 0 0 0 0
> 0 0 0 0
> 0 0 0 0
> )
>
> NB. ------------------- example calculations - the last one gives the
> correct lines hooked together
> c-a,b,d
> 24 60 60 1000 #:((24 60 60 1000 #.c)-24 60 60 1000 #.a,b,d)
>
> c-~a,b,d
> 24 60 60 1000 #:((24 60 60 1000 #.c)-~24 60 60 1000 #.a,b,d)
>
> c-d,a,b
> 24 60 60 1000 #:((24 60 60 1000 #.c)-24 60 60 1000 #.d,a,b)
>
>
>
>
> --
> Björn Helgason, Verkfræðingur
> Fugl&Fiskur ehf, Þerneyjarsund 23, Box 127
> 801 Grímsnes ,t-póst: [EMAIL PROTECTED]
> Skype: gosiminn, gsm: +3546985532
> Landslags og skrúðgarðagerð, gröfuþjónusta
> http://groups.google.com/group/J-Programming
>
>
> Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari
einfaldleikans
>
> góður kennari getur stigið á tær án þess að glansinn fari af skónum
>           /|_      .-----------------------------------.
>          ,'  .\  /  | Með léttri lund verður        |
>      ,--'    _,'   | Dagurinn í dag                     |
>     /       /       | Enn betri en gærdagurinn  |
>    (   -.  |        `-----------------------------------'
>    |     ) |        (\_ _/)
>   (`-.  '--.)       (='.'=)
>    `. )----'        (")_(")
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm




--
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf, Þerneyjarsund 23, Box 127
801 Grímsnes ,t-póst: [EMAIL PROTECTED]
Skype: gosiminn, gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
         /|_      .-----------------------------------.
        ,'  .\  /  | Með léttri lund verður        |
    ,--'    _,'   | Dagurinn í dag                     |
   /       /       | Enn betri en gærdagurinn  |
  (   -.  |        `-----------------------------------'
  |     ) |        (\_ _/)
 (`-.  '--.)       (='.'=)
  `. )----'        (")_(")
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to