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
103 dfref saveDF = GetDataFolderDFR()
104 dfref df = $package_path
105 if (DataFolderRefStatus(df) == 1)
106 string fullPath = SpecialDirPath("Packages", 0, 0, 0)
108 NewPath/O/C/Q tempPackagePrefsPath, fullPath
109 fullPath += ":preferences.pxp"
111 string objects = "attr_filter;attr_filter_summary;s_filepath;s_hdf_options;s_reduction_params;s_preview_pvs"
112 SaveData /O /Q /J=objects fullPath
113 KillPath/Z tempPackagePrefsPath
121 dfref saveDF = GetDataFolderDFR()
125 NewDataFolder /O/S packages
126 NewDataFolder /O/S $package_name
127 dfref packageDF = GetDataFolderDFR()
128 string fullPath = SpecialDirPath("Packages", 0, 0, 0)
131 GetFileFolderInfo /Q /Z fullPath
133 fullPath += ":preferences.pxp"
134 GetFileFolderInfo /Q /Z fullPath
136 LoadData /O /R /Q fullPath
142 svar /sdfr=packageDF filepath = s_filepath
143 NewPath /O/Z pearl_explorer_filepath, filepath
172 #if exists("MFR_OpenResultFile") 187 dfref saveDF = GetDataFolderDFR()
191 wave wSelectedFiles = $(
package_path + "wSelectedFiles")
194 PathInfo pearl_explorer_filepath
196 all_files = IndexedFile(pearl_explorer_filepath, -1, "????")
197 nn = ItemsInList(all_files)
203 make /n=(nn) /t /free wtAllFiles
204 wtAllFiles = StringFromList(p, all_files)
206 Sort /A /R wtFiles, wtFiles
208 redimension /n=(numpnts(wtFiles)) wSelectedFiles
218 dfref saveDF = GetDataFolderDFR()
221 dfref rootdf = GetDataFolderDFR()
222 setdatafolder $package_path
223 dfref privatedf = GetDataFolderDFR()
226 wave wSelectedDatasets
227 variable maxdf = CountObjectsDFR(rootdf, 4)
228 redimension /n=(maxdf) wtDatasets
235 sdf = GetIndexedObjNameDFR(rootdf, 4, idf)
236 if (strlen(sdf) >= 1)
239 svar /z importer = pearl_explorer_import
240 if (svar_exists(importer))
241 wtDatasets[ndf] = sdf
250 redimension /n=(ndf) wtDatasets, wSelectedDatasets
251 wSelectedDatasets = 0
252 sort wtDatasets, wtDatasets
260 dfref saveDF = GetDataFolderDFR()
280 if (WaveExists(image))
283 if (exists("
PearlElog#set_panel_attributes") == 6) 285 sprintf cmd,
"PearlElog#set_panel_attributes(\"\", \"File=%s\")", ParseFilePath(0, filename,
":", 1, 0)
287 if (strlen(graphname) > 0)
288 sprintf cmd, "
PearlElog#set_panel_graphs(\"\", \"%s\")", graphname 312 dfref saveDF = GetDataFolderDFR()
314 setdatafolder $package_path
315 dfref previewDF = GetDataFolderDFR()
317 svar s_preview_source
319 if (! svar_exists(s_file_info))
320 string /g s_file_info
323 dfref tempDF = NewFreeDataFolder()
328 s_preview_file = filename
329 s_preview_source = ""
331 wave /z data = $dataname
332 if (waveexists(data))
333 duplicate /o data, previewDF:preview_image
335 print "no data found in file " + filename
338 if (strlen(s_preview_file) > 0)
344 dfref attrDF = tempDF:attr
345 if (DataFolderRefStatus(attrDF))
350 wave /z /sdfr=previewDF preview_image
368 dfref saveDF = GetDataFolderDFR()
369 setdatafolder $package_path
371 svar s_preview_source
373 s_preview_file = filename
374 s_preview_source = ""
375 wave /z preview_image
378 if (! svar_exists(s_file_info))
379 string /g s_file_info
381 if (strlen(s_preview_file) > 0)
387 if (DataFolderExists("attr"))
419 dfref saveDF = GetDataFolderDFR()
420 setdatafolder $package_path
422 svar s_preview_source
425 dfref dataDF = newfreedatafolder()
427 LoadWave /t/p=pearl_explorer_filepath/q filename
428 s_preview_file = s_filename
429 s_preview_source = ""
455 #if exists("MFR_OpenResultFile") 456 dfref saveDF = GetDataFolderDFR()
457 setdatafolder $package_path
458 variable /g V_MatrixFileReaderOverwrite = 1
459 variable /g V_MatrixFileReaderFolder = 0
460 variable /g V_MatrixFileReaderDouble = 0
462 svar s_preview_source
466 if (strlen(datanames) > 0)
467 s_preview_file = filename
469 dataname = StringFromList(0, datanames)
470 wave data = $dataname
471 duplicate /o $dataname, preview_image
472 s_preview_source = StringByKey("Dataset", note(data), "=", "\r")
475 if (svar_exists(s_file_info))
480 variable n = ItemsInList(datanames)
482 for (i = 0; i < n; i += 1)
483 s = StringFromList(i, datanames)
487 wave /z preview_image
490 wave /z preview_image = $
"" 503 switch (WaveDims(data))
505 redimension /n=(numpnts(data)) preview
509 redimension /n=(dimsize(data, 0), dimsize(data, 1)) preview
513 redimension /n=(dimsize(data, 0), dimsize(data, 1)) preview
514 z1 = floor(DimSize(data, 2) / 2)
516 wave slab =
ad_extract_slab(data, nan, nan, nan, nan, z1, z2,
"", pscale=1)
523 switch (WaveDims(data))
527 setscale /p y dimoffset(data, 1), dimdelta(data, 1), waveunits(data, 1), preview
529 setscale /p x dimoffset(data, 0), dimdelta(data, 0), waveunits(data, 0), preview
530 setscale d 0, 0, waveunits(data, -1), preview
537 dfref saveDF = GetDataFolderDFR()
539 if (!DataFolderExists("root:" + datasetname))
543 setdatafolder $datasetname
544 dfref datadf = GetDataFolderDFR()
547 setdatafolder $package_path
549 svar s_preview_source
551 if (WaveExists(data))
552 s_preview_file = datasetname
553 s_preview_source = ""
558 s_preview_file = datasetname
566 if (DataFolderExists("attr"))
579 dfref saveDF = GetDataFolderDFR()
581 setdatafolder $package_path
583 svar s_preview_source
592 string d_names = WaveList("*", ";", "DP:1")
593 variable nw = ItemsInList(d_names, ";")
594 variable npv = ItemsInList(s_preview_pvs, ";")
596 string wname, wnote, pv_name, pv_match
597 for (iw = 0; iw < nw; iw += 1)
598 wname = StringFromList(iw, d_names, ";")
600 pv_name = StringByKey("PV", wnote, "=", "\r")
602 for (ipv = 0; ipv < npv; ipv += 1)
603 pv_match = StringFromList(ipv, s_preview_pvs)
604 if (StringMatch(pv_name, pv_match))
606 s_preview_source = pv_name
628 if ((DimOffset(preview, 0) == 0) && (DimDelta(preview, 0) == 1))
629 string xname = StringByKey("Axis1", note(data), "=", "\r")
630 wave /z xwave = $xname
631 if (WaveExists(xwave))
633 variable monotonic = 0
634 duplicate /free xwave, xdiff
635 differentiate /p xwave /D=xdiff
636 duplicate /free xdiff, xflag
638 monotonic = sum(xflag) > numpnts(xwave) * 0.9
640 monotonic = monotonic || (sum(xflag) > numpnts(xwave) * 0.9)
642 setscale /i x xwave[0], xwave[numpnts(xwave)-1], waveunits(xwave, -1), preview
648 static function
preview_attributes(attr_folder, [dest_folder, attr_filter, include_datawaves, include_infowaves])
658 variable include_datawaves
660 variable include_infowaves
663 dfref saveDF = GetDataFolderDFR()
664 setdatafolder $package_path
666 if (ParamIsDefault(dest_folder))
667 dest_folder = GetDataFolderDFR()
669 if (ParamIsDefault(attr_filter))
670 wave /t /z attr_filter
672 if (ParamIsDefault(include_datawaves))
673 include_datawaves = 1
675 if (ParamIsDefault(include_infowaves))
676 include_infowaves = 1
679 setdatafolder dest_folder
680 wave /t /z attr_names, attr_values
681 if (!WaveExists(attr_names) || !WaveExists(attr_values))
682 make /n=(1) /o /t attr_names, attr_values
687 setdatafolder attr_folder
703 if (WaveExists(IN) && include_infowaves)
708 if (include_datawaves)
709 string waves = WaveList("*", ";", "")
710 string exceptions = "ID;IN;IU;IV"
711 waves = RemoveFromList(exceptions, waves)
712 nw = ItemsInList(waves, ";")
717 if (WaveExists(attr_filter) && (numpnts(attr_filter) >= 1))
718 nattr = numpnts(attr_filter)
719 redimension /n=(nattr) attr_names
720 attr_names = attr_filter
723 redimension /n=(ninfo) attr_names
724 attr_names = SelectString(strlen(ID[p]) >= 0, IN[p], ID[p])
729 redimension /n=(nattr) attr_names
730 for (iw = 0; iw < nw; iw +=1 )
731 sw = StringFromList(iw, waves, ";")
732 ss = StringByKey("PV", note($sw), "=", "\r")
733 FindValue /text=sw attr_names
734 if ((v_value < 0) && (strlen(ss) >= 0))
735 attr_names[iattr] = sw
741 redimension /n=(nattr) attr_names, attr_values
742 sort attr_names, attr_names
745 for (iattr = 0; iattr < nattr; iattr += 1)
746 sw = attr_names[iattr]
749 FindValue /text=sw ID
751 attr_values[iattr] = IV[v_value]
753 FindValue /text=sw IN
755 attr_values[iattr] = IV[v_value]
761 switch (WaveType($sw, 1))
764 if (WaveExists(w) && (numpnts(w) >= 1))
765 sprintf ss, "%g", w[0]
766 attr_values[iattr] = ss
771 if (WaveExists(wt) && (numpnts(wt) >= 1))
772 attr_values[iattr] = wt[0]
786 dfref saveDF = GetDataFolderDFR()
788 if (!DataFolderExists("root:" + datasetname))
792 setdatafolder $datasetname
793 dfref datadf = GetDataFolderDFR()
795 if (!WaveExists(data))
799 if (WaveExists(data))
800 switch(WaveDims(data))
816 dfref df = GetDataFolderDFR()
817 wave /t /sdfr=df attr_names
818 wave /t /sdfr=df attr_values
827 dfref saveDF = GetDataFolderDFR()
828 setdatafolder $package_path
829 wave /t/z attr_filter, attr_filter_summary
832 if (WinType(name) == 5)
833 Notebook $name selection={startOfFile, endOfFile}
834 Notebook $name text=
"" 836 NewNotebook /F=1 /K=1 /N=$name as title
837 GetWindow $name wsize
838 v_right = v_left + 260
839 v_bottom = v_top + 360
840 MoveWindow /W=$name v_left, v_top, v_right, v_bottom
841 Notebook $name tabs={2*72}
845 if (WaveExists(attr_filter_summary) && (numpnts(attr_filter_summary) >= 1))
846 notebook $name fStyle=1, text=
"Summary\r\r" 847 notebook $name fStyle=0
849 notebook $name text=
"\r" 853 notebook $name fStyle=1, text=
"All Attributes\r\r" 854 notebook $name fStyle=0
856 notebook $name selection={startOfFile,startOfFile}, findText={
"",1}
863 wave /t /z attr_filter
867 variable nw = numpnts(attr_names)
872 variable do_filter = WaveExists(attr_filter)
874 for (iw = 0; iw < nw; iw += 1)
877 FindValue /text=sw attr_filter
882 sprintf ss,
"%s\t%s\r", attr_names[iw], attr_values[iw]
883 notebook $notebook_name text=ss
893 dfref saveDF = GetDataFolderDFR()
894 setdatafolder $package_path
896 svar s_profiles_graph
898 svar s_preview_source
899 svar s_preview_trace_graph
901 if ((strlen(s_profiles_graph) > 0) && (WinType(s_profiles_graph) == 1))
902 KillWindow $s_profiles_graph
904 if ((strlen(s_preview_trace_graph) > 0) && (WinType(s_preview_trace_graph) == 1))
905 KillWindow $s_preview_trace_graph
909 if (wavedims(data) == 2)
911 ModifyGraph /w=$s_profiles_graph /z wbRGB=(48640,56832,60160)
912 graphname = s_profiles_graph
913 elseif (wavedims(data) == 1)
914 duplicate /o data, preview_trace
915 if (!ParamIsDefault(xdata))
916 duplicate /o xdata, preview_trace_x
918 duplicate /o data, preview_trace_x
920 setscale d 0, 0, WaveUnits(data, 0), preview_trace_x
923 ModifyGraph /w=$s_preview_trace_graph wbRGB=(48640,56832,60160)
924 graphname = s_preview_trace_graph
929 string title = "Preview " + s_preview_file
930 if (strlen(s_preview_source) > 0)
931 title = title + " (" + s_preview_source[0,31] + ")"
933 dowindow /f/t $graphname, title
943 display /n=pearl_explorer_1d /k=1 ytrace vs xtrace as "Preview"
944 string graphname = s_name
945 ModifyGraph /w=$graphname rgb[0]=(0,0,0)
946 ModifyGraph /w=$graphname grid=2
947 ModifyGraph /w=$graphname mirror=1
948 ModifyGraph /w=$graphname minor=1
949 ModifyGraph /w=$graphname axThick=0.5
950 ModifyGraph /w=$graphname gridRGB=(52224,52224,52224)
951 ModifyGraph /w=$graphname gridHair=0
952 ModifyGraph /w=$graphname tick=0
953 ModifyGraph /w=$graphname btLen=4
956 string labels = note(ytrace)
958 lab = StringByKey("AxisLabelX", labels, "=", "\r")
962 Label /w=$graphname bottom lab + " (\\U)"
963 lab = StringByKey("AxisLabelD", labels, "=", "\r")
967 Label /w=$graphname left lab + " (\\U)"
975 dfref saveDF = GetDataFolderDFR()
976 setdatafolder $package_path
980 variable nn = numpnts(wSelectedFiles)
982 for (ii = 0; ii < nn; ii += 1)
983 if (wSelectedFiles[ii])
984 if (ParamIsDefault(options))
1000 dfref saveDF = GetDataFolderDFR()
1005 if (ParamIsDefault(options))
1012 if (ParamIsDefault(options))
1028 setdatafolder saveDF
1034 string mode = StringByKey("mode", options, ":", ";")
1035 string reduction_func = StringByKey("reduction_func", options, ":", ";")
1037 string modes = "load_reduced"
1040 if (strlen(mode) == 0)
1041 mode = StringFromList(0, modes, ";")
1043 if (strlen(reduction_func) == 0)
1044 reduction_func = StringFromList(0, reduction_functions, ";")
1047 prompt mode, "Mode", popup, modes
1048 prompt reduction_func, "Reduction Function", popup, reduction_functions
1049 doprompt "HDF5 Loading Options", mode, reduction_func
1052 options = ReplaceStringByKey("mode", options, mode, ":", ";")
1053 options = ReplaceStringByKey("reduction_func", options, reduction_func, ":", ";")
1080 string prompt_name = "prompt_" + func_name
1081 if (exists(prompt_name) == 6)
1083 return prompt_func(func_param)
1094 dfref saveDF = GetDataFolderDFR()
1096 string loaded_filename = ""
1098 if (ParamIsDefault(options))
1101 if (strlen(options) == 0)
1103 options = pref_options
1106 pref_options = options
1113 string mode = StringByKey("mode", options, ":", ";")
1116 case "load_reduced":
1117 string reduction_func = StringByKey("reduction_func", options, ":", ";")
1118 svar pref_params = $(
package_path + "s_reduction_params")
1119 string reduction_params = pref_params
1121 pref_params = reduction_params
1122 print reduction_func, reduction_params
1123 psh5_load_reduced(nickname, "pearl_explorer_filepath", filename, $reduction_func, reduction_params)
1125 loaded_filename = s_filepath
1132 if (strlen(loaded_filename) > 0)
1133 setdatafolder $("root:" + nickname)
1134 dataDF = GetDataFolderDFR()
1138 setdatafolder saveDF
1146 dfref saveDF = GetDataFolderDFR()
1148 string loaded_filename = ""
1150 if (ParamIsDefault(options))
1153 if (strlen(options) == 0)
1155 options = pref_options
1158 pref_options = options
1165 string mode = StringByKey("mode", options, ":", ";")
1168 case "load_reduced":
1169 string reduction_func = StringByKey("reduction_func", options, ":", ";")
1170 svar pref_params = $(
package_path + "s_reduction_params")
1171 string reduction_params = pref_params
1173 pref_params = reduction_params
1174 print reduction_func, reduction_params
1175 loaded_filename =
adh5_load_reduced(nickname, "pearl_explorer_filepath", filename, $reduction_func, reduction_params)
1182 if (strlen(loaded_filename) > 0)
1183 setdatafolder $("root:" + nickname)
1184 dataDF = GetDataFolderDFR()
1188 setdatafolder saveDF
1196 dfref saveDF = GetDataFolderDFR()
1199 if (ParamIsDefault(options))
1204 newdatafolder /s/o $("root:" + nickname)
1205 dfref dataDF = GetDataFolderDFR()
1212 LoadWave /t/p=pearl_explorer_filepath/q filename
1213 svar waves = s_wavenames
1214 dfref actDF = GetDataFolderDFR()
1219 if (!DataFolderRefsEqual(actDF, dataDF))
1222 setdatafolder dataDF
1223 if (ItemsInList(WaveList("*", ";", ""), ";") == 0)
1224 killdatafolder /z dataDF
1228 setdatafolder saveDF
1239 dfref saveDF = GetDataFolderDFR()
1242 #if exists("MFR_OpenResultFile") 1244 string datasets =
"" 1246 if (strlen(datasets) > 0)
1247 string /g pearl_explorer_import =
"load_mtrx_file" 1248 string s1 = StringFromList(0, datasets)
1250 dataDF = GetWavesDataFolderDFR(w1)
1254 setdatafolder saveDF
1274 if (ParamIsDefault(ignoredate))
1277 if (ParamIsDefault(unique))
1281 string basename = ParseFilePath(3, filename,
":", 0, 0)
1282 string extension = ParseFilePath(4, filename, ":", 0, 0)
1286 if (strsearch(basename, "X03DA_PC", 0, 2) >= 0)
1287 autosource = "sscan"
1288 basename = ReplaceString("_", basename, "-")
1290 elseif (strsearch(basename, "otf", 0, 2) >= 0)
1293 if (ParamIsDefault(sourcename))
1294 sourcename = autosource
1297 variable nparts = ItemsInList(basename, "-")
1299 string datepart = StringFromList(nparts - 2, basename, "-")
1300 string indexpart = StringFromList(nparts - 1, basename, "-")
1302 sprintf nickname, "%s_%s", sourcename, indexpart
1304 sprintf nickname, "%s_%s_%s", sourcename, datepart, indexpart
1310 if (unique && CheckName(nickname, 11))
1311 nickname = UniqueName(nickname + "_", 11, 0)
1318 PauseUpdate; Silent 1
1319 NewPanel /K=1 /W=(800,0,1530,444) as "PEARL Data Explorer"
1320 ModifyPanel cbRGB=(48640,56832,60160)
1322 GroupBox gb_filepath,pos={8,4},size={224,52},title=
"file system folder" 1323 TitleBox tb_filepath,pos={20,24},size={174,20},frame=2
1324 TitleBox tb_filepath,variable=root:packages:pearl_explorer:s_filepath,fixedSize=1
1326 Button b_browse_filepath,fColor=(65280,48896,32768)
1328 GroupBox gb_prefs,pos={240,4},size={58,52},title=
"prefs",help={
"explorer package preferences"}
1330 Button b_save_prefs,help={
"save preferences of the data explorer package (data file path, attributes filter)"}
1331 Button b_save_prefs,fColor=(65280,48896,32768)
1333 Button b_load_prefs,help={
"load preferences of the data explorer package"}
1334 Button b_load_prefs,fColor=(65280,48896,32768)
1336 GroupBox gb_filelist,pos={8,64},size={224,372},title=
"data files" 1338 ListBox lb_files,listWave=root:packages:pearl_explorer:wtFiles
1339 ListBox lb_files,selWave=root:packages:pearl_explorer:wSelectedFiles,row= 11,mode= 4
1340 TitleBox tb_file_info,pos={20,300},size={198,78},frame=2,fixedSize=1
1341 TitleBox tb_file_info,variable= root:packages:pearl_explorer:s_file_info
1344 Button b_update_filelist,fColor=(65280,48896,32768)
1345 CheckBox cb_file_preview,pos={84,390},size={60,20},title=
"preview" 1346 CheckBox cb_file_preview,help={
"enable/disable automatic preview window when selecting a data file"}
1347 CheckBox cb_file_preview,value=1
1349 Button b_file_prev,help={
"previous file"}
1350 Button b_file_prev,fColor=(65280,48896,32768)
1352 Button b_file_next,help={
"next file"}
1353 Button b_file_next,fColor=(65280,48896,32768)
1356 Button b_load_files,help={
"load the complete contents from the selected files"}
1357 Button b_load_files,fColor=(65280,48896,32768)
1359 Button b_load_files_opt,help={
"load data from the selected files with options (reduced dimensions)"}
1360 Button b_load_files_opt,fColor=(65280,48896,32768)
1363 GroupBox gb_datasets,pos={240,64},size={224,372},title=
"datasets" 1365 ListBox lb_datasets,listWave=root:packages:pearl_explorer:wtDatasets
1366 ListBox lb_datasets,selWave=root:packages:pearl_explorer:wSelectedDatasets,mode= 1
1367 ListBox lb_datasets,selRow= -1
1370 Button b_update_datasets,help={
"update the list of datasets"}
1371 Button b_update_datasets,fColor=(65280,48896,32768)
1372 CheckBox cb_dataset_preview,pos={316,390},size={60,20},title=
"preview" 1373 CheckBox cb_dataset_preview,help={
"enable/disable automatic preview window when selecting a dataset"}
1374 CheckBox cb_dataset_preview,value=0
1376 Button b_dataset_prev,help={
"goto previous dataset"}
1377 Button b_dataset_prev,fColor=(65280,48896,32768)
1379 Button b_dataset_next,help={
"goto next dataset"}
1380 Button b_dataset_next,fColor=(65280,48896,32768)
1383 Button b_dataset_folder,help={
"set the current data folder of the selected dataset"}
1384 Button b_dataset_folder,fColor=(65280,48896,32768)
1386 Button b_dataset_display,help={
"display the selected dataset in its own window"}
1387 Button b_dataset_display,fColor=(65280,48896,32768)
1389 GroupBox gb_preview,pos={472,4},size={250,52},title=
"preview" 1390 TitleBox tb_preview_file,pos={484,24},size={226,20},frame=2
1391 TitleBox tb_preview_file,variable=root:packages:pearl_explorer:s_preview_file,fixedSize=1
1393 GroupBox gb_attributes,pos={472,64},size={250,372},title=
"attributes" 1395 Button b_attr_notebook,help={
"show attribute list in a notebook"}
1396 Button b_attr_notebook,fColor=(65280,48896,32768)
1398 String fldrSav0= GetDataFolder(1)
1399 SetDataFolder root:packages:pearl_explorer:
1400 Edit/W=(484,84,710,384)/HOST=# attr_names,attr_values
1401 ModifyTable format(Point)=1,width(Point)=0,width(attr_names)=103,width(attr_values)=103
1402 ModifyTable statsArea=85
1403 SetDataFolder fldrSav0
1405 SetActiveSubwindow ##
1409 STRUCT WMButtonAction &ba
1411 switch( ba.eventCode )
1422 static function bp_save_prefs(ba) : ButtonControl
1423 STRUCT WMButtonAction &ba
1425 switch( ba.eventCode )
1436 static function bp_browse_filepath(ba) : ButtonControl
1437 STRUCT WMButtonAction &ba
1439 dfref saveDF = GetDataFolderDFR()
1441 switch( ba.eventCode )
1443 PathInfo /S pearl_explorer_filepath
1444 NewPath /M=
"select data file folder" /O/Z pearl_explorer_filepath
1446 PathInfo /S pearl_explorer_filepath
1456 setdatafolder saveDF
1460 static function bp_update_filelist(ba) : ButtonControl
1461 STRUCT WMButtonAction &ba
1463 switch( ba.eventCode )
1474 static function bp_load_files(ba) : ButtonControl
1475 STRUCT WMButtonAction &ba
1477 switch( ba.eventCode )
1488 static function bp_load_files_opt(ba) : ButtonControl
1489 STRUCT WMButtonAction &ba
1491 switch( ba.eventCode )
1502 static function bp_file_next(ba) : ButtonControl
1503 STRUCT WMButtonAction &ba
1505 dfref saveDF = GetDataFolderDFR()
1507 switch( ba.eventCode )
1509 setdatafolder $package_path
1512 FindValue /i=1 wSelectedFiles
1514 if (v_value >= numpnts(wtFiles))
1515 v_value = min(numpnts(wtFiles) - 1, 0)
1517 wSelectedFiles = p == v_value
1519 variable ifile = v_value
1530 setdatafolder saveDF
1534 static function bp_file_prev(ba) : ButtonControl
1535 STRUCT WMButtonAction &ba
1537 dfref saveDF = GetDataFolderDFR()
1539 switch( ba.eventCode )
1541 setdatafolder $package_path
1544 FindValue /i=1 wSelectedFiles
1547 v_value = numpnts(wtFiles) - 1
1549 wSelectedFiles = p == v_value
1551 variable ifile = v_value
1562 setdatafolder saveDF
1567 STRUCT WMListboxAction &lba
1569 Variable row = lba.row
1570 Variable col = lba.col
1571 WAVE/T/Z listWave = lba.listWave
1572 WAVE/Z selWave = lba.selWave
1574 switch( lba.eventCode )
1601 static function bp_update_datasets(ba) : ButtonControl
1602 STRUCT WMButtonAction &ba
1604 switch( ba.eventCode )
1615 static function bp_dataset_folder(ba) : ButtonControl
1616 STRUCT WMButtonAction &ba
1618 switch( ba.eventCode )
1622 setdatafolder $package_path
1624 string dataset = wtDatasets[v_value]
1626 sprintf cmd,
"setdatafolder root:%s", PossiblyQuoteName(dataset)
1628 cmd =
"setdatafolder :scan1" 1630 sprintf cmd,
"setdatafolder %s", GetDataFolder(1)
1641 static function bp_dataset_display(ba) : ButtonControl
1642 STRUCT WMButtonAction &ba
1644 switch( ba.eventCode )
1648 setdatafolder $package_path
1650 string dataset = wtDatasets[v_value]
1661 static function bp_dataset_next(ba) : ButtonControl
1662 STRUCT WMButtonAction &ba
1664 switch( ba.eventCode )
1667 wave /t wtDatasets = $(s_datafolder + s_value)
1669 if (v_value >= numpnts(wtDatasets))
1670 v_value = min(0, numpnts(wtDatasets) - 1)
1674 variable ids = v_value
1688 static function bp_dataset_prev(ba) : ButtonControl
1689 STRUCT WMButtonAction &ba
1691 switch( ba.eventCode )
1694 wave /t wtDatasets = $(s_datafolder + s_value)
1697 v_value = max(-1, numpnts(wtDatasets) - 1)
1701 variable ids = v_value
1715 static function lbp_datasets(lba) : ListBoxControl
1716 STRUCT WMListboxAction &lba
1718 Variable row = lba.row
1719 Variable col = lba.col
1720 WAVE/T/Z listWave = lba.listWave
1721 WAVE/Z selWave = lba.selWave
1723 switch( lba.eventCode )
1750 static function bp_attr_notebook(ba) : ButtonControl
1751 STRUCT WMButtonAction &ba
1753 dfref saveDF = GetDataFolderDFR()
1755 switch( ba.eventCode )
1757 setdatafolder $package_path
1759 wave /t /z attr_names
1760 wave /t /z attr_values
1761 if (WaveExists(attr_names))
1769 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()
save persistent package data to the preferences file.
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