.. index:: Parameter maps .. _parameter-maps-label: Parameter Maps =============== You can fit a force model to every pixel of a scan to create a parameter map, or color-coded image of the parameter values. From the ``Advanced`` pull-down menu, select ``Parameter map`` to open the ``Parameter map creator``. In this panel you may select the ``Model`` to fit to the data, and the initial values of all parametres, as described in the :ref:`model-fit-label` section. Because the generation of parameter maps using :ref:`model-fit-label` is computationally intensive, it is often easire to use this interface off-line, so as not to overload the computer while scanning. Parameter maps can be generated while scanning using a method based on :ref:`fast-poly-label`. You may PPLY either method to your scan data files from the :ref:`batch-processor-label`, where you can also display the maps as 3D images projected on to the height data. Analysis is controlled with the following options: * ``scan direction`` allows you to choose either the trace or retrace data for analysis. * ``CPU processes`` controls how many cores are used when multi-threading the fitting. Fitting a large number of pixels will load the CPU and it may be too sluggish to use while scanning. Adjust this parameter to find a good balance between time-to-output and response time of your computer. * ``X-Y coarse-graining`` controls THE number of fits to be performed. If this factor is set to :math:`n` , fitting will be performed on blocks of :math:`n \times n` pixels. If it is set to 1, all pixels will be analyzed. Increasing this factor reduces the number of calculations and thus the time to output by a factor :math:`n^2`, and it results coarse-grained map. * At the bottom is a list file names that are open in the :ref:`analyze-label` view. All checked files will be analyzed, with the same model and initial conditions. The bar below each file indicates the status of the analysis. * click ``Start`` to begin the analysis and ``Abort`` to end the analysis. The results of the analysis (up to the time of Abort) will be saved in the same folder as the scan file that is being analyzed. When the model fit is performed on a the scan file **scan01234.imp**, several new fiels are created with the same filename. The files **scan01234_p_name.png** are image files with color-coded images of the parameter values. Such a file is created for each parameter **p_name** in your model. The file **scan01234.npz** contains the numerical data of the parameter values stored in one numpy array. This file can be loaded in to a Python script with the numpy function numpy.load(file_name). Here is an example Python script for reading, and replotting the parameter values:: # load the npz file in to the object pmap pmap = np.load('scan01234.npz') # extract and plot data for parampater 3, vmin and vmax are color bar limits imshow(pmap['data'][3],vmin=0,vmax=5) # display the colorbar plt.colorbar()