ratt-ru / meqtrees-cattery

MeqTrees-based frameworks for simulation and calibration of radio interferometers
Other
5 stars 9 forks source link

AttributeError: 'str' object has no attribute 'sources' #116

Open Kincaidr opened 2 years ago

Kincaidr commented 2 years ago

Hi,

I'm trying to simulate a simple sky pattern into an empty MS using the turbo sim script and I get:


ImportError: cannot import name _docutil
Error loading support for format 'PyBDSMGaul', see above. Format will not be available.
Loading tree_def.lsm.html: Tigger sky model
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/Timba/TDL/Compile.py", line 225, in run_forest_definition
    define_func(ns,**args);
  File "/usr/lib/python2.7/dist-packages/Cattery/Siamese/turbo-sim.py", line 196, in _define_forest
    output = meqmaker.make_predict_tree(ns,uvdata=model_spigots);
  File "/usr/lib/python2.7/dist-packages/Cattery/Meow/TensorMeqMaker.py", line 163, in make_predict_tree
    all_sources = sources if sources is not None else self.get_source_list(ns);
  File "/usr/lib/python2.7/dist-packages/Cattery/Meow/MeqMaker.py", line 539, in get_source_list
    self._source_list += mod.source_list(ns);
  File "/usr/lib/python2.7/dist-packages/Tigger/SiameseInterface.py", line 139, in source_list
    sources = sorted(self.lsm.sources, lambda a, b: cmp(b.brightness(), a.brightness()))
AttributeError: 'str' object has no attribute 'sources'

The Tigger LSM skymodel looks like this:

image

It however does work when I use the example-sim.py for the simulation.

o-smirnov commented 2 years ago

Odd, the code is here, and I can't see how self.lsm can ever be a string: https://github.com/ratt-ru/tigger-lsm/blob/master/Tigger/SiameseInterface.py#L147

Could you please add a print(self.lsm) statement just before to see what's up?

Also, I notice you're using python2.7 -- not sure it's even supported anymore, would you try a python3 virtualenv instead?

bennahugo commented 2 years ago

I have released a backport version of tigger-lsm for python 2.7 a while back. You should try upgrading to that. Unfortunately the 2.7 series is sunset.

If that does not work please follow the updated build instructions in https://github.com/ratt-ru/meqtrees/wiki/BuildFromSource If you have python3-qt4 installed (only available on Ubuntu 18.04) it should work, otherwise you will need to install the headless pipeliner.

bennahugo commented 2 years ago

tigger-lsm 1.7.0 is the last 2.7 release referred to above

Kincaidr commented 2 years ago

Odd, the code is here, and I can't see how self.lsm can ever be a string: https://github.com/ratt-ru/tigger-lsm/blob/master/Tigger/SiameseInterface.py#L147

Could you please add a print(self.lsm) statement just before to see what's up?

Also, I notice you're using python2.7 -- not sure it's even supported anymore, would you try a python3 virtualenv instead?

I am actually running through the meqbrowser on the like server and so cannot edit that script. I have however tried on crosby and it works, both are using python 2.7 so I don't think its that.