1 #pragma rtGlobals=3 // Use modern global access method and strict wave access. 2 #pragma IgorVersion = 6.1 3 #pragma ModuleName = PearlDataExplorer 5 #include "pearl-area-import" 6 #include "pearl-area-profiles" 7 #include "pearl-area-display" 8 #include "pearl-compat" 9 #include "pearl-pshell-import" 10 #if exists("MFR_OpenResultFile") 11 #include "pearl-matrix-import" 58 dfref savefolder = GetDataFolderDFR()
60 newdatafolder /o/s packages
61 newdatafolder /o/s $package_name
62 if (exists("v_InitPanelDone") == 2)
63 SetDataFolder savefolder
68 make /o/n=0/i wSelectedFiles,wSelectedDatasets
69 make /o/n=0/t wtDatasets
70 make /o/n=0/t wtPositioners,wtDetectors
71 make /o/n=0/i wSelectedPositioners,wSelectedDetectors
73 make /o/n=(1,1) preview_image
74 make /o/n=0 preview_trace
75 make /o/n=0/t attr_names, attr_values, attr_filter, attr_filter_summary
78 string /g s_filepath = ""
79 string /g s_hdf_options = ""
80 string /g s_reduction_params = ""
81 string /g s_preview_pvs = ""
83 s_preview_pvs = "*OP:CURRENT*;*Stats*Total*;*KEITHLEY*READOUT;*CADC*"
86 string /g s_preview_file = ""
87 string /g s_preview_source = ""
88 string /g s_profiles_graph = ""
89 string /g s_preview_trace_graph = ""
90 string /g s_file_info = ""
92 variable/g v_InitPanelDone = 1
94 SetDataFolder savefolder
100 dfref saveDF = GetDataFolderDFR()
102 string fullPath = SpecialDirPath("Packages", 0, 0, 0)
104 NewPath/O/C/Q tempPackagePrefsPath, fullPath
105 fullPath += ":preferences.pxp"
107 SetDataFolder root:packages
108 SetDataFolder $package_name
109 string objects = "attr_filter;attr_filter_summary;s_filepath;s_hdf_options;s_reduction_params;s_preview_pvs"
110 SaveData /O /Q /J=objects fullPath
112 KillPath/Z tempPackagePrefsPath
120 dfref saveDF = GetDataFolderDFR()
124 NewDataFolder /O/S packages
125 NewDataFolder /O/S $package_name
126 dfref packageDF = GetDataFolderDFR()
127 string fullPath = SpecialDirPath("Packages", 0, 0, 0)
130 GetFileFolderInfo /Q /Z fullPath
132 fullPath += ":preferences.pxp"
133 GetFileFolderInfo /Q /Z fullPath
135 LoadData /O /R /Q fullPath
141 svar /sdfr=packageDF filepath = s_filepath
142 NewPath /O/Z pearl_explorer_filepath, filepath
171 #if exists("MFR_OpenResultFile") 186 dfref saveDF = GetDataFolderDFR()
190 wave wSelectedFiles = $(
package_path + "wSelectedFiles")
193 PathInfo pearl_explorer_filepath
195 all_files = IndexedFile(pearl_explorer_filepath, -1, "????")
196 nn = ItemsInList(all_files)
202 make /n=(nn) /t /free wtAllFiles
203 wtAllFiles = StringFromList(p, all_files)
205 Sort /A /R wtFiles, wtFiles
207 redimension /n=(numpnts(wtFiles)) wSelectedFiles
217 dfref saveDF = GetDataFolderDFR()
220 dfref rootdf = GetDataFolderDFR()
221 setdatafolder $package_path
222 dfref privatedf = GetDataFolderDFR()
225 wave wSelectedDatasets
226 variable maxdf = CountObjectsDFR(rootdf, 4)
227 redimension /n=(maxdf) wtDatasets
234 sdf = GetIndexedObjNameDFR(rootdf, 4, idf)
235 if (strlen(sdf) >= 1)
238 svar /z importer = pearl_explorer_import
239 if (svar_exists(importer))
240 wtDatasets[ndf] = sdf
249 redimension /n=(ndf) wtDatasets, wSelectedDatasets
250 wSelectedDatasets = 0
251 sort wtDatasets, wtDatasets
259 dfref saveDF = GetDataFolderDFR()
279 if (WaveExists(image))
282 if (exists("
PearlElog#set_panel_attributes") == 6) 284 sprintf cmd,
"PearlElog#set_panel_attributes(\"\", \"File=%s\")", ParseFilePath(0, filename,
":", 1, 0)
286 if (strlen(graphname) > 0)
287 sprintf cmd, "
PearlElog#set_panel_graphs(\"\", \"%s\")", graphname 311 dfref saveDF = GetDataFolderDFR()
313 setdatafolder $package_path
314 dfref previewDF = GetDataFolderDFR()
316 svar s_preview_source
318 if (! svar_exists(s_file_info))
319 string /g s_file_info
322 dfref tempDF = NewFreeDataFolder()
327 s_preview_file = filename
328 s_preview_source = ""
330 wave /z data = $dataname
331 if (waveexists(data))
332 duplicate /o data, previewDF:preview_image
334 print "no data found in file " + filename
337 if (strlen(s_preview_file) > 0)
343 dfref attrDF = tempDF:attr
344 if (DataFolderRefStatus(attrDF))
349 wave /z /sdfr=previewDF preview_image
367 dfref saveDF = GetDataFolderDFR()
368 setdatafolder $package_path
370 svar s_preview_source
372 s_preview_file = filename
373 s_preview_source = ""
374 wave /z preview_image
377 if (! svar_exists(s_file_info))
378 string /g s_file_info
380 if (strlen(s_preview_file) > 0)
386 if (DataFolderExists("attr"))
418 dfref saveDF = GetDataFolderDFR()
419 setdatafolder $package_path
421 svar s_preview_source
424 dfref dataDF = newfreedatafolder()
426 LoadWave /t/p=pearl_explorer_filepath/q filename
427 s_preview_file = s_filename
428 s_preview_source = ""
454 #if exists("MFR_OpenResultFile") 455 dfref saveDF = GetDataFolderDFR()
456 setdatafolder $package_path
457 variable /g V_MatrixFileReaderOverwrite = 1
458 variable /g V_MatrixFileReaderFolder = 0
459 variable /g V_MatrixFileReaderDouble = 0
461 svar s_preview_source
465 if (strlen(datanames) > 0)
466 s_preview_file = filename
468 dataname = StringFromList(0, datanames)
469 wave data = $dataname
470 duplicate /o $dataname, preview_image
471 s_preview_source = StringByKey("Dataset", note(data), "=", "\r")
474 if (svar_exists(s_file_info))
479 variable n = ItemsInList(datanames)
481 for (i = 0; i < n; i += 1)
482 s = StringFromList(i, datanames)
486 wave /z preview_image
489 wave /z preview_image = $
"" 502 switch (WaveDims(data))
504 redimension /n=(numpnts(data)) preview
508 redimension /n=(dimsize(data, 0), dimsize(data, 1)) preview
512 redimension /n=(dimsize(data, 0), dimsize(data, 1)) preview
513 z1 = floor(DimSize(data, 2) / 2)
515 wave slab =
ad_extract_slab(data, nan, nan, nan, nan, z1, z2,
"", pscale=1)
522 switch (WaveDims(data))
526 setscale /p y dimoffset(data, 1), dimdelta(data, 1), waveunits(data, 1), preview
528 setscale /p x dimoffset(data, 0), dimdelta(data, 0), waveunits(data, 0), preview
529 setscale d 0, 0, waveunits(data, -1), preview
536 dfref saveDF = GetDataFolderDFR()
538 if (!DataFolderExists("root:" + datasetname))
542 setdatafolder $datasetname
543 dfref datadf = GetDataFolderDFR()
546 setdatafolder $package_path
548 svar s_preview_source
550 if (WaveExists(data))
551 s_preview_file = datasetname
552 s_preview_source = ""
557 s_preview_file = datasetname
565 if (DataFolderExists("attr"))
578 dfref saveDF = GetDataFolderDFR()
580 setdatafolder $package_path
582 svar s_preview_source
591 string d_names = WaveList("*", ";", "DP:1")
592 variable nw = ItemsInList(d_names, ";")
593 variable npv = ItemsInList(s_preview_pvs, ";")
595 string wname, wnote, pv_name, pv_match
596 for (iw = 0; iw < nw; iw += 1)
597 wname = StringFromList(iw, d_names, ";")
599 pv_name = StringByKey("PV", wnote, "=", "\r")
601 for (ipv = 0; ipv < npv; ipv += 1)
602 pv_match = StringFromList(ipv, s_preview_pvs)
603 if (StringMatch(pv_name, pv_match))
605 s_preview_source = pv_name
627 if ((DimOffset(preview, 0) == 0) && (DimDelta(preview, 0) == 1))
628 string xname = StringByKey("Axis1", note(data), "=", "\r")
629 wave /z xwave = $xname
630 if (WaveExists(xwave))
632 variable monotonic = 0
633 duplicate /free xwave, xdiff
634 differentiate /p xwave /D=xdiff
635 duplicate /free xdiff, xflag
637 monotonic = sum(xflag) > numpnts(xwave) * 0.9
639 monotonic = monotonic || (sum(xflag) > numpnts(xwave) * 0.9)
641 setscale /i x xwave[0], xwave[numpnts(xwave)-1], waveunits(xwave, -1), preview
647 static function
preview_attributes(attr_folder, [dest_folder, attr_filter, include_datawaves, include_infowaves])
657 variable include_datawaves
659 variable include_infowaves
662 dfref saveDF = GetDataFolderDFR()
663 setdatafolder $package_path
665 if (ParamIsDefault(dest_folder))
666 dest_folder = GetDataFolderDFR()
668 if (ParamIsDefault(attr_filter))
669 wave /t /z attr_filter
671 if (ParamIsDefault(include_datawaves))
672 include_datawaves = 1
674 if (ParamIsDefault(include_infowaves))
675 include_infowaves = 1
678 setdatafolder dest_folder
679 wave /t /z attr_names, attr_values
680 if (!WaveExists(attr_names) || !WaveExists(attr_values))
681 make /n=(1) /o /t attr_names, attr_values
686 setdatafolder attr_folder
702 if (WaveExists(IN) && include_infowaves)
707 if (include_datawaves)
708 string waves = WaveList("*", ";", "")
709 string exceptions = "ID;IN;IU;IV"
710 waves = RemoveFromList(exceptions, waves)
711 nw = ItemsInList(waves, ";")
716 if (WaveExists(attr_filter) && (numpnts(attr_filter) >= 1))
717 nattr = numpnts(attr_filter)
718 redimension /n=(nattr) attr_names
719 attr_names = attr_filter
722 redimension /n=(ninfo) attr_names
723 attr_names = SelectString(strlen(ID[p]) >= 0, IN[p], ID[p])
728 redimension /n=(nattr) attr_names
729 for (iw = 0; iw < nw; iw +=1 )
730 sw = StringFromList(iw, waves, ";")
731 ss = StringByKey("PV", note($sw), "=", "\r")
732 FindValue /text=sw attr_names
733 if ((v_value < 0) && (strlen(ss) >= 0))
734 attr_names[iattr] = sw
740 redimension /n=(nattr) attr_names, attr_values
741 sort attr_names, attr_names
744 for (iattr = 0; iattr < nattr; iattr += 1)
745 sw = attr_names[iattr]
748 FindValue /text=sw ID
750 attr_values[iattr] = IV[v_value]
752 FindValue /text=sw IN
754 attr_values[iattr] = IV[v_value]
760 switch (WaveType($sw, 1))
763 if (WaveExists(w) && (numpnts(w) >= 1))
764 sprintf ss, "%g", w[0]
765 attr_values[iattr] = ss
770 if (WaveExists(wt) && (numpnts(wt) >= 1))
771 attr_values[iattr] = wt[0]
785 dfref saveDF = GetDataFolderDFR()
787 if (!DataFolderExists("root:" + datasetname))
791 setdatafolder $datasetname
792 dfref datadf = GetDataFolderDFR()
794 if (!WaveExists(data))
798 if (WaveExists(data))
799 switch(WaveDims(data))
815 dfref df = GetDataFolderDFR()
816 wave /t /sdfr=df attr_names
817 wave /t /sdfr=df attr_values
826 dfref saveDF = GetDataFolderDFR()
827 setdatafolder $package_path
828 wave /t/z attr_filter, attr_filter_summary
831 if (WinType(name) == 5)
832 Notebook $name selection={startOfFile, endOfFile}
833 Notebook $name text=
"" 835 NewNotebook /F=1 /K=1 /N=$name as title
836 GetWindow $name wsize
837 v_right = v_left + 260
838 v_bottom = v_top + 360
839 MoveWindow /W=$name v_left, v_top, v_right, v_bottom
840 Notebook $name tabs={2*72}
844 if (WaveExists(attr_filter_summary) && (numpnts(attr_filter_summary) >= 1))
845 notebook $name fStyle=1, text=
"Summary\r\r" 846 notebook $name fStyle=0
848 notebook $name text=
"\r" 852 notebook $name fStyle=1, text=
"All Attributes\r\r" 853 notebook $name fStyle=0
855 notebook $name selection={startOfFile,startOfFile}, findText={
"",1}
862 wave /t /z attr_filter
866 variable nw = numpnts(attr_names)
871 variable do_filter = WaveExists(attr_filter)
873 for (iw = 0; iw < nw; iw += 1)
876 FindValue /text=sw attr_filter
881 sprintf ss,
"%s\t%s\r", attr_names[iw], attr_values[iw]
882 notebook $notebook_name text=ss
892 dfref saveDF = GetDataFolderDFR()
893 setdatafolder $package_path
895 svar s_profiles_graph
897 svar s_preview_source
898 svar s_preview_trace_graph
900 if ((strlen(s_profiles_graph) > 0) && (WinType(s_profiles_graph) == 1))
901 KillWindow $s_profiles_graph
903 if ((strlen(s_preview_trace_graph) > 0) && (WinType(s_preview_trace_graph) == 1))
904 KillWindow $s_preview_trace_graph
908 if (wavedims(data) == 2)
910 ModifyGraph /w=$s_profiles_graph /z wbRGB=(48640,56832,60160)
911 graphname = s_profiles_graph
912 elseif (wavedims(data) == 1)
913 duplicate /o data, preview_trace
914 if (!ParamIsDefault(xdata))
915 duplicate /o xdata, preview_trace_x
917 duplicate /o data, preview_trace_x
919 setscale d 0, 0, WaveUnits(data, 0), preview_trace_x
922 ModifyGraph /w=$s_preview_trace_graph wbRGB=(48640,56832,60160)
923 graphname = s_preview_trace_graph
928 string title = "Preview " + s_preview_file
929 if (strlen(s_preview_source) > 0)
930 title = title + " (" + s_preview_source[0,31] + ")"
932 dowindow /f/t $graphname, title
942 display /n=pearl_explorer_1d /k=1 ytrace vs xtrace as "Preview"
943 string graphname = s_name
944 ModifyGraph /w=$graphname rgb[0]=(0,0,0)
945 ModifyGraph /w=$graphname grid=2
946 ModifyGraph /w=$graphname mirror=1
947 ModifyGraph /w=$graphname minor=1
948 ModifyGraph /w=$graphname axThick=0.5
949 ModifyGraph /w=$graphname gridRGB=(52224,52224,52224)
950 ModifyGraph /w=$graphname gridHair=0
951 ModifyGraph /w=$graphname tick=0
952 ModifyGraph /w=$graphname btLen=4
955 string labels = note(ytrace)
957 lab = StringByKey("AxisLabelX", labels, "=", "\r")
961 Label /w=$graphname bottom lab + " (\\U)"
962 lab = StringByKey("AxisLabelD", labels, "=", "\r")
966 Label /w=$graphname left lab + " (\\U)"
974 dfref saveDF = GetDataFolderDFR()
975 setdatafolder $package_path
979 variable nn = numpnts(wSelectedFiles)
981 for (ii = 0; ii < nn; ii += 1)
982 if (wSelectedFiles[ii])
983 if (ParamIsDefault(options))
999 dfref saveDF = GetDataFolderDFR()
1004 if (ParamIsDefault(options))
1011 if (ParamIsDefault(options))
1027 setdatafolder saveDF
1033 string mode = StringByKey("mode", options, ":", ";")
1034 string reduction_func = StringByKey("reduction_func", options, ":", ";")
1036 string modes = "load_reduced"
1039 if (strlen(mode) == 0)
1040 mode = StringFromList(0, modes, ";")
1042 if (strlen(reduction_func) == 0)
1043 reduction_func = StringFromList(0, reduction_functions, ";")
1046 prompt mode, "Mode", popup, modes
1047 prompt reduction_func, "Reduction Function", popup, reduction_functions
1048 doprompt "HDF5 Loading Options", mode, reduction_func
1051 options = ReplaceStringByKey("mode", options, mode, ":", ";")
1052 options = ReplaceStringByKey("reduction_func", options, reduction_func, ":", ";")
1079 string prompt_name = "prompt_" + func_name
1080 if (exists(prompt_name) == 6)
1082 return prompt_func(func_param)
1093 dfref saveDF = GetDataFolderDFR()
1095 string loaded_filename = ""
1097 if (ParamIsDefault(options))
1100 if (strlen(options) == 0)
1102 options = pref_options
1105 pref_options = options
1112 string mode = StringByKey("mode", options, ":", ";")
1115 case "load_reduced":
1116 string reduction_func = StringByKey("reduction_func", options, ":", ";")
1117 svar pref_params = $(
package_path + "s_reduction_params")
1118 string reduction_params = pref_params
1120 pref_params = reduction_params
1121 print reduction_func, reduction_params
1122 psh5_load_reduced(nickname, "pearl_explorer_filepath", filename, $reduction_func, reduction_params)
1124 loaded_filename = s_filepath
1131 if (strlen(loaded_filename) > 0)
1132 setdatafolder $("root:" + nickname)
1133 dataDF = GetDataFolderDFR()
1137 setdatafolder saveDF
1145 dfref saveDF = GetDataFolderDFR()
1147 string loaded_filename = ""
1149 if (ParamIsDefault(options))
1152 if (strlen(options) == 0)
1154 options = pref_options
1157 pref_options = options
1164 string mode = StringByKey("mode", options, ":", ";")
1167 case "load_reduced":
1168 string reduction_func = StringByKey("reduction_func", options, ":", ";")
1169 svar pref_params = $(
package_path + "s_reduction_params")
1170 string reduction_params = pref_params
1172 pref_params = reduction_params
1173 print reduction_func, reduction_params
1174 loaded_filename =
adh5_load_reduced(nickname, "pearl_explorer_filepath", filename, $reduction_func, reduction_params)
1181 if (strlen(loaded_filename) > 0)
1182 setdatafolder $("root:" + nickname)
1183 dataDF = GetDataFolderDFR()
1187 setdatafolder saveDF
1195 dfref saveDF = GetDataFolderDFR()
1198 if (ParamIsDefault(options))
1203 newdatafolder /s/o $("root:" + nickname)
1204 dfref dataDF = GetDataFolderDFR()
1211 LoadWave /t/p=pearl_explorer_filepath/q filename
1212 svar waves = s_wavenames
1213 dfref actDF = GetDataFolderDFR()
1218 if (!DataFolderRefsEqual(actDF, dataDF))
1221 setdatafolder dataDF
1222 if (ItemsInList(WaveList("*", ";", ""), ";") == 0)
1223 killdatafolder /z dataDF
1227 setdatafolder saveDF
1238 dfref saveDF = GetDataFolderDFR()
1241 #if exists("MFR_OpenResultFile") 1243 string datasets =
"" 1245 if (strlen(datasets) > 0)
1246 string /g pearl_explorer_import =
"load_mtrx_file" 1247 string s1 = StringFromList(0, datasets)
1249 dataDF = GetWavesDataFolderDFR(w1)
1253 setdatafolder saveDF
1273 if (ParamIsDefault(ignoredate))
1276 if (ParamIsDefault(unique))
1280 string basename = ParseFilePath(3, filename,
":", 0, 0)
1281 string extension = ParseFilePath(4, filename, ":", 0, 0)
1285 if (strsearch(basename, "X03DA_PC", 0, 2) >= 0)
1286 autosource = "sscan"
1287 basename = ReplaceString("_", basename, "-")
1289 elseif (strsearch(basename, "otf", 0, 2) >= 0)
1292 if (ParamIsDefault(sourcename))
1293 sourcename = autosource
1296 variable nparts = ItemsInList(basename, "-")
1298 string datepart = StringFromList(nparts - 2, basename, "-")
1299 string indexpart = StringFromList(nparts - 1, basename, "-")
1301 sprintf nickname, "%s_%s", sourcename, indexpart
1303 sprintf nickname, "%s_%s_%s", sourcename, datepart, indexpart
1309 if (unique && CheckName(nickname, 11))
1310 nickname = UniqueName(nickname + "_", 11, 0)
1317 PauseUpdate; Silent 1
1318 NewPanel /K=1 /W=(800,0,1530,444) as "PEARL Data Explorer"
1319 ModifyPanel cbRGB=(48640,56832,60160)
1321 GroupBox gb_filepath,pos={8,4},size={224,52},title=
"file system folder" 1322 TitleBox tb_filepath,pos={20,24},size={174,20},frame=2
1323 TitleBox tb_filepath,variable=root:packages:pearl_explorer:s_filepath,fixedSize=1
1325 Button b_browse_filepath,fColor=(65280,48896,32768)
1327 GroupBox gb_prefs,pos={240,4},size={58,52},title=
"prefs",help={
"explorer package preferences"}
1329 Button b_save_prefs,help={
"save preferences of the data explorer package (data file path, attributes filter)"}
1330 Button b_save_prefs,fColor=(65280,48896,32768)
1332 Button b_load_prefs,help={
"load preferences of the data explorer package"}
1333 Button b_load_prefs,fColor=(65280,48896,32768)
1335 GroupBox gb_filelist,pos={8,64},size={224,372},title=
"data files" 1337 ListBox lb_files,listWave=root:packages:pearl_explorer:wtFiles
1338 ListBox lb_files,selWave=root:packages:pearl_explorer:wSelectedFiles,row= 11,mode= 4
1339 TitleBox tb_file_info,pos={20,300},size={198,78},frame=2,fixedSize=1
1340 TitleBox tb_file_info,variable= root:packages:pearl_explorer:s_file_info
1343 Button b_update_filelist,fColor=(65280,48896,32768)
1344 CheckBox cb_file_preview,pos={84,390},size={60,20},title=
"preview" 1345 CheckBox cb_file_preview,help={
"enable/disable automatic preview window when selecting a data file"}
1346 CheckBox cb_file_preview,value=1
1348 Button b_file_prev,help={
"previous file"}
1349 Button b_file_prev,fColor=(65280,48896,32768)
1351 Button b_file_next,help={
"next file"}
1352 Button b_file_next,fColor=(65280,48896,32768)
1355 Button b_load_files,help={
"load the complete contents from the selected files"}
1356 Button b_load_files,fColor=(65280,48896,32768)
1358 Button b_load_files_opt,help={
"load data from the selected files with options (reduced dimensions)"}
1359 Button b_load_files_opt,fColor=(65280,48896,32768)
1362 GroupBox gb_datasets,pos={240,64},size={224,372},title=
"datasets" 1364 ListBox lb_datasets,listWave=root:packages:pearl_explorer:wtDatasets
1365 ListBox lb_datasets,selWave=root:packages:pearl_explorer:wSelectedDatasets,mode= 1
1366 ListBox lb_datasets,selRow= -1
1369 Button b_update_datasets,help={
"update the list of datasets"}
1370 Button b_update_datasets,fColor=(65280,48896,32768)
1371 CheckBox cb_dataset_preview,pos={316,390},size={60,20},title=
"preview" 1372 CheckBox cb_dataset_preview,help={
"enable/disable automatic preview window when selecting a dataset"}
1373 CheckBox cb_dataset_preview,value=0
1375 Button b_dataset_prev,help={
"goto previous dataset"}
1376 Button b_dataset_prev,fColor=(65280,48896,32768)
1378 Button b_dataset_next,help={
"goto next dataset"}
1379 Button b_dataset_next,fColor=(65280,48896,32768)
1382 Button b_dataset_folder,help={
"set the current data folder of the selected dataset"}
1383 Button b_dataset_folder,fColor=(65280,48896,32768)
1385 Button b_dataset_display,help={
"display the selected dataset in its own window"}
1386 Button b_dataset_display,fColor=(65280,48896,32768)
1388 GroupBox gb_preview,pos={472,4},size={250,52},title=
"preview" 1389 TitleBox tb_preview_file,pos={484,24},size={226,20},frame=2
1390 TitleBox tb_preview_file,variable=root:packages:pearl_explorer:s_preview_file,fixedSize=1
1392 GroupBox gb_attributes,pos={472,64},size={250,372},title=
"attributes" 1394 Button b_attr_notebook,help={
"show attribute list in a notebook"}
1395 Button b_attr_notebook,fColor=(65280,48896,32768)
1397 String fldrSav0= GetDataFolder(1)
1398 SetDataFolder root:packages:pearl_explorer:
1399 Edit/W=(484,84,710,384)/HOST=# attr_names,attr_values
1400 ModifyTable format(Point)=1,width(Point)=0,width(attr_names)=103,width(attr_values)=103
1401 ModifyTable statsArea=85
1402 SetDataFolder fldrSav0
1404 SetActiveSubwindow ##
1408 STRUCT WMButtonAction &ba
1410 switch( ba.eventCode )
1421 static function bp_save_prefs(ba) : ButtonControl
1422 STRUCT WMButtonAction &ba
1424 switch( ba.eventCode )
1435 static function bp_browse_filepath(ba) : ButtonControl
1436 STRUCT WMButtonAction &ba
1438 dfref saveDF = GetDataFolderDFR()
1440 switch( ba.eventCode )
1442 PathInfo /S pearl_explorer_filepath
1443 NewPath /M=
"select data file folder" /O/Z pearl_explorer_filepath
1445 PathInfo /S pearl_explorer_filepath
1455 setdatafolder saveDF
1459 static function bp_update_filelist(ba) : ButtonControl
1460 STRUCT WMButtonAction &ba
1462 switch( ba.eventCode )
1473 static function bp_load_files(ba) : ButtonControl
1474 STRUCT WMButtonAction &ba
1476 switch( ba.eventCode )
1487 static function bp_load_files_opt(ba) : ButtonControl
1488 STRUCT WMButtonAction &ba
1490 switch( ba.eventCode )
1501 static function bp_file_next(ba) : ButtonControl
1502 STRUCT WMButtonAction &ba
1504 dfref saveDF = GetDataFolderDFR()
1506 switch( ba.eventCode )
1508 setdatafolder $package_path
1511 FindValue /i=1 wSelectedFiles
1513 if (v_value >= numpnts(wtFiles))
1514 v_value = min(numpnts(wtFiles) - 1, 0)
1516 wSelectedFiles = p == v_value
1518 variable ifile = v_value
1529 setdatafolder saveDF
1533 static function bp_file_prev(ba) : ButtonControl
1534 STRUCT WMButtonAction &ba
1536 dfref saveDF = GetDataFolderDFR()
1538 switch( ba.eventCode )
1540 setdatafolder $package_path
1543 FindValue /i=1 wSelectedFiles
1546 v_value = numpnts(wtFiles) - 1
1548 wSelectedFiles = p == v_value
1550 variable ifile = v_value
1561 setdatafolder saveDF
1566 STRUCT WMListboxAction &lba
1568 Variable row = lba.row
1569 Variable col = lba.col
1570 WAVE/T/Z listWave = lba.listWave
1571 WAVE/Z selWave = lba.selWave
1573 switch( lba.eventCode )
1600 static function bp_update_datasets(ba) : ButtonControl
1601 STRUCT WMButtonAction &ba
1603 switch( ba.eventCode )
1614 static function bp_dataset_folder(ba) : ButtonControl
1615 STRUCT WMButtonAction &ba
1617 switch( ba.eventCode )
1621 setdatafolder $package_path
1623 string dataset = wtDatasets[v_value]
1625 sprintf cmd,
"setdatafolder root:%s", PossiblyQuoteName(dataset)
1627 cmd =
"setdatafolder :scan1" 1629 sprintf cmd,
"setdatafolder %s", GetDataFolder(1)
1640 static function bp_dataset_display(ba) : ButtonControl
1641 STRUCT WMButtonAction &ba
1643 switch( ba.eventCode )
1647 setdatafolder $package_path
1649 string dataset = wtDatasets[v_value]
1660 static function bp_dataset_next(ba) : ButtonControl
1661 STRUCT WMButtonAction &ba
1663 switch( ba.eventCode )
1666 wave /t wtDatasets = $(s_datafolder + s_value)
1668 if (v_value >= numpnts(wtDatasets))
1669 v_value = min(0, numpnts(wtDatasets) - 1)
1673 variable ids = v_value
1687 static function bp_dataset_prev(ba) : ButtonControl
1688 STRUCT WMButtonAction &ba
1690 switch( ba.eventCode )
1693 wave /t wtDatasets = $(s_datafolder + s_value)
1696 v_value = max(-1, numpnts(wtDatasets) - 1)
1700 variable ids = v_value
1714 static function lbp_datasets(lba) : ListBoxControl
1715 STRUCT WMListboxAction &lba
1717 Variable row = lba.row
1718 Variable col = lba.col
1719 WAVE/T/Z listWave = lba.listWave
1720 WAVE/Z selWave = lba.selWave
1722 switch( lba.eventCode )
1749 static function bp_attr_notebook(ba) : ButtonControl
1750 STRUCT WMButtonAction &ba
1752 dfref saveDF = GetDataFolderDFR()
1754 switch( ba.eventCode )
1756 setdatafolder $package_path
1758 wave /t /z attr_names
1759 wave /t /z attr_values
1760 if (WaveExists(attr_names))
1768 setdatafolder saveDF
static dfr load_mtrx_file(string filename, string options=defaultValue)
load a matrix (STM) data file
static const string package_path
string adh5_load_preview(string ANickName, string APathName, string AFileName, variable load_data=defaultValue, variable load_attr=defaultValue)
load a single image from a HDF5 file created by the Area Detector software.
static variable update_datasets()
string psh5_load_reduced(string ANickName, string APathName, string AFileName, funcref reduction_func, string reduction_param, variable progress=defaultValue, variable nthreads=defaultValue)
load and reduce the ScientaImage dataset of the first scan of a PShell data file. ...
static variable bp_browse_filepath(WMButtonAction *ba)
static variable preview_file(string filename)
variable prompt_default_process(string *param)
prototype for prompting for processing function parameters.
string adh5_load_info(string APathName, string AFileName)
load descriptive info from a HDF5 file created by the Area Detector software.
static variable bp_dataset_prev(WMButtonAction *ba)
static string display_preview_trace(wave xtrace, wave ytrace)
static variable bp_file_prev(WMButtonAction *ba)
variable ad_brick_slicer(wave data)
open a slicer panel for 3D data.
interface for writing ELOG entries with Igor graphs as attachment.
static variable lbp_datasets(WMListboxAction *lba)
static variable bp_load_files_opt(WMButtonAction *ba)
static variable load_selected_files(string options=defaultValue)
string PearlCleanupName(string name)
static variable bp_load_files(WMButtonAction *ba)
static variable preview_datafolder()
static variable bp_file_next(WMButtonAction *ba)
static variable lbp_filelist(WMListboxAction *lba)
static variable prompt_hdf_options(string *options)
static variable bp_update_datasets(WMButtonAction *ba)
static const string ks_filematch_pshell
static const string ks_filematch_adh5
static wave preview_mtrx_file(string filename)
load the preview of a Matrix STM file.
static variable init_package()
initialize the global variables of the data explorer.
static wave preview_pshell_file(string filename)
load the preview of a PShell HDF5 file.
static variable bp_dataset_folder(WMButtonAction *ba)
static variable preview_dataset(string datasetname)
static const string package_name
static variable update_filelist()
read a list of PEARL files from the file system
static dfr load_itx_file(string filename, string options=defaultValue)
string psh5_load_preview(string APathName, string AFileName, variable load_data=defaultValue, variable load_attr=defaultValue, string pref_scans=defaultValue, string pref_datasets=defaultValue)
load a preview image from a PShell data file.
static variable bp_attr_notebook(WMButtonAction *ba)
static variable load_file(string filename, string options=defaultValue)
preview and import panel for PEARL data
static variable bp_load_prefs(WMButtonAction *ba)
static variable preview_setscale_x(wave data, wave preview)
static variable bp_save_prefs(WMButtonAction *ba)
static dfr load_hdf_file(string filename, string options=defaultValue)
string ad_suggest_foldername(string filename, variable ignoredate=defaultValue, string sourcename=defaultValue, variable unique=defaultValue)
generate the name of a data folder based on a file name.
static wave preview_hdf_file(string filename)
load the preview of a PEARL HDF5 file.
static variable pearl_file_type(string filename)
check whether a file can be imported by this module.
static variable bp_dataset_display(WMButtonAction *ba)
static const string ks_filematch_itx
string adh5_load_complete(string ANickName, string APathName, string AFileName, variable load_data=defaultValue, variable load_attr=defaultValue)
import everything from a HDF5 file created by the Area Detector software.
static variable bp_dataset_next(WMButtonAction *ba)
static variable extract_preview_image(wave data, wave preview)
string psh5_load_info(string APathName, string AFileName)
load descriptive info from a PShell data file.
string adh5_load_reduced(string ANickName, string APathName, string AFileName, funcref reduction_func, string reduction_param, variable load_data=defaultValue, variable load_attr=defaultValue, variable progress=defaultValue)
load and reduce a dataset from a HDF5 file created by the Area Detector software. ...
string ad_display_profiles(wave image, string filter=defaultValue)
open a new profiles graph window.
static variable bp_update_filelist(WMButtonAction *ba)
variable pearl_data_explorer()
string itx_suggest_foldername(string filename, variable ignoredate=defaultValue, string sourcename=defaultValue, variable unique=defaultValue)
string psh5_load_complete(string ANickName, string APathName, string AFileName, variable load_data=defaultValue, variable load_attr=defaultValue)
load everything from a PShell data file.
static variable load_prefs()
variable prompt_func_params(string func_name, string *func_param)
static wave preview_itx_file(string filename)
load the preview of a general ITX file.
static variable display_dataset(string datasetname)
static dfr load_pshell_file(string filename, string options=defaultValue)
static variable save_prefs()
variable test_attributes_notebook()
static string show_preview_graph(wave data, wave xdata=defaultValue)
string mtrx_load_preview(string destName, string pathName, string fileName, string traces=defaultValue)
load a preview image from a Matrix data file.
string ad_display_slice(wave data)
display three-dimensional data by 2D slice.
static const string ks_filematch_mtrx
static variable attributes_notebook(wave attr_names, wave attr_values, string title)
string mtrx_load_file(string pathName, string fileName, string traces=defaultValue)
load all data from a Matrix data file.
static variable preview_attributes(dfref attr_folder, dfref dest_folder=defaultValue, wave attr_filter=defaultValue, variable include_datawaves=defaultValue, variable include_infowaves=defaultValue)
string adh5_list_reduction_funcs()
get a list of functions which can be used as reduction functions.
static variable notebook_add_attributes(string notebook_name, wave attr_filter, wave attr_names, wave attr_values)
threadsafe wave ad_extract_slab(wave dataset, variable x1, variable x2, variable y1, variable y2, variable z1, variable z2, string destname, variable noavg=defaultValue, variable pscale=defaultValue)
2D cut through 3D dataset, integrate in normal dimension