olebole / python-cpl

Python bindings for CPL recipes
http://pypi.python.org/pypi/python-cpl
GNU General Public License v2.0
10 stars 5 forks source link

Problem Download EsoRex #11

Closed fmenat closed 6 years ago

fmenat commented 6 years ago

Hi, im trying to use your library that looks so good and I sees zero recipes on my list...

I download and install the last version of EsoRex from this link: http://www.eso.org/sci/software/cpl/download.html And when init cpl i do: cpl.esorex.init(mylinkto esorex.rc)

But when i execute cpl.Recipe.list() -> show empty []

Im not sure if i do it something wrong or I need something else.

Greetings.

olebole commented 6 years ago

You don't need Esorex at all. If the list is empty, then propably the recipe path does not correspond to the installation of your recipes. If the recipes are install in /usr/lib/esopipes/, then this should be set:

import cpl
cpl.Recipe.path = '/usr/lib/esopipes'

Could you give some details which pipeline you are using and where it is installed? Best regards

Ole

fmenat commented 6 years ago

Oh ok!, thanks. Im trying now with the last version source kit of MUSE (ftp://ftp.eso.org/pub/dfs/pipelines/muse/muse-kit-2.0.3.tar.gz)

I successful installed it but when i put the path to esopipes also show empty list.

I tried: cpl.Recipe.path="/link/to/install/lib/esopipes-plugins/muse-2.0.3/" cpl.Recipe.path="/link/to/install/lib/esopipes-plugins/"

I install the source kit of MUSE on my $HOME folder.

fmenat commented 6 years ago

Hi! More detail about what happening me.

I use anaconda2 and install this library by https://anaconda.org/conda-forge/python-cpl

Now i trying open it inside the recipes folder and get this:

In [1]: import cpl In [2]: cpl.Recipe.path='.' In [3]: cpl.Recipe.get_libs() Out[3]: ['./muse_standard.so', './muse_qi_mask.so', './muse_scipost.so', './muse_create_sky.so', './muse_scipost_subtract_sky_simple.so', './muse_scipost_make_cube.so', './muse_scipost_combine_pixtables.so', './muse_geometry.so', './muse_scipost_subtract_sky.so', './muse_wavecal.so', './muse_flat.so', './muse_scipost_calibrate_flux.so', './muse_scipost_correct_dar.so', './muse_scipost_correct_rv.so', './muse_exp_align.so', './muse_astrometry.so', './muse_lingain.so', './muse_scibasic.so', './muse_scipost_apply_astrometry.so', './muse_exp_combine.so', './muse_lsf.so', './muse_twilight.so', './muse_ampl.so', './muse_bias.so', './muse_dark.so']

In [4]: cpl.Recipe.list() Out[4]: []

And when i execute the test provided in this github TestRecepy.py got this message error:

gcc: error: /tmp/tmp9Th_Yo/rtest.o: No such file or directory Ertest.c:21:17: fatal error: cpl.h: No such file or directory

include

             ^

compilation terminated.

Hope this give more detail about what I am doing wrong

olebole commented 6 years ago

To get the CPL test working, you need CPL installed (headers and libraries). The other looks mystic. Are you sure that the recipes are properly linked? What does ldd /link/to/install/lib/esopipes-plugins/muse-2.0.3/muse_scibasic.so give you? Is everything resolved? Should look like

$ ldd /usr/lib/x86_64-linux-gnu/cpl/plugins/muse-2.0.3/muse_scibasic.so 
    linux-vdso.so.1 (0x00007ffdbfd88000)
    libmuse.so.36 => /usr/lib/x86_64-linux-gnu/muse-2.0.3/libmuse.so.36 (0x00007f7006d08000)
    libcplcore.so.26 => /usr/lib/x86_64-linux-gnu/libcplcore.so.26 (0x00007f70069ba000)
    libcpldfs.so.26 => /usr/lib/x86_64-linux-gnu/libcpldfs.so.26 (0x00007f70067a1000)
    libcplui.so.26 => /usr/lib/x86_64-linux-gnu/libcplui.so.26 (0x00007f7006584000)
    libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f7006355000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7006051000)
    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f7005e3a000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7005c1d000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7005880000)
    libcpldrs.so.26 => /usr/lib/x86_64-linux-gnu/libcpldrs.so.26 (0x00007f7005657000)
    libcext.so.0 => /usr/lib/x86_64-linux-gnu/libcext.so.0 (0x00007f700543c000)
    libcfitsio.so.5 => /usr/lib/x86_64-linux-gnu/libcfitsio.so.5 (0x00007f7005063000)
    libfftw3.so.3 => /usr/lib/x86_64-linux-gnu/libfftw3.so.3 (0x00007f7004c5f000)
    libfftw3f.so.3 => /usr/lib/x86_64-linux-gnu/libfftw3f.so.3 (0x00007f7004851000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f70071cf000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f700464d000)
    libwcs.so.5 => /usr/lib/x86_64-linux-gnu/libwcs.so.5 (0x00007f70042f5000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f70040db000)
    libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f7003ecb000)
fmenat commented 6 years ago

Now I link CPL headers and libraries and can execute the test. When i execute ldd muse_scibasci.so is all good.

