libstempo icon indicating copy to clipboard operation
libstempo copied to clipboard

utf-8 error, when load par file

Open jlzhang001 opened this issue 3 years ago • 7 comments

When I try to run libstempo-toasim-demo.ipynb, it shows utf-8 error. The detail info pasted below. Could you help me to check this problem? Thanks. @vallis @mattpitkin

Python version : 3.7.12 libstempo version: 2.4.5 Tempo2 version : 2022.5.1

UnicodeDecodeError Traceback (most recent call last) /tmp/ipykernel_27615/1593190486.py in 1 psr = T.tempopulsar(parfile = T.data + 'B1953+29_NANOGrav_dfg+12.par', ----> 2 timfile = T.data + 'B1953+29_NANOGrav_dfg+12.tim') 3 LP.plotres(psr)

libstempo/libstempo.pyx in libstempo.libstempo.tempopulsar.cinit()

libstempo/libstempo.pyx in libstempo.libstempo.tempopulsar._readflags()

libstempo/libstempo.pyx in libstempo.libstempo.lambda1()

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 0: invalid continuation byte

jlzhang001 avatar Sep 05 '22 06:09 jlzhang001

Hi, I just noticed that I had the same error. My solution was using the previous version of libstempo: 2.4.3?

astrophysics91 avatar Dec 07 '22 13:12 astrophysics91

It was working for me

astrophysics91 avatar Dec 07 '22 13:12 astrophysics91

Hi, I just noticed that I had the same error. My solution was using the previous version of libstempo: 2.4.3?

I installed the previous version of libstempo=2.4.3, but when I tried to load J1909-3744_NANOGrav_dfg+12.par and the corresponding timfile, there is another error message showing up "Segmentation fault (core dumped)". Did you encounter this error before?

Python version=3.10.4, Tempo2 version: 2021.7.1.

F-W-Yang avatar Oct 09 '23 13:10 F-W-Yang

Hi, I just noticed that I had the same error. My solution was using the previous version of libstempo: 2.4.3?

I installed the previous version of libstempo=2.4.3, but when I tried to load J1909-3744_NANOGrav_dfg+12.par and the corresponding timfile, there is another error message showing up "Segmentation fault (core dumped)". Did you encounter this error before?

Python version=3.10.4, Tempo2 version: 2021.7.1.

For those who have the same issue, you can conda install an older version of libstempo=2.4.0 (which will automatically installed an old version of Tempo2=2020.111) to solve the above error. It seems that the incompatibility between the new version of Tempo2 and the version of the Python wrapper libstempo causes the error.

By the way, in my conda environment, the Python version = 3.6.13.

F-W-Yang avatar Oct 16 '23 19:10 F-W-Yang

@jlzhang001 @F-W-Yang can you confirm whether this is still an issue with the latest versions of libstempo/tempo2?

mattpitkin avatar Jul 24 '24 09:07 mattpitkin