From wuyk21 at mails.tsinghua.edu.cn Tue Oct 18 17:51:46 2022 From: wuyk21 at mails.tsinghua.edu.cn (=?UTF-8?B?5ZC054eV5bq3?=) Date: Tue, 18 Oct 2022 23:51:46 +0800 (GMT+08:00) Subject: [mcxtrace-users] Errors when using Mirror_curved.comp and Mirror_elliptic.comp(McXtrace 1.7) Message-ID: <56ea5103.11334.183ebcb35f5.Coremail.wuyk21@mails.tsinghua.edu.cn> Hi to all. I am using McXtrace v1.7 to simulate Kirkpatrick-Baez focusing.Recently,I encountered some problems when I used two components (Mirror_curved.comp and Mirror_elliptic.comp) for X-ray optical tracing. The position of the cylindrical mirror was wrong. If this instrument contains Mirror_elliptic.comp, there will be an error that the compiler translates the instrument definition into a Monte Carlo simulation program provided in ISO-C,someparameters undeclared. When using a cylindrical mirror, the mirror will be extended from the center of the mirror, backward along the z-axis to the aperture position and forward along the z-axis to the length of a mirror. This is obviously not true. I have proven it in the attached document. But so far, I haven?t found the solution to this problem, and the purpose of writing this letter is to sincerely ask for advice. Any help would be appreciated. -- Yangkang WU -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Several_errors_occurred_during_simulation.pdf Type: application/pdf Size: 678980 bytes Desc: not available URL: From pkwi at fysik.dtu.dk Tue Oct 18 18:53:19 2022 From: pkwi at fysik.dtu.dk (=?utf-8?B?UGV0ZXIgS2rDpnIgV2lsbGVuZHJ1cA==?=) Date: Tue, 18 Oct 2022 16:53:19 +0000 Subject: [mcxtrace-users] Errors when using Mirror_curved.comp and Mirror_elliptic.comp(McXtrace 1.7) In-Reply-To: <56ea5103.11334.183ebcb35f5.Coremail.wuyk21@mails.tsinghua.edu.cn> References: <56ea5103.11334.183ebcb35f5.Coremail.wuyk21@mails.tsinghua.edu.cn> Message-ID: <0C5C361A-01B7-4C41-8F42-DEB2F843A60D@fysik.dtu.dk> Dear Yangkang Wu, Thank you for reaching out about your McXtrace 1.7 issues. In regard to your compilation-issue with Mirror_elliptic.comp you are completely right, the version shipped with v. 1.7 contained errors. The component has already been corrected by Antoine Pado from SOLEIL. You may download the updated component via this link: https://raw.githubusercontent.com/McStasMcXtrace/McCode/master/mcxtrace-comps/optics/Mirror_elliptic.comp In regard to your issue with Mirror_curved I am not completely convinced there is a problem, but will of course investigate further. In the meantime, please study how the component is used in the example instruments of your McXtrace 1.7 version. The mirror is in use in several instrument models: JJ_SAXS.instr MAXII_711.instr MAXII_811.instr MAXIV_Bloch.instr MAXIV_FemtoMAX.instr SOLEIL_ROCK.instr XFEL_SPB.instr In XFEL_SPB.instr Mirror_curved is used in a Kirkpatrick-Baez geometry and seems to work as expected. Best regards, Peter Willendrup On 18 Oct 2022, at 17.51, ??? > wrote: I am using McXtrace v1.7 to simulate Kirkpatrick-Baez focusing.Recently,I encountered some problems when I used two components (Mirror_curved.comp and Mirror_elliptic.comp) for X-ray optical tracing. The position of the cylindrical mirror was wrong. If this instrument contains Mirror_elliptic.comp, there will be an error that the compiler translates the instrument definition into a Monte Carlo simulation program provided in ISO-C,some parameters undeclared. When using a cylindrical mirror, the mirror will be extended from the center of the mirror, backward along the z-axis to the aperture position and forward along the z-axis to the length of a mirror. This is obviously not true. I have proven it in the attached document. But so far, I haven?t found the solution to this problem, and the purpose of writing this letter is to sincerely ask for advice. Any help would be appreciated. ________________________________ -- Yangkang WU _______________________________________________ mcxtrace-users mailing list mcxtrace-users at mcxtrace.org https://mailman2.mcxtrace.org/mailman/listinfo/mcxtrace-users Peter Kj?r Willendrup Forskningsingeni?r, Specialkonsulent N?stformand for DTU Fysik LSU DTU Physics [cid:b6339554-7f28-441d-9f31-5944f811397c at win.dtu.dk] Technical University of Denmark [cid:e108e480-fcab-46e2-9531-b38165079572 at win.dtu.dk] Department of Physics Fysikvej Building 307 DK-2800 Kongens Lyngby Direct +45 2125 4612 Mobil +45 2125 4612 Fax +45 4593 2399 pkwi at fysik.dtu.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 58 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 1055 bytes Desc: image002.gif URL: From pkwi at fysik.dtu.dk Tue Nov 1 13:51:52 2022 From: pkwi at fysik.dtu.dk (=?utf-8?B?UGV0ZXIgS2rDpnIgV2lsbGVuZHJ1cA==?=) Date: Tue, 1 Nov 2022 12:51:52 +0000 Subject: [mcxtrace-users] A couple of new bugs - with workarounds/fixes Message-ID: Dear all, Firstly, several users have reported a bug related to our pyqtgraph plotter, that ends up crashing with e.g. File "C:\mcstas-2.7.1\lib\tools\Python\mcplot\pyqtgraph\plotfuncs.py", line 203, in plot_Data2D img.scale(dx,dy) TypeError: scale(self): too many arguments' If you are in this situation, replace your plotfuncs.py with this new version: https://raw.githubusercontent.com/McStasMcXtrace/McCode/master/tools/Python/mcplot/pyqtgraph/plotfuncs.py Secondly, if are on a Mac and upgrade to macOS 13 Ventura (intel/x86_64), your already installed Python tools of McStas/McXtrace and /Application bundles may not work after the upgrade. A workaround is to: * In a terminal, start your ?McStas or McXtrace shell" (e.g. run mcstas-3.1-environment, /Applications/McXtrace-1.7-environment.command or /Applications/McXtrace-3.0.app/Contents/Resources/mcxtrace/3.0/environment) * Issue the command export PATH=$MCSTAS/miniconda3/bin:$PATH * Next, you may issue the your gui command with either * * mcgui or mxgui New releases of McStas and McXtrace are in preparation and should be released during November or December. Best and sorry for the inconvenience, Peter Willendrup Peter Kj?r Willendrup Forskningsingeni?r, Specialkonsulent N?stformand for DTU Fysik LSU DTU Physics [cid:b6339554-7f28-441d-9f31-5944f811397c at win.dtu.dk] Technical University of Denmark [cid:e108e480-fcab-46e2-9531-b38165079572 at win.dtu.dk] Department of Physics Fysikvej Building 307 DK-2800 Kongens Lyngby Direct +45 2125 4612 Mobil +45 2125 4612 Fax +45 4593 2399 pkwi at fysik.dtu.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 58 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 1055 bytes Desc: image002.gif URL: From pkwi at fysik.dtu.dk Fri Dec 16 14:51:11 2022 From: pkwi at fysik.dtu.dk (=?utf-8?B?UGV0ZXIgS2rDpnIgV2lsbGVuZHJ1cA==?=) Date: Fri, 16 Dec 2022 13:51:11 +0000 Subject: [mcxtrace-users] McXtrace 1.7.1 and McXtrace 3.1 released! Message-ID: Dear all, A new PAIR of releases of McXtrace: McXtrace "classic" v. 1.7.1 McXtrace "next-generation", v. 3.1 are both built and ready for download! Download and installation instructions are available via our GitHub INSTALL-doc pages. Selected highligts from the releases are listed below. The full list of changes for both releases is also available at our CHANGES_McXtrace document Please start your migration to 3.x: McXtrace 1.7.1 is very likely the "last update" to the 1.x series, sharing a subset of tool features with McXtrace 3.1. The Wiki has a dedicated section on McXtrace 1.x -> McXtrace 3.x conversion that includes: * An overview of differences * A nomenclature list containing short descriptions of new concepts and important keywords in McXtrace 3.x and OpenACC / CUDA code in general. * A document outlining the most importand differences between 1.x and 3.x. * A guide for 1.x -> 3.x instrument conversion. * A guide for 2.x -> 3.x component conversion. - If you are still in trouble, please write us a GitHub issue or an email to mcxtrace-users at mcxtrace.org Release highligts (!!3.1 only denotes features or improvements that are 3.1 specific!!) * Documentation & guides: * The component pages now include an extra column in the parameter-table. When filling in this column with wanted values, plus filling the entry-boxes for AT, ROTATED and instance name, pressing "Generate" will put a code-snipet for your component instance directly on your computer clipboard, for easy transfer to the mxgui editor or any other editor of choice! * mxdoc has been made "less picky" wrt. component and instrument structure for a more robust experience. * mxgui has a new "Docs" button for easier access to the generated mxdoc pages (that give easy access to components, instruments, manuals, datafiles and more. * Interoperability with other codes: * We have worked on the interface with MCPL (v. 1.6.1 included) and a mechanism was developed to automatically detect its location using the mcpl-config util. In practice this happens prior/during to the code-generation step, see below under mxrun. Thanks to Thomas Kittelmann (ESS) for your help in this area. * Tools: * mxrun has a new solution to support 3 new keywords CMD(), ENV() and GETPATH() through the DEPENDENCY line as collected by the code-generator. (see CHANGES doc for more details) * As mentioned above, mxdoc has been made "less picky" wrt. component and instrument structure and enriched with JavaScript for easy transfer of information to you editor. * mxplot(-pyqtgraph) has received a nice update with an infobar at the bottom of the window. The infobar is updated with coordinates of the cursor on the active plot, meaning that you can easily determine the coordinates of e.g. a peak. The code has also received a number of bugfixes relating to colorbars, the order of monitor output in overviews etc. Thanks to Tobias Weber (ILL) for your work on mxplot. * 3.1 only: The new mxdisplay-cad variant has come along, and is currently included in the form of a technology-preview. The code uses the Python module cadquery (https://github.com/CadQuery/cadquery) and is able to write e.g. STEP or STL output. For now, resolving the required dependencies is left to the user, but we foresee that this tool will mature over the coming releases. Thanks to Greg Tyler (ESS) for contributing this tool. * Components and Instruments: * 3.1 only: Most of the standard monitors will now fill in their own "instance name" as filename in case a filename was not defined. A small but very useful convenience. * The Isotropic_Sqw sample which can be used to model structure and dynamics in isotropic materials, such as powders and liquids has been added. The component is developed by Emmanuel Farhi and also exists in the McStas code. The component is currently in "Experimental" state in McXtrace. * Multiple new SOLEIL instruments have been added, thanks to lots of work from Antoine Pado, Stephane Bac and Emmanuel Farhi: * SOLEIL_ANATOMIX.instr tomography beam-line * SOLEIL_DISCO.instr in the imaging mode * SOLEIL_MARS.instr in the XRD mode * SOLEIL_PX2a.instr protein crystallography beam-line * The AstroX toolbox for simulating X-ray telescopes has been included as a special component category.3.1 only: GPU support in the related components/instruments is newly developed and likely not perfect in all cases. * Lens_elliptical.comp fixed * Grating_reflect.comp fixed, and created a test for it. * Udated/fixed Mirror_elliptic.comp and created a test for it. * Beamline ssrl 11-2 (in it's unfocused and uncollimated mode) added (related to work done on glitches). * Czerny_Turner instrument created. * Single_crystal component, corrected absorption cross-section. * Core and libs: * 3.1 only: Previously, any component present in a McXtrace instrument would trigger the transformation of every photon to its local coordinate system, even in the case of an Arm() (empty TRACE) without an EXTEND block. We now instead detect components with an empty TRACE that have no EXTEND block and are able to completely skip these in the calculation. This results in a speedup in case of instruments with many "empty" components. Thanks to Mads Bertelsen (ESS) for investigating the problem and finding a good solution. * 3.1 only: A new syntax called SHELL has been added to the grammar, allowing users to run a system command prior to code-generation. This may for instance be used to generate an instrument-snippet that you may %include in the instrument (think for-loops of an assembly of identical components). One could also imagine compilation of a needed library, wget of a data file etc. The synax is SHELL "command-to-execute" and it should be placed directly after a DEPENDENCY line within an instrument or component. We expect that applications and examples will come in the next couple of releases. * 3.1 only: Components may from McXtrace 3.1 request USERVARS that become part of the particle struct. (For the time being only in the form of basic C types like double, int etc. and corresponding arrays / pointers.) This will mean that e.g. the optimisations in Single_crystal and PowderN in SPLIT scenarios can be introduced also in GPU settings. * A flaw was spotted in our NeXus implementation in the case of event lists: A small chunk-size of (1,6) was used, leading to slow I/O and lots of size-overhead. Thanks to Simon Heybrock (ESS) for spotting this! Platforms: We still support 64bit Windows 10/11 on Intel, all recent 64bit macOS including 11.x - 13.x Monterey on both Intel and Apple Silicon/M1 processors. Debian/Ubuntu-based distros on Intel and Arm, our RPM-based distro is Fedora on Intel. (Official support for CentOS has been dropped, but you should be able to "roll your own" from the src packages.) Our Docker and binder containers will be updated within the following weeks. We hope you will enjoy these new releases!!! Seasons greetings on behalf of the McXtrace team, Peter Willendrup Peter Kj?r Willendrup Forskningsingeni?r, Specialkonsulent N?stformand for DTU Fysik LSU DTU Physics [image001.gif] Technical University of Denmark [image002.gif] Department of Physics Fysikvej Building 307 DK-2800 Kongens Lyngby Direct +45 2125 4612 Mobil +45 2125 4612 Fax +45 4593 2399 pkwi at fysik.dtu.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 58 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 1055 bytes Desc: image002.gif URL: