TFITSHDU very slow in reading file inside jupyter notebook

I am trying to use TFITSHDU class to read a fits file using the ROOT kernel of a jupyter notebook running on a centos7 machine. The ROOT has been started with

root --notebook

and then connect with my browser.
When I try to read the fits file with the code

TFITSHDU f0("my_fits_file.fits",0);

the ROOT kernel takes a lot of time (few minute) to read the file. If i check which process is running con I see python2.7 running.
If I do the same in normal interactive root session the file is read immediately.

Is there any setting that have to be tuned speed up the system? Is this related to the version of python?

Thanks a lot

ROOT Version: v6.18/04
Platform: centos7
Compiler: gcc

Hi Stefano,

Could you attach the fits file that you are using so that I can try to reproduce?



You can take from here, it is ~40 MB.


Thanks Stefano, I was able to reproduce also with master (you did already with 6.18).

ROOT prompt is ok, PyROOT is ok, but ROOT C++ Jupyter kernel takes a long time to run that line.

I don’t have an explanation yet (I am intrigued), I will get back to you.

Hi Stefano,

The reason for the hanging does not have anything to do with TFITSHDU. It has to do with the name of the file.

In the ROOT C++ Jupyter kernel, we define a couple of regular expressions to match identifiers and function calls in the code you type in the cell. Those expressions are applied by Jupyter (in particular, the metakernel package) and, when there is a long string in it, it can take a looong time to pre-process that cell.

So in the end, if you just run your code with a shorter file name (e.g. my_fits_file.fits, instead of nisp_em_test_NOM_20190423_151617_00014_000001.lv1) you should not see it hanging. On our side, we will try to optimize those expressions.

I confirm that if the name is short the file is opened very quickly. Creating a symbolic link is also enough to make jupyter to open quickly the file.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.