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
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 import os
00163 import time
00164 import regression_utility as tstutl
00165
00166
00167 benchmarking = True
00168 usedasync = False
00169
00170
00171 doimage = True
00172
00173
00174
00175
00176
00177 pathname=os.environ.get('CASAPATH').split()[0]
00178
00179
00180 datapath=pathname+'/data/regression/ATST2/NGC1333/'
00181 fitsdata1=datapath+'N1333_1.UVFITS'
00182 fitsdata2=datapath+'N1333_2.UVFITS'
00183
00184
00185 modelim=pathname+'/data/nrao/VLA/CalModels/3C147_Q.im'
00186
00187
00188 testdir='ngc1333_regression'
00189
00190
00191 prefix=testdir+"/"+'n1333_both'
00192 prefix1=testdir+"/"+'n1333_1'
00193 prefix2=testdir+"/"+'n1333_2'
00194
00195
00196
00197 tstutl.maketestdir(testdir)
00198
00199
00200 if benchmarking:
00201 startTime = time.time()
00202 startProc = time.clock()
00203
00204
00205
00206
00207
00208
00209 print '*** 02 MAY ***'
00210 print '--Import--'
00211
00212
00213 default('importuvfits')
00214
00215
00216 msfile1 = prefix1 + '.ms'
00217
00218
00219 fitsfile = fitsdata1
00220 vis = msfile1
00221 antnamescheme="new"
00222 importuvfits()
00223
00224
00225 if benchmarking:
00226 importtime = time.time()
00227
00228
00229
00230
00231
00232
00233 print '--Listobs--'
00234
00235
00236
00237
00238
00239
00240 verbose = True
00241
00242 listobs()
00243
00244
00245 if benchmarking:
00246 listtime = time.time()
00247
00248
00249
00250
00251
00252 print '--Flagdata--'
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 default('tflagdata')
00286 vis = msfile1
00287 mode = 'list'
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
00315
00316
00317
00318
00319
00320 flagcmds = ["autocorr=True",
00321 "autocorr=False antenna='VA09'",
00322 "autocorr=False timerange='2003/05/02/21:40:58~2003/05/02/22:01:30'",
00323 "autocorr=False antenna='VA14' timerange='2003/05/02/18:50:50~2003/05/02/19:13:30'",
00324 "autocorr=False antenna='VA15' timerange='2003/05/02/22:38:49~2003/05/02/22:39:11' spw='0'"]
00325
00326 inpfile=flagcmds
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339 tflagdata()
00340
00341
00342
00343 if benchmarking:
00344 flagtime = time.time()
00345
00346
00347
00348
00349
00350
00351
00352 print '--Setjy--'
00353 default('setjy')
00354
00355 setjy(vis=msfile1,field='0542+498_1',modimage=modelim,scalebychan=False,standard='Perley-Taylor 99')
00356 setjy(vis=msfile1,field='0542+498_2',modimage=modelim,scalebychan=False,standard='Perley-Taylor 99')
00357
00358
00359 if benchmarking:
00360 setjytime = time.time()
00361
00362
00363
00364
00365
00366
00367 print '--Gaincal--'
00368 default('gaincal')
00369
00370 gtable1 = prefix1 + '.1.gcal'
00371 gaincal(vis=msfile1,caltable=gtable1,
00372 field='0,12,14',spw='0:4~58', gaintype='G',
00373 opacity=0.06,solint='int',combine='',refant='VA27',minsnr=2.,gaincurve=True)
00374
00375 gtable2 = prefix1 + '.2.gcal'
00376 gaincal(vis=msfile1,caltable=gtable2,
00377 field='6,13,15',spw='1:4~58', gaintype='G',
00378 opacity=0.06,solint='int',combine='',refant='VA27',gaincurve=True)
00379
00380
00381 if benchmarking:
00382 gaintime = time.time()
00383
00384
00385
00386
00387
00388
00389 print '--Bandpass--'
00390 default('bandpass')
00391
00392 btable1 = prefix1 + '.1.bcal'
00393 bandpass(vis=msfile1,caltable=btable1,
00394 field='0',spw='0',
00395 opacity=0.06,gaintable=gtable1,interp='nearest',
00396 refant='VA27',solint='inf',combine='scan',gaincurve=True)
00397 btable2 = prefix1 + '.2.bcal'
00398 bandpass(vis=msfile1,caltable=btable2,
00399 field='6',spw='1',
00400 opacity=0.06,gaintable=gtable2,interp='nearest',
00401 refant='VA27',solint='inf',combine='scan',gaincurve=True)
00402
00403
00404 if benchmarking:
00405 bptime = time.time()
00406
00407
00408
00409
00410
00411
00412
00413 print '--Fluxscale--'
00414 default('fluxscale')
00415
00416 ftable1 = prefix1 + '.1.fcal'
00417 fluxscale(vis=msfile1,caltable=gtable1,fluxtable=ftable1,
00418 reference='0542+498_1',transfer=['0336+323_1', '0319+415_1'])
00419 ftable2 = prefix1 + '.2.fcal'
00420 fluxscale(vis=msfile1,caltable=gtable2,fluxtable=ftable2,
00421 reference='0542+498_2',transfer=['0336+323_2', '0319+415_2'])
00422
00423
00424 if benchmarking:
00425 fstime = time.time()
00426
00427
00428
00429
00430
00431
00432
00433 print '--ApplyCal--'
00434 default('applycal')
00435
00436 applycal(vis=msfile1,
00437 field='0~5',spw='0',
00438 gaincurve=True,opacity=0.06,
00439 gaintable=[ftable1,btable1],
00440 gainfield='0',calwt=False)
00441 applycal(vis=msfile1,
00442 field='6~11',spw='1',
00443 gaincurve=True,opacity=0.06,
00444 gaintable=[ftable2,btable2],
00445 gainfield='6',calwt=False)
00446
00447
00448 if benchmarking:
00449 correcttime = time.time()
00450
00451
00452
00453
00454
00455
00456
00457 print '--Split (target and cals) --'
00458 default('split')
00459
00460
00461 splitms1 = prefix1 + '.src.t2may.ms'
00462 split(vis=msfile1,outputvis=splitms1,
00463 field='1~5,7~11',spw='0;1:0~62',
00464 datacolumn='corrected')
00465
00466
00467 if benchmarking:
00468 splitsrctime = time.time()
00469
00470
00471 calsplitms1 = prefix1 + '.gcal_t1.2may.ms'
00472 split(vis=msfile1,outputvis=calsplitms1,
00473 field='0',spw='0:0~62',
00474 datacolumn='corrected')
00475 calsplitms2 = prefix1 + '.gcal_t2.2may.ms'
00476 split(vis=msfile1,outputvis=calsplitms2,
00477 field='6',spw='1:0~62',
00478 datacolumn='corrected')
00479
00480
00481 if benchmarking:
00482 splitcaltime = time.time()
00483
00484
00485
00486
00487
00488
00489 print '*** 08 MAY ***'
00490 print '--Import--'
00491
00492
00493 default('importuvfits')
00494
00495
00496 msfile2 = prefix2 + '.ms'
00497
00498
00499 fitsfile = fitsdata2
00500 vis = msfile2
00501 antnamescheme='new'
00502 importuvfits()
00503
00504
00505
00506
00507
00508 if benchmarking:
00509 importtime2 = time.time()
00510
00511
00512
00513
00514
00515
00516 print '--Listobs--'
00517
00518
00519
00520
00521
00522
00523 verbose = False
00524
00525 listobs()
00526
00527
00528 if benchmarking:
00529 listtime2 = time.time()
00530
00531
00532
00533
00534
00535
00536
00537 print '--Flagdata--'
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564 default('tflagdata')
00565 vis = msfile2
00566 mode = 'list'
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609 flagcmds = ["autocorr=True",
00610 "antenna='VA09,VA10,VA19'",
00611 "antenna='VA15' timerange='2003/05/08/00:00:00~2003/05/08/20:00:00'",
00612 "antenna='VA06,VA22' scan='144'",
00613 "spw='*:59;60;61;62'"]
00614
00615 inpfile=flagcmds
00616
00617
00618
00619
00620
00621 tflagdata()
00622
00623
00624 if benchmarking:
00625 flagtime2 = time.time()
00626
00627
00628
00629
00630
00631
00632
00633 print '--Setjy--'
00634 default('setjy')
00635
00636 setjy(vis=msfile2,field='0542+498_1',modimage=modelim,scalebychan=False,standard='Perley-Taylor 99')
00637 setjy(vis=msfile2,field='0542+498_2',modimage=modelim,scalebychan=False,standard='Perley-Taylor 99')
00638
00639
00640 if benchmarking:
00641 setjytime2 = time.time()
00642
00643
00644
00645
00646
00647
00648 print '--Gaincal--'
00649 default('gaincal')
00650
00651 gtable2_1 = prefix2 + '.1.gcal'
00652 gaincal(vis=msfile2,caltable=gtable2_1,
00653 field='0,12,14',spw='0:4~58', gaintype='G',
00654 opacity=0.062,solint='int',combine='',refant='VA27',gaincurve=True)
00655 gtable2_2 = prefix2 + '.2.gcal'
00656 gaincal(vis=msfile2,caltable=gtable2_2,
00657 field='6,13,15',spw='1:4~58', gaintype='G',
00658 opacity=0.062,solint='int',combine='',refant='VA27',gaincurve=True)
00659
00660
00661 if benchmarking:
00662 gaintime2 = time.time()
00663
00664
00665
00666
00667
00668
00669
00670 print '--Bandpass--'
00671 default('bandpass')
00672
00673 btable2_1 = prefix2 + '.1.bcal'
00674 bandpass(vis=msfile2,caltable=btable2_1,
00675 field='0',spw='0',
00676 opacity=0.062,
00677 gaintable=gtable2_1,interp='nearest',
00678 refant='VA27',
00679 solint='inf',combine='scan',gaincurve=True)
00680 btable2_2 = prefix2 + '.2.bcal'
00681 bandpass(vis=msfile2,caltable=btable2_2,
00682 field='6',spw='1',
00683 opacity=0.062,
00684 gaintable=gtable2_2,interp='nearest',
00685 refant='VA27',
00686 solint='inf',combine='scan',gaincurve=True)
00687
00688
00689 if benchmarking:
00690 bptime2 = time.time()
00691
00692
00693
00694
00695
00696
00697
00698 print '--Fluxscale--'
00699 default('fluxscale')
00700
00701 ftable2_1 = prefix2 + '.1.fcal'
00702 fluxscale(vis=msfile2, caltable=gtable2_1, fluxtable=ftable2_1,
00703 reference='0542+498_1',transfer=['0336+323_1', '0319+415_1'])
00704 ftable2_2 = prefix2 + '.2.fcal'
00705 fluxscale(vis=msfile2, caltable=gtable2_2, fluxtable=ftable2_2,
00706 reference='0542+498_2',transfer=['0336+323_2', '0319+415_2'])
00707
00708
00709 if benchmarking:
00710 fstime2 = time.time()
00711
00712
00713
00714
00715
00716
00717
00718
00719 print '--ApplyCal--'
00720 default('applycal')
00721
00722 applycal(vis=msfile2,
00723 field='0~5',spw='0',
00724 gaincurve=True,opacity=0.062,
00725 gaintable=[ftable2_1,btable2_1],
00726 gainfield='0',calwt=False)
00727 applycal(vis=msfile2,
00728 field='6~11',spw='1',
00729 gaincurve=True,opacity=0.062,
00730 gaintable=[ftable2_2,btable2_2],
00731 gainfield='6',calwt=False)
00732
00733
00734
00735 if benchmarking:
00736 correcttime2 = time.time()
00737
00738
00739
00740
00741
00742
00743 print '--Split (target and cals) --'
00744 default('split')
00745
00746
00747 splitms2 = prefix2 + '.src.t8may.ms'
00748 split(vis=msfile2,outputvis=splitms2,
00749 field='1~5,7~11',spw='0;1:0~62',
00750 datacolumn='corrected')
00751
00752
00753 if benchmarking:
00754 splitsrctime2 = time.time()
00755
00756
00757 calsplitms2_1 = prefix2 + '.gcal_t1.8may.ms'
00758 split(vis=msfile2,outputvis=calsplitms2_1,
00759 field='0',spw='0:0~62',datacolumn='corrected')
00760 calsplitms2_2 = prefix2 + '.gcal_t2.8may.ms'
00761 split(vis=msfile2,outputvis=calsplitms2_2,
00762 field='6',spw='1:0~62',datacolumn='corrected')
00763
00764
00765 if benchmarking:
00766 splitcaltime2 = time.time()
00767
00768
00769
00770
00771
00772
00773
00774 print '--Concatenate data sets--'
00775 default('concat')
00776
00777 msfileboth = prefix + '.ms'
00778 shellcmd = 'cp -r '+splitms1+' '+msfileboth
00779 os.system(shellcmd)
00780 vis = [msfileboth, splitms2]
00781 concatvis = msfileboth
00782 freqtol='10MHz'
00783 dirtol='1arcsec'
00784 concat()
00785
00786
00787 if benchmarking:
00788 concattime = time.time()
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803 print '--Image data--'
00804
00805 """
00806 im.open(thems=msfileboth)
00807 im.selectvis(field=range(0,10),spw=[0,1],nchan=63,start=0,step=1)
00808 im.defineimage(nx=800,ny=800,cellx='0.5arcsec',stokes='I',mode='channel',nchan=18,start=2,step=5,phasecenter=0,spw=[0,1])
00809 ### natural weighting
00810 im.weight(type='natural')
00811 ### Use default primary beam
00812 im.setvp(dovp=True,usedefaultvp=True,dosquint=False)
00813 ### Use the newer mosaic gridder where mosaicing is done in convolution
00814 im.setoptions(padding=1.0,ftmachine='mosaic')
00815 #### Define up to which point in the beam image will be shown
00816 imfluxscale = prefix+'.src.task.fluxscale'
00817 im.setmfcontrol(scaletype='PBCOR',minpb=0.07,constpb=0.4, fluxscale=imfluxscale)
00818 immodel = prefix+'.src.tall.cln.model'
00819 imimage = prefix+'.src.task.image'
00820 imresidual = prefix+'.src.tall.cln.resid'
00821 im.clean(algorithm='mfclark',niter=1,gain=0.1,threshold=5.,model=immodel,
00822 mask='',image=imimage,residual=imresidual,npercycle=30)
00823 im.close()
00824 """
00825
00826 imagetime=0.0
00827 momenttime=0.0
00828 if doimage:
00829 default('clean')
00830
00831 vis = msfileboth
00832 imagename = prefix
00833
00834 mode = 'channel'
00835
00836
00837 nchan = 18
00838 start = 4
00839 width = 5
00840 psfmode = 'clark'
00841 imsize = [800,800]
00842 cell = ['0.5arcsec','0.5arcsec']
00843 stokes='I'
00844
00845 niter = 1
00846 gain = 0.1
00847 threshold = '5.0mJy'
00848 mask = ''
00849
00850
00851 field = '0~9'
00852 spw = '0~1'
00853 timerange = ''
00854 restfreq = ''
00855 phasecenter='0'
00856 modelimage = ''
00857 weighting = 'natural'
00858 imagermode='mosaic'
00859 mosweight = False
00860 ftmachine = 'mosaic'
00861 cyclefactor = 1.5
00862 cyclespeedup = -1
00863 scaletype = 'SAULT'
00864 pbcor=False
00865 minpb = 0.1
00866 sigma = '0.001Jy'
00867 targetflux = '1.0Jy'
00868 constrainflux = False
00869 prior = ['']
00870 negcomponent = 2
00871 scales = [0, 3, 10]
00872 interpolation = 'nearest'
00873 async = False
00874
00875 clean()
00876
00877
00878 if benchmarking:
00879 imagetime = time.time()
00880
00881
00882
00883
00884
00885
00886 print '--Calculate moments--'
00887
00888 default('immoments')
00889
00890 imimage=prefix+'.image'
00891 mom0redoutfile = prefix+'.src.tmom0.red'
00892 mom0blueoutfile = prefix+'.src.tmom0.blu'
00893 mom0alloutfile = prefix+'.src.tmom0.all'
00894 mom1alloutfile = prefix+'.src.tmom1.all'
00895
00896 imagename = imimage
00897 moments = [0]
00898 axis = 'spec'
00899 chans = '2~8'
00900 includepix=[0.003,100.0]
00901 excludepix = [-1]
00902 outfile = mom0redoutfile
00903 async = False
00904 immoments()
00905
00906 outfile = mom0blueoutfile
00907 chans='9~15'
00908 immoments()
00909
00910 outfile = mom0alloutfile
00911 chans='2~15'
00912 immoments()
00913
00914 outfile = mom1alloutfile
00915 moments = 1
00916 includepix=[0.02,100.0]
00917 immoments()
00918
00919
00920 if benchmarking:
00921 momenttime = time.time()
00922
00923 """
00924 ia.open(infile=imimage)
00925 ia.moments(outfile=mom0redoutfile,
00926 moments=0,axis=3,mask='indexin(3,[2:9])',includepix=[0.003,100.0])
00927 ia.moments(outfile=mom0blueoutfile,
00928 moments=0,axis=3,mask='indexin(3,[9:15])',includepix=[0.003,100.0])
00929 ia.moments(outfile=mom0alloutfile,
00930 moments=0,axis=3,mask='indexin(3,[2:15])',includepix=[0.003,100.0])
00931 ia.moments(outfile=mom1alloutfile,
00932 moments=1,axis=3,mask='indexin(3,[2:15])',includepix=[0.02,100.0])
00933 ia.close()
00934 """
00935
00936
00937 endProc = time.clock()
00938 endTime = time.time()
00939
00940
00941
00942
00943
00944
00945 ms.open(thems=splitms1)
00946 ms.selectchannel(1,2,59,1);
00947 src_2may=max(ms.range(items=["amplitude"]).get('amplitude'))
00948 ms.close
00949
00950 ms.open(thems=splitms2)
00951 ms.selectchannel(1,2,59,1);
00952 src_8may=max(ms.range(items=["amplitude"]).get('amplitude'))
00953 ms.close
00954
00955 ms.open(thems=calsplitms2_1)
00956 ms.selectinit(0,T)
00957 ms.selectchannel(1,2,59,1);
00958 gcal1_8may=max(ms.range(items=["amplitude"]).get('amplitude'))
00959 ms.close()
00960
00961 ms.open(thems=calsplitms2_2)
00962 ms.selectchannel(1,2,59,1);
00963 gcal2_8may=max(ms.range(items=["amplitude"]).get('amplitude'))
00964 ms.close()
00965
00966 ms.open(thems=calsplitms1)
00967 ms.selectchannel(1,2,59,1);
00968 gcal1_2may=max(ms.range(items=["amplitude"]).get('amplitude'))
00969 ms.close()
00970
00971 ms.open(thems=calsplitms2)
00972 ms.selectchannel(1,2,59,1);
00973 gcal2_2may=max(ms.range(items=["amplitude"]).get('amplitude'))
00974 ms.close()
00975
00976 thistest_immax=0.0
00977 thistest_imrms=0.0
00978 if doimage:
00979 ia.open(infile=mom0alloutfile)
00980 statistics=ia.statistics()
00981 thistest_immax=statistics['max'][0]
00982 thistest_imrms=statistics['rms'][0]
00983
00984
00985
00986 cal1_2may=4.56
00987 cal2_2may=4.00
00988 cal1_8may=5.72
00989 cal2_8may=6.70
00990 src2may=3.13
00991 src8may=8.18
00992 immax=0.694
00993 imrms=0.0729
00994
00995 diff_cal1_2may=abs((cal1_2may-gcal1_2may)/cal1_2may)
00996 diff_cal2_2may=abs((cal2_2may-gcal2_2may)/cal2_2may)
00997 diff_cal1_8may=abs((cal1_8may-gcal1_8may)/cal1_8may)
00998 diff_cal2_8may=abs((cal2_8may-gcal2_8may)/cal2_8may)
00999 diff_src_2may=abs((src2may-src_2may)/src2may)
01000 diff_src_8may=abs((src8may-src_8may)/src8may)
01001 diff_immax=abs((immax-thistest_immax)/immax)
01002 diff_imrms=abs((imrms-thistest_imrms)/imrms)
01003
01004
01005 if not benchmarking:
01006 print ''
01007 print '--- Done ---'
01008 else:
01009 import datetime
01010 datestring=datetime.datetime.isoformat(datetime.datetime.today())
01011 outfile='ngc1333.'+datestring+'.log'
01012 logfile=open(outfile,'w')
01013
01014 print >>logfile,''
01015 print >>logfile,'********** Data Summary *********'
01016 print >>logfile,'*********************************'
01017 print >>logfile,''
01018 print >>logfile,'********** Regression ***********'
01019 print >>logfile,'* *'
01020 regstate = True
01021 if (diff_cal1_2may < 0.05):
01022 print >>logfile,'* Passed cal1 max amplitude test (2may) *'
01023 else:
01024 print >>logfile,'* Failed cal1 max amplitude test (2may) *'
01025 regstate = False
01026 print >>logfile,'* Cal1 max amp (2may) '+str(gcal1_2may)+' ('+str(cal1_2may)+')'
01027 if (diff_cal2_2may < 0.05):
01028 print >>logfile,'* Passed cal2 max amplitude test (2may) *'
01029 else:
01030 print >>logfile,'* Failed cal2 max amplitude test (2may) *'
01031 regstate = False
01032 print >>logfile,'* Cal2 max amp (2may) '+str(gcal2_2may)+' ('+str(cal2_2may)+')'
01033 if (diff_cal1_8may < 0.05):
01034 print >>logfile,'* Passed cal1 max amplitude test (8may) *'
01035 else:
01036 print >>logfile,'* Failed cal1 max amplitude test (8may) *'
01037 regstate = False
01038 print >>logfile,'* Cal1 max amp (8may) '+str(gcal1_8may)+' ('+str(cal1_8may)+')'
01039 if (diff_cal2_8may < 0.05):
01040 print >>logfile,'* Passed cal2 max amplitude test (8may) *'
01041 else:
01042 print >>logfile,'* Failed cal2 max amplitude test (8may) *'
01043 regstate = False
01044 print >>logfile,'* Cal2 max amp (8may) '+str(gcal2_8may)+' ('+str(cal2_8may)+')'
01045 if (diff_src_2may < 0.05):
01046 print >>logfile,'* Passed src max amplitude test (2may) *'
01047 else:
01048 print >>logfile,'* Failed src max amplitude test (2may) *'
01049 regstate = False
01050 print >>logfile,'* Src max amp (2may) '+str(src_2may)+' ('+str(src2may)+')'
01051 if (diff_src_8may < 0.05):
01052 print >>logfile,'* Passed src max amplitude test (8may) *'
01053 else:
01054 print >>logfile,'* Failed src max amplitude test (8may) *'
01055 regstate = False
01056 print >>logfile,'* Src max amp (8may) '+str(src_8may)+' ('+str(src8may)+')'
01057 if (diff_immax < 0.05):
01058 print >>logfile,'* Passed image max test *'
01059 else:
01060 if doimage:
01061 print >>logfile,'* Failed image max test *'
01062 regstate = False
01063 else:
01064 print >>logfile,'* Did not do image max test'
01065
01066 print >>logfile,'* Image max '+str(thistest_immax)+' ('+str(immax)+')'
01067 if (diff_imrms < 0.05):
01068 print >>logfile,'* Passed image rms test *'
01069 else:
01070 if doimage:
01071 print >>logfile,'* Failed image rms test *'
01072 regstate = False
01073 else:
01074 print >>logfile,'* Did not do image rms test'
01075 print >>logfile,'* Image rms '+str(thistest_imrms)+' ('+str(imrms)+')'
01076
01077
01078
01079
01080 if regstate:
01081 print >>logfile,'---'
01082 print >>logfile,'Passed Regression test for NGC1333'
01083 print >>logfile,'---'
01084 tstutl.note("Passed Regression test for NGC1333","NORMAL")
01085 else:
01086 print >>logfile,'----FAILED Regression test for NGC1333'
01087 tstutl.note("FAILED Regression test for NGC1333","SEVERE")
01088 print >>logfile,'*********************************'
01089
01090 print >>logfile,''
01091 print >>logfile,''
01092 print >>logfile,'********* Benchmarking *****************'
01093 print >>logfile,'* *'
01094 print >>logfile,'Total wall clock time was: '+str(endTime - startTime)
01095 print >>logfile,'Total CPU time was: '+str(endProc - startProc)
01096 print >>logfile,'Processing rate MB/s was: '+str(240.3/(endTime - startTime))
01097 print >>logfile,'* Breakdown: *'
01098 print >>logfile,'* import time was: '+str(importtime-startTime)
01099 print >>logfile,'* listobs time was: '+str(listtime-importtime)
01100 print >>logfile,'* flagdata time was: '+str(flagtime-listtime)
01101 print >>logfile,'* setjy time was: '+str(setjytime-flagtime)
01102 print >>logfile,'* gaincal time was: '+str(gaintime-setjytime)
01103 print >>logfile,'* bandpass time was: '+str(bptime-gaintime)
01104 print >>logfile,'* fluxscale time was: '+str(fstime-bptime)
01105 print >>logfile,'* correct time was: '+str(correcttime-fstime)
01106 print >>logfile,'* split time was: '+str(splitcaltime-correcttime)
01107 print >>logfile,'* import time was: '+str(importtime2-splitcaltime)
01108 print >>logfile,'+ listobs time was: '+str(listtime2-importtime2)
01109 print >>logfile,'* flagdata time was: '+str(flagtime2-listtime2)
01110 print >>logfile,'* setjy time was: '+str(setjytime2-flagtime2)
01111 print >>logfile,'* gaincal time was: '+str(gaintime2-setjytime2)
01112 print >>logfile,'* bandpass time was: '+str(bptime2-gaintime2)
01113 print >>logfile,'* fluxscale time was: '+str(fstime2-bptime2)
01114 print >>logfile,'* correct time was: '+str(correcttime2-fstime2)
01115 print >>logfile,'* split time was: '+str(splitcaltime2-correcttime2)
01116 print >>logfile,'* concatenate time was: '+str(concattime-splitcaltime2)
01117 print >>logfile,'* image time was: '+str(imagetime-concattime)
01118 print >>logfile,'* moments time was: '+str(momenttime-imagetime)
01119 print >>logfile,'*****************************************'
01120
01121 logfile.close()