Performs standard box counting techniques to a set of floating point data, first converting the data to binary using a cutoff. For example, it was applied to the Serpinski triangle as an image for the following result:
This method works for fractal structures from 1D to 3D.
If data is not a binary array, it will be converted according to the cutoff. That is, values above cutoff will be counted as 1, below it as 0.
By default, the data array has the same length along all axes, and the length is usually a power of 2. So the boxsizes are given as a list of powers of 2. Certainly, you can supply a special list of boxsizes for any certain system size L.
For example, if data is an array of [128,128], the boxsizes are given by boxsizes = [1,2,4,8,16,32,64].
This function will return two numpy arrays: the former is the array of normalized boxsizes, and the latter is the corresponding array of the total number of ‘black’ boxes.
Does the box counting by taking every boxsized-th element of the array by first adding all of the elements in a box then translating it to a binary value of has data or not.
Binary data should be 1 for occupied sites and 0 for unoccupied.
Along every axis, the length of data array should be divided by the boxsize.