[ALPS-users] Convenience Script collectXY
Michele Dolfi
dolfim at phys.ethz.ch
Wed Mar 29 07:45:43 CEST 2017
There a function for this, but it is note used a lot.
Here the doc string:
def ResultsToXY(sets,x,y,foreach=[]):
""" combines observable x and y to build a list of DataSet with y vs x
this function is used to collect data from a hierarchy of DataSet objects, to prepare plots or evaluation.
the inner-most list has to contain one DataSet with props['observable'] = x and one props['observable'] = y,
this will be the pair x-y used in the collection.
The parameters are:
sets: hierarchy of datasets where the inner-most list must contain to pair x-y
x: the name of the observable to be used as x-value of the collected results
y: the name of the observable to be used as y-value of the collected results
foreach: an optional list of properties used for grouping the results. A separate DataSet object is created for each unique set of values of the specified parameers.
The function returns a list of DataSet objects.
"""
Best,
Michele
> On 28 Mar 2017, at 15:23, Dominik Schildknecht <dominik.schildknecht at psi.ch> wrote:
>
> Dear all,
> I wanted to know if it's already implemented to plot two observables
> against each other with the combination of pyalps.collectXY and
> pyalps.plot.plot.
> As an example I would like to be able to plot energy vs. magnetization
> in an example like MC-07. This mainly arises as a question if I want to
> use the exchange Monte Carlo formalism (thanks for that, it seems to
> work great with very little modification to my code). There the
> optimized temperature set is saved as an observable. If I still want to
> be able to plot M vs. T I would need the ability to plot two observables
> against each other. However it crashes in alps/lib/pyalps/tools.py in
> the function collectXY at the line
> xvalue = np.array([data.props[x] for i in range(len(data.y))])
> Is what I intend to do possible with collectXY?
> Best,
> Dominik
>
> --
> Paul Scherrer Institut
> Dominik Schildknecht
> PhD Student
> WHGA/129
> CH-5232 Villigen-PSI
> Phone: +41 56 310 55 68
>
>
>
> ----
> Comp-phys-alps-users Mailing List for the ALPS Project
> http://alps.comp-phys.org/
>
> List info: https://lists.phys.ethz.ch//listinfo/comp-phys-alps-users
> Archive: https://lists.phys.ethz.ch//pipermail/comp-phys-alps-users
>
> Unsubscribe by writing a mail to comp-phys-alps-users-leave at lists.phys.ethz.ch.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.phys.ethz.ch/pipermail/comp-phys-alps-users/attachments/20170329/2f1b5aaf/attachment.html>
More information about the Comp-phys-alps-users
mailing list