updates: scaling of pshell data, matrix preview, elog panel

- elog panel supports multiple attachments
- matrix (omicron STM) data file preview in data explorer
- various improvements for the scaling of pshell data
This commit is contained in:
2017-02-02 15:31:13 +01:00
parent c8a69460bc
commit 9a65d26984
5 changed files with 1680 additions and 171 deletions

View File

@ -1539,6 +1539,35 @@ function ps_detect_scale(ax, lo, hi, un)
lo[%$kScanDimLabel] = scanner[0]
hi[%$kScanDimLabel] = scanner[numpnts(scanner)-1]
ax[%$kScanDimLabel] = NameOfWave(scanner)
strswitch(NameOfWave(scanner))
case "Eph":
ax[%$kScanDimLabel] = "photon energy"
un[%$kScanDimLabel] = "eV"
break
case "ManipulatorX":
case "ManipulatorY":
case "ManipulatorZ":
case "FocusYTrans":
case "FocusZTrans":
case "RefocusYTrans":
case "RefocusZTrans":
case "ExitSlitY":
un[%$kScanDimLabel] = "mm"
case "ExitSlit":
un[%$kScanDimLabel] = "<22>m"
break
case "ManipulatorTheta":
case "ManipulatorTilt":
case "ManipulatorPhi":
un[%$kScanDimLabel] = "<22>"
case "FocusXRot":
case "FocusYRot":
case "FocusZRot":
case "RefocusXRot":
case "RefocusYRot":
case "RefocusZRot":
un[%$kScanDimLabel] = "mrad"
endswitch
endif
endif
end
@ -1600,8 +1629,24 @@ function ps_scale_dataset_2(data, ax, lo, hi, un)
Note data, "AxisLabelZ=" + ax[%$sdim]
endif
setscale d 0, 0, un[%$kDataDimLabel], data
Note data, "AxisLabelD=" + ax[%$kDataDimLabel]
string data_unit = un[%$kDataDimLabel]
string data_label = ax[%$kDataDimLabel]
if (cmpstr(data_unit, "arb.") == 0)
strswitch(NameOfWave(data))
case "SampleCurrent":
case "RefCurrent":
case "AuxCurrent":
data_unit = "A"
data_label = "current"
break
case "MachineCurrent":
data_unit = "mA"
data_label = "current"
break
endswitch
endif
setscale d 0, 0, data_unit, data
Note data, "AxisLabelD=" + data_label
Note data, "Dataset=" + NameOfWave(data)
end
@ -1674,21 +1719,35 @@ function /s psh5_load_reduced(ANickName, APathName, AFileName, reduction_func, r
variable ig = 0
variable ng = ItemsInList(s_scanpaths)
string sg
string scanpath
string folder
string positioners
string positioner
string positionerpath
sg = StringFromList(ig, s_scanpaths)
folder = ReplaceString("/", sg, "")
scanpath = StringFromList(ig, s_scanpaths)
folder = ReplaceString("/", scanpath, "")
folder = ReplaceString(" ", folder, "")
folder = CleanupName(folder, 0)
setdatafolder fileDF
newdatafolder /s /o $folder
dfref dataDF = GetDataFolderDFR()
psh5_load_scan_meta(fileID, sg)
positioners = psh5_load_scan_meta(fileID, scanpath)
newdatafolder /s /o attr
psh5_load_scan_attrs(fileID, sg)
killwaves /a/z
psh5_load_scan_attrs(fileID, scanpath)
setdatafolder dataDF
wavenames = psh5_load_dataset_reduced(fileID, sg, "ScientaImage", reduction_func, reduction_param, progress=progress)
wave /t /z ScanWritables
if (waveexists(ScanWritables) && (numpnts(ScanWritables) >= 1))
positioner = ScanWritables[0]
if (strlen(positioner) > 0)
positionerpath = scanpath + "/" + positioner
positionerpath = ReplaceString("//", positionerpath, "/")
HDF5LoadData /O /Q /Z fileID, positionerpath
endif
endif
setdatafolder dataDF
wavenames = psh5_load_dataset_reduced(fileID, scanpath, "ScientaImage", reduction_func, reduction_param, progress=progress)
psh5_close_file(fileID)
endif
@ -1803,9 +1862,7 @@ function /s psh5_load_dataset_reduced(fileID, scanpath, datasetname, reduction_f
ny = di.dims[idy]
nz = di.dims[idz]
nt = di.dims[idt]
make /n=(nx,ny,nz,nt) /o $datawavename /wave=data
// adjust nz and nt *after* making the data wave
// adjust singleton dimensions
nz = max(nz, 1)
nt = max(nt, 1)
nzt = nz * nt