linux-vdso.so.1 =>  (0x00007ffdf67c2000)
libmuse.so.36 => /home/panshop/Desktop/EsoRex/pipeline/lib/muse-2.0.3/libmuse.so.36 (0x00007f3e1a773000)
libcplui.so.26 => /home/panshop/Desktop/EsoRex/pipeline/lib/libcplui.so.26 (0x00007f3e1a55a000)
libcplcore.so.26 => /home/panshop/Desktop/EsoRex/pipeline/lib/libcplcore.so.26 (0x00007f3e1a20d000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f3e19fd0000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3e19db2000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3e199e8000)
libcpldfs.so.26 => /home/panshop/Desktop/EsoRex/pipeline/lib/libcpldfs.so.26 (0x00007f3e197d1000)
libcpldrs.so.26 => /home/panshop/Desktop/EsoRex/pipeline/lib/libcpldrs.so.26 (0x00007f3e195a7000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3e1929e000)
libcfitsio.so.2 => /home/panshop/Desktop/EsoRex/pipeline/lib/libcfitsio.so.2 (0x00007f3e18eb9000)
libcext.so.0 => /home/panshop/Desktop/EsoRex/pipeline/lib/libcext.so.0 (0x00007f3e18ca3000)
libfftw3.so.3 => /home/panshop/Desktop/EsoRex/pipeline/lib/libfftw3.so.3 (0x00007f3e188a3000)
libfftw3f.so.3 => /home/panshop/Desktop/EsoRex/pipeline/lib/libfftw3f.so.3 (0x00007f3e18495000)
/lib64/ld-linux-x86-64.so.2 (0x0000563358c50000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3e18290000)
libwcs.so.4 => /home/panshop/Desktop/EsoRex/pipeline/lib/libwcs.so.4 (0x00007f3e17f8b000)

I dont know what can be the problem.

olebole commented 6 years ago

Sorry, no idea what the problem is. Does esorex --recipes show them?

fmenat commented 6 years ago

Yes, esorex --recipes show all the recipes installed.

Now Im trying to install this library by the github clone and python setup.py install.

When I import cpl give me this error:


ImportError Traceback (most recent call last)

in () ----> 1 import cpl /home/panshop/Desktop/EsoRex/python-cpl/cpl/__init__.py in () 21 from .version import license_ as __license__ 22 ---> 23 from .recipe import Recipe 24 from .param import Parameter 25 from .frames import FrameConfig /home/panshop/Desktop/EsoRex/python-cpl/cpl/recipe.py in () 13 import pyfits as fits 14 ---> 15 from . import CPL_recipe 16 from .frames import FrameList, mkabspath, expandframelist 17 from .result import Result, RecipeCrash ImportError: cannot import name CPL_recipe Maybe something about that can be?
olebole commented 6 years ago

You should run that outside of the python-cpl directory.

fmenat commented 6 years ago

Oh right, outside the python-cpl directory didnt get the error, but still got the Recipe.list() empty and the Recipe.get_libs() show me all the recipes, thats why i was thinking maybe is a problem with the CPL_recipe and my installation?

olebole commented 6 years ago

No; CPL_recipe is a C extension that needs to be built (which is OK, if there is no complaint). Does something like

bias = cpl.Recipe('muse_bias`)

work?

fmenat commented 6 years ago

Executing cpl.Recipe('muse_bias`)

give me this error: IOError: Recipe 'muse_bias' not found at path ['/home/panshop/Desktop/EsoRex/pipeline/lib/esopipes-plugins']

olebole commented 6 years ago

Sorry, I have no more ideas. When you can run the test recipe, then everything works fine. You could still do a

$ objdump -T /usr/lib/x86_64-linux-gnu/cpl/plugins/muse-2.0.3/muse_scibasic.so |fgrep Base
0000000000209380 g    DO .bss   0000000000000008  Base        .gomp_critical_user_muse_processing_used_frames
0000000000209378 g    D  .data  0000000000000000  Base        _edata
0000000000209388 g    DO .bss   0000000000000008  Base        .gomp_critical_user_muse_processing_output_frames
0000000000209390 g    D  .bss   0000000000000000  Base        _end
0000000000209378 g    D  .bss   0000000000000000  Base        __bss_start
0000000000002538 g    DF .init  0000000000000000  Base        _init
00000000000053c0 g    DF .text  00000000000000dc  Base        cpl_plugin_get_info
0000000000005f24 g    DF .fini  0000000000000000  Base        _fini
0000000000005990 g    DF .text  0000000000000592  Base        muse_scibasic_compute

and check that there is really cpl_plugin_get_info. And you could check with esorex that f.e.

$ esorex muse_scibasic --man-page

shows the documentation of muse_scibasic. But if both is OK, I have no further idea.

fmenat commented 6 years ago

Hi!, sorry for the later response, I executed the last you say and i got this:

esorex muse_scibasic --man-page

 ***** ESO Recipe Execution Tool, version 3.12.3  *****

21:47:28 [ ERROR ] esorex: Command line parameter '--man-page' not recognized 21:47:28 [ ERROR ] esorex: Unable to continue parsing command line options

I also fix it switching the machine, I was trying to install it on a Ubuntu 16.04 and change it to Centos 7 and now I can use Python-cpl, thanks a lot of the tool, is very cool.

olebole commented 6 years ago

Put the --man-page before the recipe. From your success on Centos, I would however assume that the problem is somehow locally in your Ubuntu setup and will close this issue if you don't disagree.

fmenat commented 6 years ago

With the "--man-page" before the recipe is all good, I really dont know why doesnt work on my Ubuntu. I hope in the future I can contribute if I fix it, so for now I will use on Centos, I aggree to close the issue, thank you very much for the help :)