readout_dc cause error on solution.plot()
The following file:
import finesse
from finesse.analysis.actions import Series, Xaxis, Temporary
base = finesse.Model()
base.parse("""
l l1 P=1
m m1 R=0.9 T=0.1 phi=0
m m2 R=0.9 T=0.1 phi=0
link(l1, m1, m2)
readout_dc pow m2.p2.o output_detectors=true
#pd pow m2.p2.o
"""
)
out= Xaxis('m2.phi','lin',0,180,200, name='scan').run(base)
out.plot()
gives this error:
IndexError: tuple index out of range
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
src/finesse/solutions/array.pyx in finesse.solutions.array.ArraySolution.__getitem__()
ValueError: no field of name pow
During handling of the above exception, another exception occurred:
IndexError Traceback (most recent call last)
/var/folders/_w/3m8p5y9x46d2bsn15yrfvj7w0000gn/T/ipykernel_16588/1236773292.py in <module>
15
16 out= Xaxis('m2.phi','lin',0,180,200, name='scan').run(base)
---> 17 out.plot()
src/finesse/solutions/array.pyx in finesse.solutions.array.ArraySolution.plot()
~/git/simulation/finesse3/src/finesse/plotting/plot.py in plot(self, detectors, log, logx, logy, degrees, cmap, show, separate, _test_fig_handles)
1504 degrees,
1505 )
-> 1506 self.__handle_detector_plotting(
1507 detector_type_map,
1508 cmap,
~/git/simulation/finesse3/src/finesse/plotting/plot.py in __handle_detector_plotting(self, detector_type_map, cmaps, figures, animations, logx, logy, log, degrees)
775
776 if self.out.axes == 1:
--> 777 self.__plot_1D(det_type, dets, logx, logy, degrees, figures)
778 elif self.out.axes == 2:
779 self.__plot_2D(det_type, dets, log, degrees, cmaps, figures)
~/git/simulation/finesse3/src/finesse/plotting/plot.py in __plot_1D(self, det_type, dets, logx, logy, degrees, figures, allfigs)
808
809 for det in dets:
--> 810 data = self.out[det]
811
812 if mag_and_phase:
src/finesse/solutions/array.pyx in finesse.solutions.array.ArraySolution.__getitem__()
src/finesse/solutions/base.pyx in finesse.solutions.base.BaseSolution.__getitem__()
IndexError: tuple index out of range
Commenting out the readout_dc
and using the pd
instead correctly produces the plot.