I downloaded and installed RMextract on Ubuntu 22.04, but when I first ran it got the error:
[twillis-Precision-3541 7:55am] [examples]> python agw_vla.py # NOTE: a script using the VLA but otherwise similar to the agw_examples script
pyrap will be used to compute positions
observing in direction RA, DEC in radians 3.5392577867862847 0.5324852164475642
pointing [3.53925779 0.53248522]
**** specified start and end time 59805.488581018515 59806.488581018515
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
Traceback (most recent call last):
File "/home/twillis/Downloads/RMextract/examples/agw_vla.py", line 30, in
result = getRM(use_azel=use_azel,radec=pointing,out_file='test_report',object=OBJECT,start_time=START_TIME,end_time=END_TIME, timestep=TIME_STEP,stat_positions= station_position,useEMM=True,TIME_OFFSET=TIME_OFFSET)
File "/usr/local/lib/python3.10/dist-packages/RMextract-0.4.4-py3.10-linux-x86_64.egg/RMextract/getRM.py", line 191, in getRM
az,el = PosTools.getAzEl(pointing,time,position,ha_limit)
File "/usr/local/lib/python3.10/dist-packages/RMextract-0.4.4-py3.10-linux-x86_64.egg/RMextract/PosTools.py", line 578, in getAzEl
azel=radec2azel(pointing[0],pointing[1],time=str(time)+'s',pos=position);
File "/usr/local/lib/python3.10/dist-packages/RMextract-0.4.4-py3.10-linux-x86_64.egg/RMextract/PosTools.py", line 396, in radec2azel
phasedir=me.direction('J2000',ra,dec)
File "/usr/local/lib/python3.10/dist-packages/python_casacore-3.5.2-py3.10-linux-x86_64.egg/casacore/measures/init.py", line 158, in direction
return self.measure(loc, rf)
File "/usr/local/lib/python3.10/dist-packages/python_casacore-3.5.2-py3.10-linux-x86_64.egg/casacore/measures/init.py", line 120, in measure
return _measures.measure(self, v, rf, off)
ImportError: numpy.core.multiarray failed to import
At this time I had not used my package manager to install the 'standard' casacore packages, so RMextract looked for and installed a python-casacore that had been compiled against numpy 1.22.
The error comes from RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe i.e. The casecore build that you import is using numpy 1.22, whereas the 'standard' numpy distributed with ubuntu 22.04 is version 1.21
So ... I then deleted the output of the RMextract build, installed the casacore libraries from the package manager, and then built RMextract, et voila then things worked after I installed the CASA measures data.
Anyway - just a heads up in case someone else encounters the same issue :)
Cheers
Tony
Hi Maaijke
I downloaded and installed RMextract on Ubuntu 22.04, but when I first ran it got the error:
[twillis-Precision-3541 7:55am] [examples]> python agw_vla.py # NOTE: a script using the VLA but otherwise similar to the agw_examples script pyrap will be used to compute positions observing in direction RA, DEC in radians 3.5392577867862847 0.5324852164475642 pointing [3.53925779 0.53248522] **** specified start and end time 59805.488581018515 59806.488581018515 RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe Traceback (most recent call last): File "/home/twillis/Downloads/RMextract/examples/agw_vla.py", line 30, in
result = getRM(use_azel=use_azel,radec=pointing,out_file='test_report',object=OBJECT,start_time=START_TIME,end_time=END_TIME, timestep=TIME_STEP,stat_positions= station_position,useEMM=True,TIME_OFFSET=TIME_OFFSET)
File "/usr/local/lib/python3.10/dist-packages/RMextract-0.4.4-py3.10-linux-x86_64.egg/RMextract/getRM.py", line 191, in getRM
az,el = PosTools.getAzEl(pointing,time,position,ha_limit)
File "/usr/local/lib/python3.10/dist-packages/RMextract-0.4.4-py3.10-linux-x86_64.egg/RMextract/PosTools.py", line 578, in getAzEl
azel=radec2azel(pointing[0],pointing[1],time=str(time)+'s',pos=position);
File "/usr/local/lib/python3.10/dist-packages/RMextract-0.4.4-py3.10-linux-x86_64.egg/RMextract/PosTools.py", line 396, in radec2azel
phasedir=me.direction('J2000',ra,dec)
File "/usr/local/lib/python3.10/dist-packages/python_casacore-3.5.2-py3.10-linux-x86_64.egg/casacore/measures/init.py", line 158, in direction
return self.measure(loc, rf)
File "/usr/local/lib/python3.10/dist-packages/python_casacore-3.5.2-py3.10-linux-x86_64.egg/casacore/measures/init.py", line 120, in measure
return _measures.measure(self, v, rf, off)
ImportError: numpy.core.multiarray failed to import
At this time I had not used my package manager to install the 'standard' casacore packages, so RMextract looked for and installed a python-casacore that had been compiled against numpy 1.22. The error comes from RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe i.e. The casecore build that you import is using numpy 1.22, whereas the 'standard' numpy distributed with ubuntu 22.04 is version 1.21
So ... I then deleted the output of the RMextract build, installed the casacore libraries from the package manager, and then built RMextract, et voila then things worked after I installed the CASA measures data. Anyway - just a heads up in case someone else encounters the same issue :) Cheers Tony