Coder Social home page Coder Social logo

Comments (6)

kklmn avatar kklmn commented on May 27, 2024

Hi,
Thank you for reporting the error! And sorry for the bug, we don't use this backend and haven't tested it for a long time.
I've fixed the bug, please get the new version of plotter.py or of the whole xrt and give it a try.

from xrt.

Zeng24 avatar Zeng24 commented on May 27, 2024

I am sorry to disturbe you again about the problem in operating xrt with shadow. It is important to me.
When I operate the code in the Page https://xrt.readthedocs.io/shadow.html#scriptingshadow

import xrt.runner as xrtr
import xrt.plotter as xrtp
plot1 = xrtp.XYCPlot('star.01')
xrtr.run_ray_tracing(plot1, repeats=40, updateEvery=2, threads=1)

there will be something wrong

Exception in Tkinter callback
Traceback (most recent call last):
  File "D:\anaconda\envs\py37\lib\tkinter\__init__.py", line 1702, in __call__
    return self.func(*args)
  File "D:\anaconda\envs\py37\lib\tkinter\__init__.py", line 746, in callit
    func(*args)
  File "D:\anaconda\envs\py37\lib\site-packages\matplotlib\backends\_backend_tk.py", line 118, in _on_timer
    TimerBase._on_timer(self)
  File "D:\anaconda\envs\py37\lib\site-packages\matplotlib\backend_bases.py", line 1194, in _on_timer
    ret = func(*args, **kwargs)
  File "D:\anaconda\envs\py37\lib\site-packages\xrt\plotter.py", line 1097, in timer_callback
    runner.dispatch_jobs()
  File "D:\anaconda\envs\py37\lib\site-packages\xrt\runner.py", line 181, in dispatch_jobs
    one_iteration()
  File "D:\anaconda\envs\py37\lib\site-packages\xrt\runner.py", line 211, in one_iteration
    bl.forceAlign = False
AttributeError: 'NoneType' object has no attribute 'forceAlign'

If I operate the code '00_simple.py'in the github https://github.com/kklmn/xrt/tree/master/examples/withShadow/00_02

# -*- coding: utf-8 -*-
"""The simplest example of using shadow with xrt."""
__author__ = "Konstantin Klementiev"
__date__ = "1 Mar 2012"
import sys
sys.path.append(r"c:\Alba\Ray-tracing\with Python")
import xrt.runner as xrtr
import xrt.plotter as xrtp
plot1 = xrtp.XYCPlot('star.01')
plot1.caxis.fwhmFormatStr = None
xrtr.run_ray_tracing(plot1, repeats=40, updateEvery=2, backend='shadow')

there is also something wrong about the program,and always print the massege "('not readable',) , ignored..."
I don't understand where is the problem is. But using the backend of shadow is very important to accomplish my experiment. please help me.
I wish to hear from you again

from xrt.

kklmn avatar kklmn commented on May 27, 2024

Hi,

I've now fixed the Shadow backend (please download from GitHub) and checked it with the example ...\examples\withShadow\00_02\00_simple.py.

I ran it with Shadow 2.3, and I've never tried a newer version. It can be that newer versions do not produce bat files anymore. Then you have to create shadow-source.bat and shadowvui.bat yourself.

The 'not readable' error may still appear from time to time due to concurrent file reading-writing.
If every iteration results in this error then Shadow doesn't produce the expected resulting files. In this case, run shadow-source.bat and shadowvui.bat from the command shell and explore the output.

from xrt.

Zeng24 avatar Zeng24 commented on May 27, 2024

Thanks a lot that you solve the problem of backend. I think the application you develop is very good, but I wanna use it to handle the data from Shadow3, and translate the data into the picture to absorve the beam like xrtglow'picture. How should I do?

from xrt.

kklmn avatar kklmn commented on May 27, 2024

To use Shadow3 in xrt would mean a new backend. Since none of us needs it, we are not going to develop it.

Only if you (or another interested person) can provide a proper readout function, similar to
xrt.backends.shadow.get_output(), I can look at connecting Shadow3 to xrt.

from xrt.

Zeng24 avatar Zeng24 commented on May 27, 2024

OK, thank you for your help.

from xrt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.