cyriltasse / DynSpecMS

0 stars 3 forks source link

latex error #7

Closed botteon closed 5 years ago

botteon commented 5 years ago

Hi, I bumped into the same issue for the second time after installing the ddf pipeline in a new machine (actually, a singularity). The pipeline crashes at the dynspec step with the following error

Traceback (most recent call last):
  File "/opt/DynSpecMS/ms2dynspec.py", line 123, in <module>
    main(args)
  File "/opt/DynSpecMS/ms2dynspec.py", line 98, in main
    SaveMachine.PlotSpec()
  File "/opt/DynSpecMS/ClassSaveResults.py", line 116, in PlotSpec
    pdf.savefig(bbox_inches='tight')
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 2529, in savefig
    figure.savefig(self, format="pdf", **kwargs)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/figure.py", line 2062, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 2212, in print_figure
    **kwargs)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 2586, in print_pdf
    self.figure.draw(renderer)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/figure.py", line 1493, in draw
    renderer, self, artists, self.suppressComposite)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/image.py", line 141, in _draw_list_compositing_images
    a.draw(renderer)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 2635, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/image.py", line 165, in _draw_list_compositing_images
    a.draw(renderer)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/axis.py", line 1192, in draw
    renderer)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/axis.py", line 1130, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/text.py", line 922, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/text.py", line 300, in _get_layout
    ismath=False)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 2148, in get_text_width_height_descent
    renderer=self)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/texmanager.py", line 501, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/texmanager.py", line 365, in make_dvi
    texfile], tex)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/matplotlib/texmanager.py", line 335, in _run_checked_subprocess
    stderr=subprocess.STDOUT)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/subprocess32.py", line 334, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/subprocess32.py", line 614, in __init__
    restore_signals, start_new_session)
  File "/opt/matplotlib-2.2.3/lib/python2.7/site-packages/subprocess32.py", line 1393, in _execute_child
    raise child_exception_type(errno_num, err_msg)
OSError: [Errno 2] No such file or directory: 'latex'
 - 14:59:52 - ClearSHM                  | Clear shared memory
 - 14:59:52 - ClearSHM                  | Clear Semaphores
 - 14:59:52 - ClearSHM                  | Clear shared dictionaries
FAILED to run ms2dynspec.py --ms mslist-L602890.txt --data DATA_DI_CORRECTED --model DD_PREDICT --sols DDS3_full_smoothed --rad 2. --image image_full_ampphase_di_m.NS.app.restored.fits --LogBoring 0 --SolsDir SOLSDIR: return value is 1
Traceback (most recent call last):
  File "/opt/ddf-pipeline/scripts/pipeline.py", line 1517, in <module>
    main(o)
  File "/opt/ddf-pipeline/scripts/pipeline.py", line 1421, in main
run(runcommand,dryrun=o['dryrun'],log=logfilename('ms2dynspec.log'),quiet=o['quiet'])
  File "/opt/ddf-pipeline/utils/auxcodes.py", line 54, in run
    die('FAILED to run '+s+': return value is '+str(retval))
  File "/opt/ddf-pipeline/utils/auxcodes.py", line 36, in die
    raise Exception(s)
Exception: FAILED to run ms2dynspec.py --ms mslist-L602890.txt --data DATA_DI_CORRECTED --model DD_PREDICT --sols DDS3_full_smoothed --rad 2. --image image_full_ampphase_di_m.NS.app.restored.fits --LogBoring 0 --SolsDir SOLSDIR: return value is 1

In both the machines pip install latex didn't fix the problem. In the previous installation I momentarily "fixed" the error by commenting this line of the script https://github.com/cyriltasse/DynSpecMS/blob/6d1767b54c1d8f2378fd4382c45dd8d224e282d0/ms2dynspec.py#L39

Also Pepe had this problem, so I thought that it was the time to open an issue here.

rvweeren commented 5 years ago

I have the same issue also.

botteon commented 5 years ago

Note that to "solve" this issue you have to comment the same line also in ClassSaveResults.py

https://github.com/cyriltasse/DynSpecMS/blob/6d1767b54c1d8f2378fd4382c45dd8d224e282d0/ClassSaveResults.py#L142

nudomarinero commented 5 years ago

I can confirm that commenting these two lines the software works.

mhardcastle commented 5 years ago

Merged Pepe's PR to fix this.