#!/usr/bin/python3
import numpy as np
import matplotlib.pyplot as plt
from collections import Counter
from pycabanas.analysis import *
# Defining FSS functions
def suceptibility(x2):
	return L*x2/L**(rho-1.)
def binder(x,y):
	g=0.5*(3.-(y/x**2))
	return g
def correlation(x,y):
	c=(((L*x/y)-1)**(1./(rho-1.)))/(2.*L*np.sin(np.pi/L))
	return c
# Obtaining external data
param=open('parameters.dat', "r")
para_lines=param.readlines()
L=para_lines[5].split()
L=int(L[0])
rho=para_lines[9].split()
rho=float(rho[0])
#Performing analysis
classic_analysis(suceptibility,binder,correlation,L,rho)
