Re: [sr #3211] Provide veusz plots as an alternative to grace
On 9 February 2015 at 08:08, Justin (jlec) j...@gentoo.org wrote: On 08/02/15 22:05, Edward d'Auvergne wrote: Hi Justin, Here is another resource that may be of assistance. I have created a basic initial relax wiki page describing the plotting API: http://wiki.nmr-relax.com/Plotting_API Feel free to sign up to the wiki and modify this as you see fit (http://wiki.nmr-relax.com/index.php?title=Special:UserLoginreturnto=Plotting+APItype=signup). I'll expand this as the API is developed and refined. It could benefit from additional code examples, better API documentation linking, and detailing specific graph types, etc. Note that the API documentation at http://www.nmr-relax.com/api/3.3/ does not contain the recent changes for the Grace plotting and the pipe_control.plotting.write_xy() function. This will be updated once relax 3.3.7 is released (http://wiki.nmr-relax.com/Relax_3.3.7). The code should now be the maximal simplicity for implementing new functionality (http://wiki.nmr-relax.com/Plotting_API#Development). Regards, Edward Thank you Edward for all the mails and information! No problems. I'll use this myself to advance the plotting capabilities. I only recently added the gnuplot graph type for creating a figure in paper I'm currently working on. I've created similar wiki pages to help design other parts of relax (http://wiki.nmr-relax.com/Relax_source_design#The_check_.2A.28.29_functions for example). Things came along so I couldn't look into it until now. But I just started. Creating something similar for veusz as for grace shouldn't be a problem. As soon as I have some results, I will send you patches and edit the wiki page. Hopefully you now have an easy way to play with the Veusz support. Take your time though. Do you have sample data for the plotting.write_iso3D() For this one, the implementation is currently the dx.map user function. I haven't shifted the modules around yet (http://www.nmr-relax.com/api/3.2/lib.software.opendx-module.html to http://www.nmr-relax.com/api/3.3/lib.plotting-module.html). The sample data is generated via the pipe_control.opendx.map function and the Map class (http://www.nmr-relax.com/api/3.2/pipe_control.opendx-module.html#map). This is more complicated as it uses the specific analysis API methods (http://www.nmr-relax.com/api/3.3/specific_analyses.api_base.API_base-class.html) to generate the data on the fly, see the Map class for details (http://www.nmr-relax.com/api/3.2/pipe_control.opendx.Map-class.html). It is used in a number of system tests: $ grep dx test_suite/system_tests/*.py | grep def test_suite/system_tests/frame_order.py:def fixme_test_opendx_map(self): test_suite/system_tests/model_free.py:def test_opendx_s2_te_rex(self): test_suite/system_tests/model_free.py:def test_opendx_theta_phi_da(self): test_suite/system_tests/model_free.py:def test_opendx_tm_s2_te(self): test_suite/system_tests/relax_disp.py:def test_cpmg_synthetic_dx_map_points(self): test_suite/system_tests/relax_disp.py:def test_dx_map_clustered(self): test_suite/system_tests/relax_disp.py:def test_dx_map_clustered_create_par_file(self): $ For example the 2nd would be run as: $ relax -sd Model_free.test_opendx_s2_te_rex plotting.write_2D_fitted_curves() This is the current relax_disp.plot_disp_curves user function. I also haven't shifted this code around, as this is a more complicated task. It will require creating new methods for the specific analysis API to allow this graph type to be compatible with all analysis types which implement the API methods (http://www.nmr-relax.com/api/3.3/specific_analyses.api_base.API_base-class.html). It is also similar to Troels' help.py script attached to http://gna.org/support/?3210. One system test that checks the relax_disp.plot_disp_curves user function is: $ ./relax -sd Relax_disp.test_r1rho_kjaergaard_auto_check_graphs ideas? I hope this information helps and isn't too much. Second, I cannot figure out how to read in two saved data pipes. I would like to write a sample script for J0 vs J0 on two fields plotting. It might be better to start a new thread. For this you should use the results.write and results.read user functions. These historical names should probably one day be renamed to pipe.write and pipe.read. Regards, Edward ___ relax (http://www.nmr-relax.com) This is the relax-devel mailing list relax-devel@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel
Re: [sr #3211] Provide veusz plots as an alternative to grace
Hi Justin, Here is another resource that may be of assistance. I have created a basic initial relax wiki page describing the plotting API: http://wiki.nmr-relax.com/Plotting_API Feel free to sign up to the wiki and modify this as you see fit (http://wiki.nmr-relax.com/index.php?title=Special:UserLoginreturnto=Plotting+APItype=signup). I'll expand this as the API is developed and refined. It could benefit from additional code examples, better API documentation linking, and detailing specific graph types, etc. Note that the API documentation at http://www.nmr-relax.com/api/3.3/ does not contain the recent changes for the Grace plotting and the pipe_control.plotting.write_xy() function. This will be updated once relax 3.3.7 is released (http://wiki.nmr-relax.com/Relax_3.3.7). The code should now be the maximal simplicity for implementing new functionality (http://wiki.nmr-relax.com/Plotting_API#Development). Regards, Edward On 6 February 2015 at 14:58, Edward d'Auvergne edw...@nmr-relax.com wrote: Ok, this is done. If you like, I could also duplicate the grace.write user function into a new plotting.write user function so that you have a software independent way into the plotting API, via the standard user interface. Or maybe this could be plotting.write_xy. I would then shift the pipe_control.grace.write() function: http://www.nmr-relax.com/api/3.3/pipe_control.grace-module.html#write into the pipe_control.plotting module: http://www.nmr-relax.com/api/3.3/pipe_control.plotting-module.html and add the format='grace' argument. Actually, this moving of the write() function is so basic I'll do that now for setting up more infrastructure for you to work with. Done: http://article.gmane.org/gmane.science.nmr.relax.scm/25348 Regards, Edward On 6 February 2015 at 14:18, Edward d'Auvergne edw...@nmr-relax.com wrote: Hi Justin, If you are interested, then I'll do a quick code rearrangement of the Grace plotting code and then set up the API methods for plotting such data: http://www.nmr-relax.com/api/3.3/lib.software-module.html http://www.nmr-relax.com/api/3.3/lib.plotting-module.html You would then just need to write backend functions into the lib.plotting.veusz module I created for you. You could use the lib.plotting.grace module, when created, as a template. The API functions must have identical input arguments. We would also need to discuss the different needs of Veusz vs. Grace so we can refine the API, as the first iteration will be very Grace specific. One option we have is to also create a branch for you to play with where all your changes can be applied as patches. I would also recommend having a read of the relax development chapter of the manual to familiarise yourself with the conventions used in relax: http://www.nmr-relax.com/manual/relax_development.html You would then have the option of pushing this development as far as you wish. Cheers, Edward On 6 February 2015 at 12:57, Justin (jlec) j...@gentoo.org wrote: Hello Edward, thanks for you long mail! I already started to get used to the relax API, as I am currently working on the ccpn import module. I will try to take a look into the veusz module. Shouldn't be to difficult. As soon as I have some patches or question I will come back to you. Justin ___ relax (http://www.nmr-relax.com) This is the relax-devel mailing list relax-devel@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel
Re: [sr #3211] Provide veusz plots as an alternative to grace
Hi Justin, This should be possible. With discussions with Troels about 3D isosurface plotting, I created the space_mapping_refactor relax branch: http://thread.gmane.org/gmane.science.nmr.relax.scm/24009 http://svn.gna.org/viewcvs/relax/branches/space_mapping_refactor/ However in the trunk I am slowly and progressively working on the lib.plotting package: http://article.gmane.org/gmane.science.nmr.relax.devel/7444 The lib.plotting package will be a software independent API for all plotting/graphing/space mapping in relax. I am slowly migrating backend code into this API, and will probably abandon the space_mapping_refactor branch as we can make the changes in the trunk as small incremental changes which do not break the test suite. For example the lib.software.grace module and lib.software.opendx package can be shifted into lib.plotting. Then this software specific code abstracted by the API, so that other software specific code can be written for the API to output a different file type. This would allow the 2D XY-data plots to then have backends for Grace, matplotlib, veusz, plain text output, or any other software. For veusz, we could create the lib.plotting.veusz module for handling this. For each plot type, we create a new API function in lib.plotting.api. Then the veusz backend can be added to the API function. The back end function should be easy enough for any developer to handle, it'll accept the data from relax and then it just needs to be basic pseudo-script which opens the file and writes out formatted content. In any case, it would require a relax developer or interested power-user to write such formatting code. Justin, would you be interested in playing around with such a veusz backend? I just created an empty module to play with: http://article.gmane.org/gmane.science.nmr.relax.scm/25343 For the auto-analyses, we could have a setting whereby the user chooses the plotting software (or a list of plotting software). Or we could output to all formats. I'm not sure what would be best. In the GUI, this could be part of the analysis GUI element, or it could be analysis independent and set via a settings dialog in the Tools menu. For the user functions, we should create a new 'plotting' user function class. Then there could be new user functions such as plotting.write_veusz and plottting.view_veusz for handing the Veusz graphing. The other plotting user function could migrate into this class at a later date as: grace.view - plotting.view_grace grace.write - plotting.write_2D_grace dx.execute - plotting.execute_dx dx.map - plotting.map_dx (or plotting.write_iso3D_dx) Or a different design would be to have one user function per graph type for graph creation: plotting.write_2D plotting.write_iso3D plotting.write_2D_fitted_curves And one user function per software to view the results: plotting.view_dx plotting.view_grace plotting.view_matplotlib plotting.view_veusz Or these could be combined into a single plotting.view or plotting.execute user function. The Veusz lib.plotting backend support is should be a relatively easy task. Justin, would you be interested in seeing if you can create stand-alone Python scripts for outputting in veusz format? This could then be easily modified to become modules of the lib.plotting package. Regards, Edward On 6 February 2015 at 11:32, Justin no-reply.invalid-addr...@gna.org wrote: URL: http://gna.org/support/?3211 Summary: Provide veusz plots as an alternative to grace Project: relax Submitted by: jlec Submitted on: Fri 06 Feb 2015 10:32:01 AM UTC Category: Feature request Priority: 5 - Normal Severity: 3 - Normal Status: None Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Operating System: None ___ Details: I could list all the disadvatages of grace, but instead let me point to a great FOSS project written in python to do great plotting. http://home.gna.org/veusz/ Upstream is very friendly and cooperative. I think it would be a great addition do be able to directly write all the standard grace plots as veusz plots. ___ Reply to this item at: http://gna.org/support/?3211 ___ Message sent via/by Gna! http://gna.org/ ___ relax (http://www.nmr-relax.com) This is the relax-devel mailing list relax-devel@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel
Re: [sr #3211] Provide veusz plots as an alternative to grace
Ok, this is done. If you like, I could also duplicate the grace.write user function into a new plotting.write user function so that you have a software independent way into the plotting API, via the standard user interface. Or maybe this could be plotting.write_xy. I would then shift the pipe_control.grace.write() function: http://www.nmr-relax.com/api/3.3/pipe_control.grace-module.html#write into the pipe_control.plotting module: http://www.nmr-relax.com/api/3.3/pipe_control.plotting-module.html and add the format='grace' argument. Actually, this moving of the write() function is so basic I'll do that now for setting up more infrastructure for you to work with. Done: http://article.gmane.org/gmane.science.nmr.relax.scm/25348 Regards, Edward On 6 February 2015 at 14:18, Edward d'Auvergne edw...@nmr-relax.com wrote: Hi Justin, If you are interested, then I'll do a quick code rearrangement of the Grace plotting code and then set up the API methods for plotting such data: http://www.nmr-relax.com/api/3.3/lib.software-module.html http://www.nmr-relax.com/api/3.3/lib.plotting-module.html You would then just need to write backend functions into the lib.plotting.veusz module I created for you. You could use the lib.plotting.grace module, when created, as a template. The API functions must have identical input arguments. We would also need to discuss the different needs of Veusz vs. Grace so we can refine the API, as the first iteration will be very Grace specific. One option we have is to also create a branch for you to play with where all your changes can be applied as patches. I would also recommend having a read of the relax development chapter of the manual to familiarise yourself with the conventions used in relax: http://www.nmr-relax.com/manual/relax_development.html You would then have the option of pushing this development as far as you wish. Cheers, Edward On 6 February 2015 at 12:57, Justin (jlec) j...@gentoo.org wrote: Hello Edward, thanks for you long mail! I already started to get used to the relax API, as I am currently working on the ccpn import module. I will try to take a look into the veusz module. Shouldn't be to difficult. As soon as I have some patches or question I will come back to you. Justin ___ relax (http://www.nmr-relax.com) This is the relax-devel mailing list relax-devel@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel
Re: [sr #3211] Provide veusz plots as an alternative to grace
Hi Justin, If you are interested, then I'll do a quick code rearrangement of the Grace plotting code and then set up the API methods for plotting such data: http://www.nmr-relax.com/api/3.3/lib.software-module.html http://www.nmr-relax.com/api/3.3/lib.plotting-module.html You would then just need to write backend functions into the lib.plotting.veusz module I created for you. You could use the lib.plotting.grace module, when created, as a template. The API functions must have identical input arguments. We would also need to discuss the different needs of Veusz vs. Grace so we can refine the API, as the first iteration will be very Grace specific. One option we have is to also create a branch for you to play with where all your changes can be applied as patches. I would also recommend having a read of the relax development chapter of the manual to familiarise yourself with the conventions used in relax: http://www.nmr-relax.com/manual/relax_development.html You would then have the option of pushing this development as far as you wish. Cheers, Edward On 6 February 2015 at 12:57, Justin (jlec) j...@gentoo.org wrote: Hello Edward, thanks for you long mail! I already started to get used to the relax API, as I am currently working on the ccpn import module. I will try to take a look into the veusz module. Shouldn't be to difficult. As soon as I have some patches or question I will come back to you. Justin ___ relax (http://www.nmr-relax.com) This is the relax-devel mailing list relax-devel@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel