In [17]:
%load_ext autoreload
%autoreload 2

%reset
The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
In [25]:
import os 
import numpy as np
import matplotlib.pyplot as plt 

%matplotlib inline
In [27]:
from pySurf.data2D_class import Data2D
from pySurf.instrumentReader import fitsWFS_reader

Read two data with custom settings for scales:

In [28]:
"""INPUT SETTINGS"""
plt.ion()
file1="181016_01_PCO2S06_1009_08.fits"
file2="181016_02_PCO2S06_1009_08.fits"
scale=101.6/116   #ratio between mm and pixels
ytox=220./200   #aspect ratio of pixel
strip = True # strip nan frame
""""""
data1 = Data2D(*fitsWFS_reader(file1,scale=(scale,scale,1),center=(0,0),strip=strip,
                              ytox=ytox,ypix=1),units=['mm','mm','um'])
data2 = Data2D(*fitsWFS_reader(file2,scale=(scale,scale,1), center=(0,0),strip=strip,
                              ytox=ytox,ypix=1),units=['mm','mm','um'])

The part has been removed for the treatment and was put back in a position that can be different from the one of the first measurement. Plot the two data. Before calculating difference, I want to align the two surfaces.

In [30]:
data1.plot()
plt.figure()
data2.plot()
Out[30]:
<Axes: xlabel='X (mm)', ylabel='Y (mm)'>

Level by removing low order polynomial of degree 10, to highlight features. User selects point-and-click markers on leveled data. Markers and transformation (as function) are returned:

In [19]:
d1l = data1.level((10,0))                      # remove low order on y axis
d2l = data2.level((10,0))                
mref,mtrans = data1.align_interactive(data2)   # select points, return transformation 
Out[19]:

Transformation is applied to first set of data and results are visualized:

In [20]:
data1_trans = data1.apply_transform(mtrans)  # apply transform to first (unleveled) data set
plt.figure()                                 # python command to create figure 
diff = plot_difference(data1,data2_trans)    # plot data and difference
Out[20]:
In [25]:
data2?
In [26]:
%qtconsole
In [ ]: