Commits
R. V. Urvashi authored 443f6aff3aa
14 14 | from taskinit import * |
15 15 | from tasks import * |
16 16 | image = iatool |
17 17 | imager = imtool |
18 18 | quanta = qatool |
19 19 | regionmanager = rgtool |
20 20 | table = tbtool |
21 21 | _ia = image() |
22 22 | _qa = quanta() |
23 23 | _rg = regionmanager() |
24 - | _im = imtool() |
25 24 | |
26 25 | _mytb = table() |
27 26 | |
28 27 | class SDINT_helper: |
29 28 | |
30 29 | # def __init__(self): |
31 30 | # casalog.post('Init Helper') |
32 31 | |
33 32 | ################################################ |
34 33 | def getFreqList(self,imname=''): |
845 844 | if not 'nChannels' in rbeams or rbeams['nChannels']!= shp[3]: |
846 845 | casalog.post("The SD Cube needs to have per-plane restoringbeams", 'ERROR') |
847 846 | _ia.close() |
848 847 | return False |
849 848 | else: |
850 849 | casalog.post("Found " + str(rbeams['nChannels']) + " per-plane restoring beams") |
851 850 | casalog.post("\n(For specmode='mfs' in sdintimaging, please remember to set 'reffreq' to a value within the freq range of the cube)\n") |
852 851 | _ia.close() |
853 852 | return {'nchan':nchan, 'start':start, 'width':width} |
854 853 | |
855 - | def fit_psf_beam(self,msname = '', psfname =''): |
856 - | _im.open(msname) |
857 - | _ia.open(psfname) |
858 - | csys = _ia.coordsys() |
859 - | rbeam_old = _ia.restoringbeam() |
860 - | print(rbeam_old) |
861 - | shp = _ia.shape() |
862 - | _ia.close() |
863 - | cellx = csys.increment()['numeric'][0]; |
864 - | celly = csys.increment()['numeric'][1]; |
865 - | _im.defineimage(nx=shp[0],ny=shp[1],cellx=str(cellx)+'rad',celly=str(celly)+'rad',nchan=3) |
866 - | params =_im.fitpsf(psfname) |
867 - | print(params) |
868 - | _im.close() |
854 + | ### Using Old Imager. Does not work for cubes ? |
855 + | # def fit_psf_beam(self,msname = '', psfname =''): |
856 + | # _im.open(msname) |
857 + | # _ia.open(psfname) |
858 + | # csys = _ia.coordsys() |
859 + | # rbeam_old = _ia.restoringbeam() |
860 + | # print(rbeam_old) |
861 + | # shp = _ia.shape() |
862 + | # _ia.close() |
863 + | # cellx = csys.increment()['numeric'][0]; |
864 + | # celly = csys.increment()['numeric'][1]; |
865 + | # _im.defineimage(nx=shp[0],ny=shp[1],cellx=str(cellx)+'rad',celly=str(celly)+'rad',nchan=3) |
866 + | # params =_im.fitpsf(psfname) |
867 + | # print(params) |
868 + | # _im.close() |
869 + | # |