Closed o-smirnov closed 9 years ago
Possible solution to first problem: create Imager object with useModel=True at this line:
Fixed this -- note that I had to take out a conditional in CSCleanImageSkyModel as well (somebody seems to have explicitly killed this functionality, naughty naughty!)
Perhaps related to CASA's clean task no longer storing the inversion of the clean component model in the MODEL_DATA column by default...
Yeah it is related I guess -- they have a usescratch keyword for that in the task, and the default is False. I've added a fillmodel option to lwimager as of this fix (will show up in 1.3.1 release), use fillmodel=True to make sure the MODEL_DATA column is filled.
I guess all the hollering about the MS format being a data hog finally found some traction. CASA workaround is the ft task with usescratch=True, for the record.
Ahh that's good -- I plan to wrap CASA in pyxis next (to help preserve my sanity), this sort of stuff is exactly what I need to know!
It already works pretty well from within Pyxis via tricks like this:
def imageMS(msName,imageName,dirty,fixedbeam):
cc = 'clean('
cc += 'vis="'+msName+'",'
cc += 'imagename="'+imageName+'",'
cc += 'mode="mfs",'
cc += 'gridmode="widefield",'
cc += 'wprojplanes=64,'
if dirty:
cc+='niter=0,'
else:
cc += 'niter=2500,'
cc += 'imsize=[2240,2240],'
cc += 'cell=["12.0arcsec"],'
cc += 'multiscale=[],'
cc += 'weighting="briggs",'
if fixedbeam:
cc += 'restoringbeam = ["2.097649468316E-02deg","1.559506416321E-02deg",
"-1.779342346191E+02deg"],'
cc += 'robust=0.0)\n'
cc += 'exportfits(imagename="'+imageName+'.image",fitsimage="'+imageName+'.fits"
,overwrite=True)\n'
cc += 'exportfits(imagename="'+imageName+'.psf",fitsimage="'+imageName+'.psf.fit
s",overwrite=True)'
std.runcasapy(cc)
deleteExtensions = ['.image','.flux','.residual','.model','.psf']
for ext in deleteExtensions:
syscall = 'rm -rf '+imageName+ext
os.system(syscall)
but just being able to call the CASA routines would be neat. Ping me if I can help.
Oops, not quite fixed yet...
@IanHeywood thanks for the ft tip -- it's lightning fast, but I have a nasty suspicion it does not apply w-projection, just from looking at the status messages...
Anyway, this ought to work in 1.3.2 again. In the meantime, let me check if I can get the clean task to do a similarly sensible thing. UPDATE: no I can't, bless you CASA, can't handle IQUV polarized models...
In version 1.2, we had the wonderful feature of being able to use "fixed=1 niter=0 operation=csclean" to populate the MODEL_DATA column with visibilities computed from an pre-existing model image.
(pyxis imager.predict_vis takes advantage of this, for example.)
As of the current version this no longer fills the MODEL_DATA column (although the status messages indicate everything is going on as usual).
Furthermore, telling it to continue clean from a fixed model (niter=1000 for example) causes the whole thing to bomb out ingloriously: