IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2010, 2:59:09 PM (16 years ago)
Author:
Paul Price
Message:

Merging trunk in advance of reintegrating into trunk.

Location:
branches/pap
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/Ohana

  • branches/pap/Ohana/src/addstar/test

    • Property svn:ignore
      •  

        old new  
         1test.cmf
        12test.1.cmf
        23test.2.cmf
        34test.in.txt
        45catdir.test
         6catdir.test1
         7catdir.test2
         8catdir.test3
        59.dvo
        610relphot.airmass.png
  • branches/pap/Ohana/src/addstar/test/dvomerge.dvo

    r27435 r28484  
    3030  exec rsync -auc catdir.test2/ catdir.test3/
    3131
     32  date -var t1 -seconds -reftime 1276000000
    3233  exec dvomerge catdir.test1 into catdir.test3
     34  date -var t2 -seconds -reftime 1276000000
     35  echo "merge time: {$t2 - $t1}"
    3336
    3437  catdir catdir.test3
     
    105108end
    106109
    107 # create 2 populated catdirs, each with a couple of cmf files
    108 macro test.dvomerge.create
    109 
    110   tapPLAN 21
     110# create 1 populated catdir, merge into currently non-existent catdir
     111macro test.dvomerge.update.new
     112
     113  tapPLAN 51
     114
     115  exec rm -rf catdir.test1
     116  exec rm -rf catdir.test2
     117
     118  $RA = 10.0
     119  $DEC = 20.0
     120
     121  mkinput
     122  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC
     123  exec addstar -D CATDIR catdir.test1 -D CAMERA simtest test.cmf
     124
     125  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 02:00:00 -radec $RA $DEC
     126  exec addstar -D CATDIR catdir.test1 -D CAMERA simtest test.cmf
     127
     128  date -var t1 -seconds -reftime 1276000000
     129  exec dvomerge catdir.test1 into catdir.test2
     130  date -var t2 -seconds -reftime 1276000000
     131  echo "merge time: {$t2 - $t1}"
     132
     133  catdir catdir.test2
     134  skyregion {$RA-1} {$RA+1} {$DEC-1} {$DEC+1}
     135  mextract ra dec mag
     136  create n 0 ra[]
     137  subset r0 = ra if (n % 2 == 0)
     138  subset r1 = ra if (n % 2 == 1)
     139
     140  catdir catdir.test1/
     141  mextract RA DEC MAG
     142  create N 0 RA[]
     143  subset R0 = RA if (N % 2 == 0)
     144  subset R1 = RA if (N % 2 == 1)
     145
     146  set dr0 = r0 - R0
     147  vstat -q dr0
     148  tapOK {abs($MEAN)  < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)"
     149  tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)"
     150
     151  set dr1 = r1 - R1
     152  vstat -q dr1
     153  tapOK {abs($MEAN)  < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)"
     154  tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)"
     155
     156  # check on updates to imageID
     157  catdir catdir.test3
     158  imextract imageID
     159  sort imageID
     160  tapOK {imageID[]  == 4} "image IDs exist"
     161  tapOK {imageID[0] == 1} "updated image IDs"
     162  tapOK {imageID[1] == 2} "updated image IDs"
     163
     164  catdir catdir.test2
     165  mextract imageID, time
     166  set id = imageID
     167  set t = time
     168  imextract imageID, time
     169
     170  for i 0 time[]
     171    subset T = t if (id == imageID[$i])
     172    set dT = T - time[$i]
     173    vstat -q dT
     174    tapOK {abs($MEAN)  < 0.00001} "time for measure ID $i (MEAN)"
     175    tapOK {abs($SIGMA) < 0.00001} "time for measure ID $i (SIGMA)"
     176  end
     177
     178  # exec rm test.in.txt test.cmf
     179  # exec rm -rf catdir.test1
     180  # exec rm -rf catdir.test2
     181  # exec rm -rf catdir.test3
     182
     183  tapDONE
     184end
     185
     186# create 2 populated catdirs, each with a couple of cmf files -- force some unmatched objects
     187macro test.dvomerge.update.extras
     188
     189  tapPLAN 51
    111190
    112191  exec rm -rf catdir.test1
     
    124203  exec addstar -D CATDIR catdir.test1 -D CAMERA simtest test.cmf
    125204
     205  # generate a few extra unmatched sources
     206  mkinput.extras
    126207  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 03:00:00 -radec $RA $DEC
    127208  exec addstar -D CATDIR catdir.test2 -D CAMERA simtest test.cmf
     
    130211  exec addstar -D CATDIR catdir.test2 -D CAMERA simtest test.cmf
    131212
    132   exec dvomerge catdir.test1 and catdir.test2 to catdir.test3
     213  exec rsync -auc catdir.test2/ catdir.test3/
     214
     215  exec dvomerge catdir.test1 into catdir.test3
    133216
    134217  catdir catdir.test3
     
    205288end
    206289
     290# create 2 populated catdirs, each with a couple of cmf files
     291macro test.dvomerge.create
     292
     293  tapPLAN 21
     294
     295  exec rm -rf catdir.test1
     296  exec rm -rf catdir.test2
     297  exec rm -rf catdir.test3
     298
     299  $RA = 10.0
     300  $DEC = 20.0
     301
     302  mkinput
     303  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC
     304  exec addstar -D CATDIR catdir.test1 -D CAMERA simtest test.cmf
     305
     306  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 02:00:00 -radec $RA $DEC
     307  exec addstar -D CATDIR catdir.test1 -D CAMERA simtest test.cmf
     308
     309  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 03:00:00 -radec $RA $DEC
     310  exec addstar -D CATDIR catdir.test2 -D CAMERA simtest test.cmf
     311
     312  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 04:00:00 -radec $RA $DEC
     313  exec addstar -D CATDIR catdir.test2 -D CAMERA simtest test.cmf
     314
     315  exec dvomerge catdir.test1 and catdir.test2 to catdir.test3
     316
     317  catdir catdir.test3
     318  skyregion {$RA-1} {$RA+1} {$DEC-1} {$DEC+1}
     319  mextract ra dec mag
     320  create n 0 ra[]
     321  subset r0 = ra if (n % 4 == 0)
     322  subset r1 = ra if (n % 4 == 1)
     323  subset r2 = ra if (n % 4 == 2)
     324  subset r3 = ra if (n % 4 == 3)
     325
     326  catdir catdir.test1/
     327  mextract RA DEC MAG
     328  create N 0 RA[]
     329  subset R0 = RA if (N % 2 == 0)
     330  subset R1 = RA if (N % 2 == 1)
     331
     332  set dr0 = r0 - R0
     333  vstat -q dr0
     334  tapOK {abs($MEAN)  < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)"
     335  tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)"
     336
     337  set dr1 = r1 - R1
     338  vstat -q dr1
     339  tapOK {abs($MEAN)  < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)"
     340  tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)"
     341
     342  catdir catdir.test2/
     343  mextract RA DEC MAG
     344  create N 0 RA[]
     345  subset R2 = RA if (N % 2 == 0)
     346  subset R3 = RA if (N % 2 == 1)
     347
     348  set dr2 = r2 - R2
     349  vstat -q dr2
     350  tapOK {abs($MEAN)  < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)"
     351  tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)"
     352
     353  set dr3 = r3 - R3
     354  vstat -q dr3
     355  tapOK {abs($MEAN)  < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)"
     356  tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)"
     357
     358  # check on updates to imageID
     359  catdir catdir.test3
     360  imextract imageID
     361  sort imageID
     362  tapOK {imageID[]  == 4} "image IDs exist"
     363  tapOK {imageID[0] == 1} "updated image IDs"
     364  tapOK {imageID[1] == 2} "updated image IDs"
     365  tapOK {imageID[2] == 3} "updated image IDs"
     366  tapOK {imageID[3] == 4} "updated image IDs"
     367
     368  catdir catdir.test3
     369  mextract imageID, time
     370  set id = imageID
     371  set t = time
     372  imextract imageID, time
     373
     374  for i 0 time[]
     375    subset T = t if (id == imageID[$i])
     376    set dT = T - time[$i]
     377    vstat -q dT
     378    tapOK {abs($MEAN)  < 0.00001} "time for measure ID $i (MEAN)"
     379    tapOK {abs($SIGMA) < 0.00001} "time for measure ID $i (SIGMA)"
     380  end
     381
     382  # exec rm test.in.txt test.cmf
     383  # exec rm -rf catdir.test1
     384  # exec rm -rf catdir.test2
     385  # exec rm -rf catdir.test3
     386
     387  tapDONE
     388end
     389
    207390# make a simple input file for mkcmf
    208391macro mkinput.alt
     
    225408  for i 10 1024 100
    226409    for j 10 1024 100
     410      fprintf " %4d %4d  %6.2f" $i $j {-15.0 + 2.5*($i + $j)/1000.0}
     411    end
     412  end
     413  output stdout
     414end
     415
     416# make a simple input file for mkcmf
     417macro mkinput.extras
     418  exec rm -f test.in.txt
     419
     420  output test.in.txt
     421  for i 10 1024 100
     422    for j 10 1024 100
     423      fprintf " %4d %4d  %6.2f" $i $j {-15.0 + 2.5*($i + $j)/1000.0}
     424    end
     425  end
     426  for i 20 1024 500
     427    for j 20 1024 500
    227428      fprintf " %4d %4d  %6.2f" $i $j {-15.0 + 2.5*($i + $j)/1000.0}
    228429    end
Note: See TracChangeset for help on using the changeset viewer.