Skip to content

UnboundLocalError when running DDF.py - 0 Jones-directions #46

@kendak333

Description

@kendak333

I'm trying to do some 3GC processing for a MeerKAT field and am coming across an issue when running DDF.py, which appears to be a problem with the output generated from MakeModel.py.

The command being run:
DDF.py ddf_imgDI_clustered.parset --Output-Clobber true

The parset file (in .txt form): ddf_imgDI_clustered.txt

The error:

- 11:12:39 - ClassStokes                  [0.2/0.2 8.9/8.9 0.0Gb] Correlations stored in Measurement set (and gridded) is labeled as ['XX', 'XY', 'YX', 'YY']
 - 11:12:39 - ClassStokes                  [0.2/0.2 8.9/8.9 0.0Gb] Stokes parameters required in FITS cube: ['I']
 - 11:12:39 - ClassFacetMachineTessel      [0.2/0.2 8.9/8.9 0.0Gb] Taking facet directions from Nodes catalog: /scratch/knowles/merghers/t1/out-1/continuum/image_3/J0438-5419_ddfsrcs.reg.ClusterCat.npy
 - 11:12:39 - ClassFacetMachineTessel      [0.2/0.2 8.9/8.9 0.0Gb]   There are 0 Jones-directions
 - 11:12:39 - ClassFacetMachineTessel      [0.2/0.2 8.9/8.9 0.0Gb] Saving Nodes catalog in ddf_DI_clustered.NodesCat.npy (Nfacets:0)
DDFacet has encountered an unexpected error. Dropping you into pdb for a post-mortem.
(This is because you're running with --Debug-Pdb set to 'auto' and --Log-Boring is off.)
Traceback (most recent call last):
  File "/home/knowles/venv-ddfkms/bin/DDF.py", line 461, in <module>
    main(OP, messages)
  File "/home/knowles/venv-ddfkms/bin/DDF.py", line 287, in main
    Imager.Init()
  File "/home/knowles/venv-ddfkms/lib/python3.8/site-packages/DDFacet/Imager/ClassDeconvMachine.py", line 313, in Init
    self.CreateFacetMachines()
  File "/home/knowles/venv-ddfkms/lib/python3.8/site-packages/DDFacet/Imager/ClassDeconvMachine.py", line 352, in CreateFacetMachines
    self.FacetMachine.appendMainField(ImageName="%s.image"%self.BaseName,**MainFacetOptions)
  File "/home/knowles/venv-ddfkms/lib/python3.8/site-packages/DDFacet/Imager/ClassFacetMachine.py", line 301, in appendMainField
    self.setFacetsLocs()
  File "/home/knowles/venv-ddfkms/lib/python3.8/site-packages/DDFacet/Imager/ClassFacetMachineTessel.py", line 334, in setFacetsLocs
    for iFacet, polygon0 in zip(range(len(LPolygon)), LPolygon):
UnboundLocalError: local variable 'LPolygon' referenced before assignment

The J0438-5419_ddfsrcs.reg.ClusterCat.npy file is generated via:

MakeModel.py --ds9PreClusterFile <ds9 region file> --NCluster=0 --BaseImageName <relevant 2GC image>

No errors are generated, other than the warning about Astropy read_ds9 depreciation. The region file looks like the following (I manually replaced the ellipse entries from CARTA with circle ones, but got the same issue):

# Region file format: DS9 CARTA 3.0.0
global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
fk5
circle(69.147725970, -54.608262553, 34.7293") # color=#2EE6D6 width=2
circle(68.290231347, -53.727704663, 55.7437") # color=#2EE6D6 width=2
circle(69.416763670, -53.909809815, 51.7000") # color=#2EE6D6 width=2
circle(70.523180227, -54.248390134, 24.2000") # color=#2EE6D6 width=2
circle(69.949181960, -54.676278227, 28.6000") # color=#2EE6D6 width=2

I tried running MakeModel.py with --Ncluster=5 (same number as regions in the file) and got a different error (lack of DicoModel).
I'm not sure where I'm going wrong or whether this is a bug - having checked with colleagues, others are experiencing this issue for certain fields but not for others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions