Closed anetasie closed 7 years ago
Hi Aneta,
Two possibilities:
1) the prerequisites are not installed or not working properly 2) the ds9 script isn't pointing to the right place.
Test (1) by trying to run the standalone version of the code,
/usr/local/lib/python2.7/dist-packages/radioflux/radioflux.py -h
(replace /usr/local/lib by wherever your system installs local packages). If it runs the prerequisites are all set up.
Test (2) by looking at the ds9 script you're running and see that it points to the correct full path to the code. I wonder if you have just used the version of radio-flux.ds9 in the install directory rather than the version that is generated by setup.py (and put somewhere else)? If it has the word REPLACE in it, you're using the wrong version. setup.py creates a new version that has the correct full path to the python script, and prints out its location.
If you're still having trouble having tried this let me know. I should probably improve the documentation!
Cheers
Martin
On Fri, Jan 24, 2014 at 02:09:22PM -0800, Aneta Siemiginowska wrote:
Hi Martin,
Great idea! We just installed the plug-in in my anaconda python directories. I can load the plug-in via Analysis menu with no trouble, but I do not see any response when I place the region and try to use it. No pop-up window or any re-action from ds9.
Should I have a pyds9 installed? I did not think so, but it looks like the tool is not running. Is there a way to debug it?
Thanks Aneta
- Reply to this email directly or view it on GitHub.
Hi Martin,
I can access the standalone tool and it looks like it's installed ok, but I get an error from WCS, when I try to run it for a file. I tried different radio data files, and the result is always the same. Do you have a test file to try after the installation?
Here are the screen outputs:
INSTALLED:
(conda)waimea-100: python setup.py install running install running build running build_py creating build creating build/lib creating build/lib/radioflux copying radioflux/init.py -> build/lib/radioflux copying radioflux/radioflux-ds9.py -> build/lib/radioflux copying radioflux/radioflux.py -> build/lib/radioflux running install_lib creating /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux copying build/lib/radioflux/init.py -> /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux copying build/lib/radioflux/radioflux-ds9.py -> /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux copying build/lib/radioflux/radioflux.py -> /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux byte-compiling /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/init.py to init.pyc byte-compiling /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux-ds9.py to radioflux-ds9.pyc byte-compiling /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux.py to radioflux.pyc running install_data creating /data/waimea2/Software/anaconda/ds9 copying radio-flux.ds9 -> /data/waimea2/Software/anaconda/ds9 running install_egg_info Writing /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux-1.0-py2.7.egg-info Running post-install
TRYING COMMAND LINE: python /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux.py -h usage: radioflux.py [-h] [-f FGR] [-b BGR] [-s] FILE [FILE ...]
Measure fluxes from FITS files.
positional arguments: FILE FITS files to process
optional arguments: -h, --help show this help message and exit -f FGR, --foreground FGR Foreground region file to use -b BGR, --background BGR Background region file to use -s, --subtract Subtract background
HERE IS THE ERROR from the command line:
python /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux.py -f test.reg MERLIN.5ghz.0.05asec.fits.gz
ERROR: AttributeError: 'NoneType' object has no attribute 'NoWcsKeywordsFoundError' [astropy.wcs.wcs]
Traceback (most recent call last):
File "/data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux.py", line 98, in
Hi Aneta
that's weird. I imagine that's also the problem with the plugin, so if we fix the one, we fix the other.
Let's just try with some data that works for me. Do
wget http://www.extragalactic.info/~mjh/3C305.KABC.FITS.gz wget http://www.extragalactic.info/~mjh/ds9.reg
then I get
/usr/local/lib/python2.7/dist-packages/radioflux/radioflux.py -f ds9.reg 3C305.KABC.FITS.gz 3C305.KABC.FITS.gz 2.23351e+10 0.00542198898457
If that doesn't work for you then I think the problem is with your pyregion/astropy install. Have you tried a
pip install pyregion --upgrade
?
If that does work for you, send me a copy of the data where it fails and I'll see if I can figure out the problem.
Cheers
Martin
On Mon, Jan 27, 2014 at 09:15:27AM -0800, Aneta Siemiginowska wrote:
Hi Martin,
I can access the standalone tool and it looks like it's installed ok, but I get an error from WCS, when I try to run it for a file. I tried different radio data files, and the result is always the same. Do you have a test file to try after the installation?
Here are the screen outputs:
INSTALLED:
(conda)waimea-100: python setup.py install running install running build running build_py creating build creating build/lib creating build/lib/radioflux copying radioflux/init.py -> build/lib/radioflux copying radioflux/radioflux-ds9.py -> build/lib/radioflux copying radioflux/radioflux.py -> build/lib/radioflux running install_lib creating /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux copying build/lib/radioflux/init.py -> /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux copying build/lib/radioflux/radioflux-ds9.py -> /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux copying build/lib/radioflux/radioflux.py -> /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux byte-compiling /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/init.py to init.pyc byte-compiling /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux-ds9.py to radioflux-ds9.pyc byte-compiling /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux.py to radioflux.pyc running install_data creating /data/waimea2/Software/anaconda/ds9 copying radio-flux.ds9 -> /data/waimea2/Software/anaconda/ds9 running install_egg_info Writing /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux-1.0-py2.7.egg-info Running post-install
TRYING COMMAND LINE: python /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux.py -h usage: radioflux.py [-h] [-f FGR] [-b BGR] [-s] FILE [FILE ...]
Measure fluxes from FITS files.
positional arguments: FILE FITS files to process
optional arguments: -h, --help show this help message and exit -f FGR, --foreground FGR Foreground region file to use -b BGR, --background BGR Background region file to use -s, --subtract Subtract background
HERE IS THE ERROR from the command line:
python /data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux.py -f test.reg MERLIN.5ghz.0.05asec.fits.gz ERROR: AttributeError: 'NoneType' object has no attribute 'NoWcsKeywordsFoundError' [astropy.wcs.wcs] Traceback (most recent call last): File "/data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux.py", line 98, in rm=radiomap(fitsfile) File "/data/waimea2/Software/anaconda/lib/python2.7/site-packages/radioflux/radioflux.py", line 48, in init w=wcs.WCS(self.prhd) File "/usr/local/lib/python2.7/site-packages/astropy-0.3.dev3921-py2.7-linux-x86_64.egg/astropy/wcs/wcs.py", line 316, in init except _wcs.NoWcsKeywordsFoundError: AttributeError: 'NoneType' object has no attribute 'NoWcsKeywordsFoundError'
- Reply to this email directly or view it on GitHub.
Hi Martin,
It failed on your file, so it is something in my python versions. I updated astropy to the most recent released version and pyregion seems to be up to date too. I'll investigate the issue on my end and let you know if I get this sorted out.
Thanks Aneta
Hi Aneta, I am having this dame problem and was wondering if you managed to fix it.
Many Thanks.
Kenneth
Kenneth, did you try the tests that I suggested to Aneta? Radioflux still works for me with the latest versions of astropy etc...
Hi Kenneth, It does work for me on the command line. I'm using anaconda and installed both the most recent version of astropy and pyregion. I still have issues with loading it directly into ds9, but I did not try to figure this out. I only use the command line. Aneta
If the command line works but the ds9 plugin doesn't, almost certainly the path in the ds9 plugin is wrong. The install script has to write the full path of the python code into the ds9 plugin, and it doesn't always work, though I don't myself have access to any system where it doesn't. Hand-editing the .ds9 file can solve this problem.
Hi both, I managed to get it to work. mhardcastle is right, you have to manually edit the install python scripts and replace "#!/usr/bin/python" with "#!/path-to-anaconda/bin/python" and re-install. That fixed it for me. Many thanks to you both.
However, I still have issues on a mac machine. The problem here is quite different from a linux machine. Here, I cannot get ds9 to draw my regions. I have to manually create regions files. Is this just me or is it a general problem with mac?
Thanks.
Kenneth
Ah, I have made a slight change to the code that might make it work better with Anaconda in the future.
As far as regions are concerned, no, ds9 should be able to create and display them fine on a Mac. Have you tried upgrading your ds9 version?
Hi Martin, Yes I have tried doing that, and the issue is the same. I actually installed the two versions of ds9 for mac mavericks and the situation is the same. I was just curious to know if perhaps I should have done something before installing Thanks
Not that I know of, I'm afraid. What exactly happens when you try to draw a region?
Nothing happens. I tried on two different mac machines and it was same.
The default settings for Edit tab have been changed to None in the recent release of ds9. You need to changed this to Region. Not sure that this is the source of your problem, but I was definitely confused by that change.
wow, such a simple fix :) Thanks a lot Aneta, it worked
Hi Martin,
Great idea! We just installed the plug-in in my anaconda python directories. I can load the plug-in via Analysis menu with no trouble, but I do not see any response when I place the region and try to use it. No pop-up window or any re-action from ds9.
Should I have a pyds9 installed? I did not think so, but it looks like the tool is not running. Is there a way to debug it?
Thanks Aneta