00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 import os
00099 import time
00100 import regression_utility as tstutl
00101 import listing
00102 import datetime
00103
00104
00105 benchmarking = True
00106
00107
00108 export_asynchronously = True
00109
00110 checklistvis=True
00111
00112
00113
00114
00115 pathname=os.environ.get('CASAPATH').split()[0]
00116
00117
00118 fitsdata=pathname+'/data/regression/ngc5921/ngc5921.fits'
00119
00120
00121 testdir='ngc5921_regression'
00122
00123
00124 prefix=testdir+"/"+'ngc5921'
00125
00126
00127
00128 tstutl.maketestdir(testdir)
00129
00130 datestring = datetime.datetime.isoformat(datetime.datetime.today())
00131 outfile = 'ngc5921.' + datestring + '.log'
00132 n5921reglog = open(outfile, 'w')
00133
00134 def reportresults(redi):
00135 """
00136 Helper function to pretty print the results in redi and report whether
00137 they all passed. redi is a dict with format
00138 {test_name1: (pass/fail,
00139 (Optional) note,
00140 (Even more optional) quantitative difference),
00141 test_name2: (pass/fail,
00142 (Optional) note,
00143 (Even more optional) quantitative difference)}
00144 """
00145 passfail = {True: '* Passed', False: '* FAILED'}
00146 normalsevere = {True: 'NORMAL', False: 'SEVERE'}
00147 ok = True
00148
00149 for t in redi:
00150 tup = redi[t]
00151 msg = passfail[tup[0]] + ' ' + t + ' test'
00152 print >>n5921reglog, msg
00153 tstutl.note(msg, normalsevere[tup[0]])
00154 if len(tup) > 1:
00155 print >>n5921reglog, tup[1]
00156
00157 if not tup[0]:
00158 ok = False
00159 if len(tup) > 2:
00160 tstutl.note(' ' + t + " difference: " + str(tup[2]),
00161 normalsevere[tup[0]])
00162 return ok
00163
00164 def listfailures(redi):
00165 """
00166 Helper function to summarize any failures in redi at the end.
00167 redi has the same format as in reportresults.
00168 """
00169 for t in redi:
00170 tup = redi[t]
00171 if not tup[0]:
00172 msg = t + " FAILED"
00173 if len(tup) > 2:
00174 msg += ":\n " + str(tup[1]) + "\n difference: " + str(tup[2])
00175 tstutl.note(msg, "SEVERE")
00176
00177
00178 if benchmarking:
00179 startTime = time.time()
00180 startProc = time.clock()
00181
00182 passedall = True
00183
00184
00185
00186
00187
00188
00189 print '--Import--'
00190
00191
00192 default('importuvfits')
00193
00194
00195 msfile = prefix + '.ms'
00196
00197
00198 fitsfile = fitsdata
00199 vis = msfile
00200 antnamescheme = 'new'
00201 importuvfits()
00202
00203
00204
00205
00206
00207 if benchmarking:
00208 importtime = time.time()
00209
00210
00211
00212
00213
00214
00215 print '--Listobs--'
00216
00217
00218
00219
00220
00221
00222 verbose = True
00223
00224 listobs()
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314 if benchmarking:
00315 listtime = time.time()
00316
00317
00318
00319
00320
00321
00322
00323 print '--Flag auto-correlations--'
00324
00325
00326 default(tflagdata)
00327 vis = msfile
00328 autocorr = True
00329 flagbackup = False
00330 tflagdata()
00331
00332
00333 if benchmarking:
00334 flagtime = time.time()
00335
00336
00337
00338
00339
00340
00341 print '--Setjy--'
00342 default('setjy')
00343
00344 vis = msfile
00345
00346
00347
00348
00349
00350
00351 field = '1331+305*'
00352
00353
00354
00355
00356 modimage = ''
00357
00358
00359 standard='Perley-Taylor 99'
00360
00361 scalebychan=False
00362
00363 usescratch=False
00364
00365 setjy()
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376 if benchmarking:
00377 setjytime = time.time()
00378
00379
00380
00381
00382
00383
00384 print '--Bandpass--'
00385 default('bandpass')
00386
00387
00388
00389
00390
00391
00392 vis = msfile
00393
00394
00395 btable = prefix + '.bcal'
00396 caltable = btable
00397
00398
00399 gaintable = ''
00400 gainfield = ''
00401 interp = ''
00402
00403
00404 field = '0'
00405
00406 spw = ''
00407
00408 selectdata = False
00409
00410
00411
00412
00413 gaincurve = False
00414 opacity = 0.0
00415
00416
00417
00418 bandtype = 'B'
00419
00420
00421 solint = 'inf'
00422 combine='scan'
00423
00424
00425 refant = 'VA15'
00426
00427 bandpass()
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444 if benchmarking:
00445 bptime = time.time()
00446
00447
00448
00449
00450
00451
00452 print '--Gaincal--'
00453 default('gaincal')
00454
00455
00456
00457
00458 vis = msfile
00459
00460
00461 gtable = prefix + '.gcal'
00462 caltable = gtable
00463
00464
00465
00466
00467 gaintable = btable
00468 gainfield = '0'
00469
00470
00471 interp = 'nearest'
00472
00473
00474 field = '0,1'
00475
00476
00477
00478
00479
00480 spw = '0:6~56'
00481
00482
00483 selectdata = False
00484
00485
00486
00487
00488 gaincurve = False
00489 opacity = 0.0
00490
00491
00492 gaintype = 'G'
00493 solint = 'inf'
00494 combine=''
00495 calmode = 'ap'
00496
00497
00498 minsnr = 1.0
00499
00500
00501 refant = '15'
00502
00503 gaincal()
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519 if benchmarking:
00520 gaintime = time.time()
00521
00522
00523
00524
00525
00526 print '--Listcal--'
00527 listcalOut = prefix + '.listcal.out'
00528
00529 default('listcal')
00530 vis = msfile
00531 caltable = gtable
00532 listfile = listcalOut
00533 listcal()
00534
00535
00536 if benchmarking:
00537 listcaltime = time.time()
00538
00539
00540
00541 os.system('mv ' + listcalOut + ' ' + listcalOut + '.tmp')
00542 os.system('tail -n +2 ' + listcalOut + '.tmp > ' + listcalOut)
00543 os.system('rm -f ' + listcalOut + '.tmp')
00544
00545
00546 print "Comparing listcal output with standard..."
00547 standardOut = pathname+'/data/regression/ngc5921/listcal.default.out'
00548 listcalresults = {}
00549 try:
00550 print " 1. Checking that metadata agree..."
00551 listcalresults['listcal metadata'] = (listing.diffMetadata(listcalOut,
00552 standardOut,
00553 prefix=prefix + ".listcal"),)
00554
00555 print " 2. Checking that data agree to within allowed imprecision..."
00556 precision = '0.003'
00557 print " Allowed visibility imprecision is " + precision
00558 listcalresults['listcal data'] = (listing.diffAmpPhsFloat(listcalOut,
00559 standardOut,
00560 prefix = prefix+".listcal",
00561 precision = precision),)
00562 passedall = reportresults(listcalresults) and passedall
00563 except Exception, e:
00564 print "Error", e, "checking listcal."
00565 raise e
00566
00567
00568
00569
00570
00571
00572 print '--Fluxscale--'
00573 default('fluxscale')
00574
00575 vis = msfile
00576
00577
00578 ftable = prefix + '.fluxscale'
00579 fluxtable = ftable
00580
00581
00582 caltable = gtable
00583
00584
00585
00586
00587 reference = '1331*'
00588
00589
00590 transfer = '1445*'
00591
00592
00593 incremental=True
00594
00595 fluxscale()
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606 if benchmarking:
00607 fstime = time.time()
00608
00609
00610
00611
00612
00613
00614
00615 print '--ApplyCal--'
00616 default('applycal')
00617
00618 vis = msfile
00619
00620
00621
00622
00623
00624
00625
00626 gaintable = [ftable,gtable,btable]
00627
00628
00629
00630
00631 gainfield = ['nearest','nearest','0']
00632
00633
00634
00635 interp = ['linear', 'linear','nearest']
00636
00637
00638 spwmap = []
00639
00640
00641 spw = ''
00642 selectdata = False
00643
00644
00645 gaincurve = False
00646 opacity = 0.0
00647
00648
00649 field = ''
00650
00651 applycal()
00652
00653
00654 if benchmarking:
00655 correcttime = time.time()
00656
00657
00658
00659
00660
00661
00662 print '--Split 1445+099 Data--'
00663 default('split')
00664
00665 vis = msfile
00666
00667
00668
00669
00670 calsplitms = prefix + '.cal.split.ms'
00671 outputvis = calsplitms
00672
00673
00674 field = '1445*'
00675 spw = ''
00676
00677
00678 datacolumn = 'corrected'
00679
00680 split()
00681
00682
00683 if benchmarking:
00684 splitcaltime = time.time()
00685
00686
00687
00688
00689 print '--Split NGC5921 Data--'
00690
00691 splitms = prefix + '.src.split.ms'
00692 outputvis = splitms
00693
00694
00695 field = 'N5921*'
00696
00697 split()
00698
00699
00700 if benchmarking:
00701 splitsrctime = time.time()
00702
00703
00704
00705
00706
00707
00708
00709 print '--Export UVFITS--'
00710 default('exportuvfits')
00711
00712 srcuvfits = prefix + '.split.uvfits'
00713
00714 vis = splitms
00715 fitsfile = srcuvfits
00716
00717
00718
00719 datacolumn = 'data'
00720
00721
00722
00723 multisource = True
00724
00725
00726
00727
00728 async = export_asynchronously
00729
00730 async_exportuvfits_id = exportuvfits()
00731 print "async_exportuvfits_id =", async_exportuvfits_id
00732
00733
00734
00735
00736 if benchmarking:
00737 exportuvfitstime = time.time()
00738
00739
00740
00741
00742
00743
00744
00745 print '--UV Continuum Subtract--'
00746 default('uvcontsub')
00747
00748 vis = msfile
00749
00750
00751 field = 'N5921*'
00752
00753
00754 fitspw='0:4~6;50~59'
00755
00756
00757 spw = '0'
00758
00759
00760 solint = 'int'
00761
00762
00763 fitorder = 0
00764
00765
00766 want_cont = True
00767
00768 uvcontsub()
00769
00770
00771
00772
00773
00774 srcsplitms = msfile + '.contsub'
00775
00776
00777 if benchmarking:
00778 contsubtime = time.time()
00779
00780 if checklistvis:
00781
00782
00783
00784 print '--Listvis--'
00785 listvisOut = prefix + '.listvis.out'
00786
00787 default('listvis')
00788
00789
00790
00791
00792
00793 print "Listing corrected data."
00794 print "Reducing output by selecting only baseline 3&4."
00795
00796 listvis(vis=srcsplitms,datacolumn='data',selectdata=True,antenna='VA03&VA04',listfile=listvisOut)
00797
00798
00799 if benchmarking:
00800 listvistime = time.time()
00801
00802
00803 print "Comparing continuum subtracted listvis output with repository standard..."
00804 standardOut = pathname+'/data/regression/ngc5921/listvis.ant34.contsub.out'
00805
00806
00807 print " Checking that metadata agree and that data agree to within allowed imprecision..."
00808 precision = '0.200'
00809 print " Allowed visibility imprecision is ", precision
00810 listvisresults = {}
00811 try:
00812 listvisresults['listvis metadata'] = (listing.diffMetadata(listvisOut,
00813 standardOut,
00814 prefix=prefix + ".listvis"),)
00815 listvisresults['listvis data'] = (listing.diffAmpPhsFloat(listvisOut,
00816 standardOut,
00817 prefix=prefix + ".listvis",
00818 precision=precision),)
00819 passedall = reportresults(listvisresults) and passedall
00820 except Exception, e:
00821 print "Error", e, "checking listvis."
00822 raise e
00823
00824
00825
00826
00827
00828
00829 print '--Clean--'
00830 default('clean')
00831
00832
00833 vis = srcsplitms
00834
00835
00836 imname = prefix + '.clean'
00837 imagename = imname
00838
00839
00840 mode = 'channel'
00841 nchan = 46
00842 start = 5
00843 width = 1
00844
00845
00846 field = '0'
00847 spw = ''
00848
00849
00850 gain = 0.1
00851
00852
00853
00854
00855
00856 psfmode = 'clark'
00857 imagermode = ''
00858
00859
00860
00861
00862
00863
00864
00865
00866 cell = [15.,15.]
00867
00868
00869 niter = 6000
00870
00871
00872 threshold=8.0
00873
00874
00875
00876 weighting = 'briggs'
00877
00878 robust = 0.5
00879
00880
00881 mask = ''
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891 usescratch=False
00892
00893 clean()
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906 clnimage = imname+'.image'
00907
00908
00909 if benchmarking:
00910 cleantime = time.time()
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925 print '--Final Export CLEAN FITS--'
00926 default('exportfits')
00927
00928 clnfits = prefix + '.clean.fits'
00929
00930 imagename = clnimage
00931 fitsimage = clnfits
00932
00933
00934
00935
00936 async = export_asynchronously
00937
00938 async_clean_id = exportfits()
00939
00940
00941
00942 if benchmarking:
00943 exportimtime = time.time()
00944
00945
00946
00947
00948
00949
00950 print '--Imstat--'
00951 default('imstat')
00952
00953 imagename = clnimage
00954
00955 cubestats =imstat()
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965 print '--ImMoments--'
00966 default('immoments')
00967
00968 imagename = clnimage
00969
00970
00971 moments = [0,1]
00972
00973
00974
00975 excludepix = [-100,0.009]
00976
00977
00978 chans = ''
00979
00980
00981 momfile = prefix + '.moments'
00982 outfile = momfile
00983
00984 immoments()
00985
00986 momzeroimage = momfile + '.integrated'
00987 momoneimage = momfile + '.weighted_coord'
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999 print '--Imstat--'
01000 default('imstat')
01001
01002 imagename = momzeroimage
01003 momzerostats = imstat()
01004
01005 imagename = momoneimage
01006 momonestats = imstat()
01007
01008
01009
01010
01011
01012
01013
01014
01015 print ""
01016 print ' NGC5921 results '
01017 print ' =============== '
01018
01019 print ''
01020 print ' --Regression Tests--'
01021 print ''
01022
01023
01024
01025
01026
01027 ms.open(calsplitms)
01028 thistest_cal = max(ms.range(["amplitude"]).get('amplitude'))
01029 ms.close()
01030 oldtest_cal = 34.0338668823
01031 print ' Cal Max amplitude should be ',oldtest_cal
01032 print ' Found : Max = ',thistest_cal
01033 diff_cal = abs((oldtest_cal-thistest_cal)/oldtest_cal)
01034 print ' Difference (fractional) = ',diff_cal
01035
01036 print ''
01037
01038 ms.open(srcsplitms)
01039 thistest_src = max(ms.range(["amplitude"]).get('amplitude'))
01040 ms.close()
01041
01042 oldtest_src = 46.2060050964
01043 print ' Src Max amplitude should be ',oldtest_src
01044 print ' Found : Max = ',thistest_src
01045 diff_src = abs((oldtest_src-thistest_src)/oldtest_src)
01046 print ' Difference (fractional) = ',diff_src
01047
01048
01049
01050
01051 print ''
01052
01053
01054 thistest_immax=cubestats['max'][0]
01055 oldtest_immax = 0.052414759993553162
01056 print ' Clean image max should be ',oldtest_immax
01057 print ' Found : Image Max = ',thistest_immax
01058 diff_immax = abs((oldtest_immax-thistest_immax)/oldtest_immax)
01059 print ' Difference (fractional) = ',diff_immax
01060
01061 print ''
01062
01063 thistest_imrms=cubestats['rms'][0]
01064 oldtest_imrms = 0.0020064469
01065 print ' Clean image rms should be ',oldtest_imrms
01066 print ' Found : Image rms = ',thistest_imrms
01067 diff_imrms = abs((oldtest_imrms-thistest_imrms)/oldtest_imrms)
01068 print ' Difference (fractional) = ',diff_imrms
01069
01070 print ''
01071
01072 thistest_momzeromax=momzerostats['max'][0]
01073 oldtest_momzeromax = 1.4868
01074 print ' Moment 0 image max should be ',oldtest_momzeromax
01075 print ' Found : Moment 0 Max = ',thistest_momzeromax
01076 diff_momzeromax = abs(1.0 - thistest_momzeromax / oldtest_momzeromax)
01077 print ' Difference (fractional) = ',diff_momzeromax
01078
01079 print ''
01080
01081 thistest_momoneavg=momonestats['mean'][0]
01082 oldtest_momoneavg = 1486.8473
01083 print ' Moment 1 image mean should be ',oldtest_momoneavg
01084 print ' Found : Moment 1 Mean = ',thistest_momoneavg
01085 diff_momoneavg = abs((oldtest_momoneavg-thistest_momoneavg)/oldtest_momoneavg)
01086 print ' Difference (fractional) = ',diff_momoneavg
01087
01088
01089
01090 if benchmarking:
01091 endProc = time.clock()
01092 endTime = time.time()
01093
01094
01095
01096
01097
01098 print ''
01099 print ' --Export Tests--'
01100 print ''
01101
01102
01103
01104 tstutl.note("Opening UVFITS file " + srcuvfits +
01105 " to verify its existence")
01106
01107 if export_asynchronously:
01108 while True:
01109 try:
01110 if tm.retrieve(async_exportuvfits_id):
01111 break
01112 else:
01113 time.sleep(1)
01114 except Exception, e:
01115 tstutl.note("Error checking whether exportuvfits finished.",
01116 "SEVERE")
01117 tstutl.note("async_exportuvfits_id was " + str(async_exportuvfits_id), "SEVERE")
01118 raise e
01119
01120 uvfitsexists=False
01121 if os.path.isfile(srcuvfits):
01122 uvfitsexists=True
01123
01124 diff_uvfits = 1.0
01125 if uvfitsexists:
01126 tstutl.note("Opening the UVFITS file", "NORMAL")
01127 try:
01128 ms.fromfits(prefix+".fromuvfits.ms", srcuvfits)
01129 ms.summary()
01130
01131 fitstest_src = max(ms.range(["amplitude"]).get('amplitude'))
01132 ms.close()
01133 tstutl.note("Verified that a valid UVFITS file was written")
01134 print ''
01135
01136
01137 print ' UVFITS Src Max amplitude should be ', thistest_src
01138 print ' Found : UVFITS Max = ', fitstest_src
01139 diff_uvfits = abs((fitstest_src - thistest_src) / thistest_src)
01140 print ' Difference (fractional) = ', diff_uvfits
01141 except Exception, e:
01142 tstutl.note("Failed to open UVFITS file because: "+e, "SEVERE")
01143 else:
01144 tstutl.note("Could not open the UVFITS file", "SEVERE")
01145
01146
01147
01148
01149 print ''
01150 tstutl.note("Opening FITS image file " + fitsimage +
01151 " to verify its existence")
01152
01153 if export_asynchronously:
01154 while True:
01155 if tm.retrieve(async_clean_id):
01156 break
01157 else:
01158 time.sleep(1)
01159
01160 fitsimageexists=False
01161 if os.path.isfile(fitsimage):
01162 fitsimageexists=True
01163
01164 diff_fitsmax = 1.0
01165 diff_fitsrms = 1.0
01166 if fitsimageexists:
01167 tstutl.note("Opening the FITS image", "NORMAL")
01168 try:
01169 default('imstat')
01170 imagename = fitsimage
01171 fitstats = imstat()
01172 tstutl.note("Verified that a valid FITS image file was written")
01173 print ''
01174
01175 fitstest_immax=fitstats['max'][0]
01176 print ' FITS image max should be ',thistest_immax
01177 print ' Found : FITS Image Max = ',fitstest_immax
01178 diff_fitsmax = abs((fitstest_immax-thistest_immax)/thistest_immax)
01179 print ' Difference (fractional) = ',diff_fitsmax
01180 print ''
01181
01182 fitstest_imrms=fitstats['rms'][0]
01183 print ' FITS image rms should be ',thistest_imrms
01184 print ' Found : FITS Image rms = ',fitstest_imrms
01185 diff_fitsrms = abs((fitstest_imrms-thistest_imrms)/thistest_imrms)
01186 print ' Difference (fractional) = ',diff_fitsrms
01187 except Exception, e:
01188 tstutl.note("Failed to open FITS image file because: "+e,"SEVERE")
01189 else:
01190 tstutl.note("Could not open the FITS image", "SEVERE")
01191
01192
01193
01194
01195 if not benchmarking:
01196 print ''
01197 print '--- Done ---'
01198 else:
01199 print >>n5921reglog,''
01200 print >>n5921reglog,''
01201 print >>n5921reglog,'********** Data Summary *********'
01202 print >>n5921reglog,'* Observer: TEST Project: *'
01203 print >>n5921reglog,'* Observation: VLA(28 antennas) *'
01204 print >>n5921reglog,'* Data records: 22653 Total integration time = 5280 seconds *'
01205 print >>n5921reglog,'* Observed from 09:19:00 to 10:47:00 *'
01206 print >>n5921reglog,'* Fields: 3 *'
01207 print >>n5921reglog,'* ID Name Right Ascension Declination Epoch *'
01208 print >>n5921reglog,'* 0 1331+30500002_013:31:08.29 +30.30.32.96 J2000 *'
01209 print >>n5921reglog,'* 1 1445+09900002_014:45:16.47 +09.58.36.07 J2000 *'
01210 print >>n5921reglog,'* 2 N5921_2 15:22:00.00 +05.04.00.00 J2000 *'
01211 print >>n5921reglog,'* Data descriptions: 1 (1 spectral windows and 1 polarization setups) *'
01212 print >>n5921reglog,'* ID #Chans Frame Ch1(MHz) Resoln(kHz) TotBW(kHz) Ref(MHz) Corrs *'
01213 print >>n5921reglog,'* 0 63 LSRK 1412.68608 24.4140625 1550.19688 1413.44902 RR LL *'
01214 print >>n5921reglog,'*********************************'
01215 print ""
01216 print >>n5921reglog,''
01217 print >>n5921reglog,'********* Export Tests***********'
01218 print >>n5921reglog,'* *'
01219
01220 exportresults = {'UVFITS existence': (uvfitsexists,),
01221 'FITS image existence': (fitsimageexists,)}
01222 if uvfitsexists:
01223 exportresults['UVFITS max'] = (diff_uvfits < 0.05,
01224 '* UVFITS MS max ' + str(fitstest_src), diff_uvfits)
01225
01226 if (fitsimageexists):
01227 exportresults['FITS image max'] = (diff_fitsmax < 0.05,
01228 '* FITS Image max ' + str(fitstest_immax),
01229 diff_fitsmax)
01230 exportresults['FITS image rms'] = (diff_fitsrms < 0.05,
01231 '* FITS Image rms ' + str(fitstest_imrms),
01232 diff_fitsrms)
01233 passedall = reportresults(exportresults) and passedall
01234
01235 print >>n5921reglog,''
01236 print >>n5921reglog,'********** Regression ***********'
01237 print >>n5921reglog,'* *'
01238 quantresults = {}
01239 quantresults['cal max amplitude'] = (diff_cal < 0.05,
01240 '* Cal max amp ' + str(thistest_cal), diff_cal)
01241 quantresults['src max amplitude'] = (diff_src < 0.05,
01242 '* Src max amp ' + str(thistest_src), diff_src)
01243 quantresults['image max'] = (diff_immax < 0.05,
01244 '* Image max amp ' + str(thistest_immax), diff_immax)
01245 quantresults['image rms'] = (diff_imrms < 0.05,
01246 '* Image rms ' + str(thistest_imrms), diff_imrms)
01247 passedall = reportresults(quantresults) and passedall
01248
01249 if passedall:
01250 regstate=True
01251 print >>n5921reglog,'---'
01252 print >>n5921reglog,'Passed Regression test for NGC5921'
01253 print >>n5921reglog,'---'
01254 print ''
01255 print 'Regression PASSED'
01256 print ''
01257 tstutl.note("Passed Regression test for NGC5921","NORMAL")
01258 else:
01259 regstate=False
01260 print >>n5921reglog,'---'
01261 print >>n5921reglog,'FAILED Regression test for NGC5921'
01262 print >>n5921reglog,'---'
01263 print ''
01264 print 'Regression FAILED'
01265 print ''
01266 tstutl.note("FAILED Regression test for NGC5921","SEVERE")
01267
01268 for d in (listvisresults, listcalresults, exportresults, quantresults):
01269 listfailures(d)
01270
01271 print >>n5921reglog,'*********************************'
01272
01273 print >>n5921reglog,''
01274 print >>n5921reglog,''
01275 print >>n5921reglog,'********* Benchmarking *****************'
01276 print >>n5921reglog,'* *'
01277 print >>n5921reglog,'Total wall clock time was: ', endTime - startTime
01278 print >>n5921reglog,'Total CPU time was: ', endProc - startProc
01279 print >>n5921reglog,'Processing rate MB/s was: ', 35.1/(endTime - startTime)
01280 print >>n5921reglog,'* Breakdown: *'
01281 print >>n5921reglog,'* import time was: '+str(importtime-startTime)
01282 print >>n5921reglog,'* flagautocorr time was: '+str(flagtime-listtime)
01283 print >>n5921reglog,'* setjy time was: '+str(setjytime-flagtime)
01284 print >>n5921reglog,'* bandpass time was: '+str(bptime-setjytime)
01285 print >>n5921reglog,'* gaincal time was: '+str(gaintime-bptime)
01286 print >>n5921reglog,'* listcal time was: '+str(listcaltime-gaintime)
01287 print >>n5921reglog,'* fluxscale time was: '+str(fstime-listcaltime)
01288 print >>n5921reglog,'* applycal time was: '+str(correcttime-fstime)
01289 print >>n5921reglog,'* split-cal time was: '+str(splitcaltime-correcttime)
01290 print >>n5921reglog,'* split-src time was: '+str(splitsrctime-splitcaltime)
01291 print >>n5921reglog,'* contsub time was: '+str(contsubtime-exportuvfitstime)
01292 print >>n5921reglog,'* listvis time was: '+str(listvistime-contsubtime)
01293 print >>n5921reglog,'* clean time was: '+str(cleantime-listvistime)
01294 print >>n5921reglog,'*****************************************'
01295
01296
01297 print ""
01298 print "Done!"
01299
01300 n5921reglog.close()
01301
01302
01303
01304