Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[science-iwg] Plotting

FYI DAWN and NiCE working on plotting. Basics of getting started.

 

From: Gerring, Matt (DLSLtd,RAL,LSCI)
Sent: 27 August 2014 09:49
To: 'Jay Jay Billings'
Subject: RE: uk.ac.diamond.scisoft.analysis.dataset.IDataset -> org.eclipse.dawnsci.dataset.IDataset

 

Hi Jay,

 

I will spam the lists with this reply providing you agree it is a good idea. Sorry I was away yesterday and did not respond J Most of what I write about the plotting is available at http://www.dawnsci.org/documentation/developer-guidelines

 

The p2 site is at http://opengda.org/DawnDiamond/master/updates/stable/. The interfaces can be checked out manually at dawn-eclipse on the dawnscience github.

 

Firstly using a DoubleDataset. It has a constructor which takes the double[] and the shape. If 1D data, the shape is simply the length. Peter Chang is the architect of the data system and can also advise you of more complex data needs. Mostly people get IDatasets from the LoaderService as in the examples but instantiating the concrete class is allowed.

 

For the plotting ‘org.eclipse.dawnsci.plotting.examples’ shows how to put plotting systems on view parts. Look at XYExample for a start. Here is what to do:

 

1.      Get the IPlottingService then use that to get an IPlottingSystem instance:

 

            final IPlottingService pservice = ... // get a service

            try {

                  this.system = pservice.createPlottingSystem();

            } catch (Exception ne) {

                  ne.printStackTrace(); // Or your favourite logging.

            }

[The service implementation is in org.dawnsci.plotting.services.]

 

2.      Then you have to create the UI bits something like:

system.createPlotPart(parent, "XY Example", getViewSite().getActionBars(), PlotType.XY, this);

 

3.      Now all you need to do is plot something. The correct full API for this is explained in the javadoc for IPlottingSystem. However there is a quick method for 1D data which is:

             system.createPlot1D(null, Arrays.asList(myData), new NullProgressMonitor());

                 

 

This will give you a 1D plot on which you may use the tools such a peak fitting etc. straight away. Providing that you have implemented getAdapter(...) in the part doing the plotting as follows:

      public Object getAdapter(final Class clazz) {

             if (IPlottingSystem.class == clazz) return system;

             if (IToolPageSystem.class == clazz) return system;

             return super.getAdapter(clazz);

       }

More information is available at http://www.dawnsci.org/documentation/developer-guidelines

 

Sincerely,

 

Matt

 

 

From: Jay Jay Billings [mailto:jayjaybillings@xxxxxxxxx]
Sent: 25 August 2014 22:45
To: Gerring, Matt (DLSLtd,RAL,LSCI)
Subject: Re: uk.ac.diamond.scisoft.analysis.dataset.IDataset -> org.eclipse.dawnsci.dataset.IDataset

 

Matt,

I'm about to implement a new plugin in NiCE that needs to do some plotting for reflectivity data. I would like to go straight to using IDataset instead of our IDataProvider. I'm happy to use the old package and change it later when you make the move.

Where do I get started (which package)?

My goal is to create a DoubleDataset and plot it. I plan to do this by including the DAWN plugins from the update site you created, instantiating and filling up a DoubleDataset and then passing it to one of NiCE's UI components which will in turn pass it to the plotting engine from DAWN. I think it is in theory as simple as that, but I imagine in practice it will require more work.

Jay

 

On Mon, Aug 11, 2014 at 6:26 AM, Jay Jay Billings <jayjaybillings@xxxxxxxxx> wrote:

Matt,

That would be fine.

Jay

On Aug 11, 2014 4:56 AM, <Matt.Gerring@xxxxxxxxxxxxx> wrote:

Hi Jay,

 

We spoke about the requirement to move IDataset last week. I will talk to the team about the best time to do this; I have threatened to do this already but with one thing and another it has not happened. We might want to get Dawn 1.7 out of the door first, therefore it might not be until end September before we do the move.

 

Would that fit with your plans? I would be willing to look at it before then, or alternatively you can use the old package and then change the package imports in late September.

 

Sincerely,

 

Matt

 

 

-- 

This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 

 




--

Jay Jay Billings

Oak Ridge National Laboratory

Twitter Handle: @jayjaybillings


Back to the top