ratt-ru / pyxis

Python Extensions for Interferometry Scripting
3 stars 5 forks source link

lwimager: cleaning with mask seems to fail #39

Closed Trienko closed 9 years ago

Trienko commented 9 years ago

Could someone please advise in what could be going wrong, I am trying to clean with a mask. I have successfully called imager.make_threshold_mask to make the mask, the mask fits file also exists. The imager variable is MASK_IMAGE is also set to this file. When I then call make_image it fails saying that MAKS_IMAGE is defined. What am I doing wrong?

Traceback (most recent call last):
  File "/usr/local/meqtrees/pyxis/Pyxis/bin/pyxis", line 281, in <module>
    Pyxis.Internals.run(*commands);
  File "/usr/lib/python2.7/dist-packages/Pyxis/Internals.py", line 1098, in run
    comcall();
  File "./pyxis-transient.py", line 601, in burn
    make_image_with_mask(options=options,column="CORRECTED_DATA")
  File "./pyxis-transient.py", line 558, in make_image_with_mask
 imager.make_image(column=column,dirty=options,restore=options,restore_lsm=False,mask=True) # Clean with a mask
  File "/usr/lib/python2.7/dist-packages/Pyxides/imager.py", line 119, in make_image
    restoring_options=restoring_options,**kw)
  File "/usr/lib/python2.7/dist-packages/Pyxides/im/lwimager.py", line 270, in make_image
    kw['mask'] = mask = MASK_IMAGE;
NameError: global name 'MASK_IMAGE' is not defined 
SpheMakh commented 9 years ago

This looks like a bug in pyxis. However, it should only be triggered if your mask is not a FITS file. Could you post the commands that you ran, to make and use the mask?

Trienko commented 9 years ago
thresh = peak_flux*0.08
print "thresh = ",thresh
#mask_im is a fits file
imager.make_threshold_mask(input=mask_im,threshold=thresh) # make mask
imager.make_image(column=column,dirty=options,restore=options,restore_lsm=False,mask=True)
SpheMakh commented 9 years ago

I still haven't answered @Trienko :). You are passing a boolean as a clean mask. Try, mask=mask_im in imager.make_image(column=column,dirty=options,restore=options,restore_lsm=False,mask=True)

Trienko commented 9 years ago

Works... On 23 Apr 2015 5:00 PM, "Sphesihle Makhathini" notifications@github.com wrote:

I still haven't answered Trienko :). you are passing a boolean as a clean mask. Try, mask=mask_im in

imager.make_image(column=column,dirty=options,restore=options,restore_lsm=False,mask=True)

— Reply to this email directly or view it on GitHub https://github.com/ska-sa/pyxis/issues/39#issuecomment-95615527.

SpheMakh commented 9 years ago

Cool.

Trienko commented 9 years ago

:-) On 23 Apr 2015 8:05 PM, "Sphesihle Makhathini" notifications@github.com wrote:

Cool.

— Reply to this email directly or view it on GitHub https://github.com/ska-sa/pyxis/issues/39#issuecomment-95673118.