Skip to content
Snippets Groups Projects
Commit 109e204e authored by Francois POLACK's avatar Francois POLACK
Browse files

fix: bug in writing @axes attribute of NXdata groups

parent 0b87eb18
No related branches found
No related tags found
No related merge requests found
...@@ -799,7 +799,7 @@ class HeightMap(object): ...@@ -799,7 +799,7 @@ class HeightMap(object):
yraw=np.linspace(-origin_y*ypix,(self.rawZ.shape[0]-origin_y)*ypix,num=self.rawZ.shape[0], endpoint=False) yraw=np.linspace(-origin_y*ypix,(self.rawZ.shape[0]-origin_y)*ypix,num=self.rawZ.shape[0], endpoint=False)
x=nx.NXfield(xraw, name='x', unit='meter') x=nx.NXfield(xraw, name='x', unit='meter')
y=nx.NXfield(yraw, name='y', unit='meter') y=nx.NXfield(yraw, name='y', unit='meter')
rawdata=nx.NXdata(nx.NXfield(self.rawZ, name='height', unit='meter'),[x,y],name='raw_data') rawdata=nx.NXdata(nx.NXfield(self.rawZ, name='height', unit='meter'),[y,x],name='raw_data')
#create detrended data group wit height and slope fields #create detrended data group wit height and slope fields
height=nx.NXfield(self.ze, name='height', unit='meter') height=nx.NXfield(self.ze, name='height', unit='meter')
xview=np.linspace((self.ROIorigin[0]-origin_x)*xpix,(self.ROIorigin[0]+self.ROIsize[0]-origin_x)*xpix,num=self.z.shape[1], endpoint=False) xview=np.linspace((self.ROIorigin[0]-origin_x)*xpix,(self.ROIorigin[0]+self.ROIsize[0]-origin_x)*xpix,num=self.z.shape[1], endpoint=False)
...@@ -809,7 +809,7 @@ class HeightMap(object): ...@@ -809,7 +809,7 @@ class HeightMap(object):
slope_x=nx.NXfield(self.dzdx, name='slope_x', unit='radian') slope_x=nx.NXfield(self.dzdx, name='slope_x', unit='radian')
slope_y=nx.NXfield(self.dzdy, name='slope_y', unit='radian') slope_y=nx.NXfield(self.dzdy, name='slope_y', unit='radian')
detrended_height=nx.NXdata(height,[x,y], name='detrended_height') detrended_height=nx.NXdata(height,[y,x], name='detrended_height')
#create the process group with detrending parameters and ROI definition #create the process group with detrending parameters and ROI definition
region=nx.NXgroup( name='ROI', nxclass='NXregion', start=self.ROIorigin, count=self.ROIsize) region=nx.NXgroup( name='ROI', nxclass='NXregion', start=self.ROIorigin, count=self.ROIsize)
region.region_type=nx.NXattr('rectangular') region.region_type=nx.NXattr('rectangular')
...@@ -834,7 +834,7 @@ class HeightMap(object): ...@@ -834,7 +834,7 @@ class HeightMap(object):
# add a the source data to the process group as alink # add a the source data to the process group as alink
process.data=nx.NXlink(rawdata) process.data=nx.NXlink(rawdata)
detrended_slopes=nx.NXdata(slope_x,[nx.NXlink(x),nx.NXlink(y)], slope_y=slope_y, name='detrended_slopes') detrended_slopes=nx.NXdata(slope_x,[nx.NXlink(y),nx.NXlink(x)], slope_y=slope_y, name='detrended_slopes')
#create the process group with detrending parameters and ROI definition #create the process group with detrending parameters and ROI definition
process=nx.NXprocess() process=nx.NXprocess()
process.program=nx.NXattr('numerical_derivation') process.program=nx.NXattr('numerical_derivation')
...@@ -847,7 +847,7 @@ class HeightMap(object): ...@@ -847,7 +847,7 @@ class HeightMap(object):
process.data=nx.NXlink(detrended_height) process.data=nx.NXlink(detrended_height)
# add the data group require by the NXmetrology definition # add the data group require by the NXmetrology definition
entry.data=nx.NXdata(nx.NXlink(height), [nx.NXlink(x), nx.NXlink(y)], slope_x=nx.NXlink(slope_x), slope_y=nx.NXlink(slope_y)) entry.data=nx.NXdata(nx.NXlink(height), [nx.NXlink(y), nx.NXlink(x)], slope_x=nx.NXlink(slope_x), slope_y=nx.NXlink(slope_y))
entry.data.set_default() entry.data.set_default()
#add a drawing in the sample group if defined #add a drawing in the sample group if defined
if self.sample_drawing!=None: if self.sample_drawing!=None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment