guaix-ucm / megaradrp

MEGARA (Multi-Espectrógrafo en GTC de Alta Resolución para Astronomía) is a facility instrument designed for the 10.4m GTC telescope in La Palma (Spain).
https://guaix.fis.ucm.es/megara/
GNU General Public License v3.0
12 stars 6 forks source link

insert_fibers_in_extension.py not working under "megara" conda environment (under py3.6?) #218

Closed gildepaz closed 6 years ago

gildepaz commented 6 years ago

The insert_fibers_in_extension.py program (added as an attachment to this issue; renamed as .txt extension for github to allow me attach it insert_fibers_in_extension.txt ) works when used outside the "megara" conda environment running python 2.7 but gives the following error when used under the "megara" conda environment in python 3.6. The error is:

(megara3) bash-3.2$ python insert_fibers_in_extension.py 0001252338-20170629-MEGARA-MegaraLcbImage.fits File "insert_fibers_in_extension.py", line 30 print error ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print error)?

sergiopasra commented 6 years ago

Yes, this is a Python3 incompatibility

sergiopasra commented 6 years ago

This file is not the version in master. From where did you get the file?

acasmor commented 6 years ago

I have it! don´t remember from where...

sergiopasra commented 6 years ago

This is an old version. The current one is under tools in the repository

gildepaz commented 6 years ago

I have used the version in github/megaradrp/tools (right after updating everything) within the conda environment and I get the error: (megara) bash-3.2$ python ./insert_fibers_in_extension.py 0001251666-20170626-MEGARA-MegaraLcbImage.fits Traceback (most recent call last): File "./insert_fibers_in_extension.py", line 50, in fibers = create_fibers(args.slit) File "./insert_fibers_in_extension.py", line 21, in create_fibers default_hdr = StringIO(data) TypeError: initial_value must be str or None, not bytes

If I try this outside the environment with /Users/agpaz/anaconda3/bin/python ./insert_fibers_in_extension.py 0001251666-20170626-MEGARA-MegaraLcbImage.fits it gives the same error but IT WORKS if I use instead: /Users/agpaz/anaconda2/bin/python ./insert_fibers_in_extension.py 0001251666-20170626-MEGARA-MegaraLcbImage.fits

gildepaz commented 6 years ago

Is it OK to close an "issue" just because it was moved as part of a milestone?

gildepaz commented 6 years ago

Sorry, I saw that it was closed as part of "aa959d: Decode data from StringIO (Python3)" before rising my question.