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-pshell-import" 9 #if exists("MFR_OpenResultFile") 10 #include "pearl-matrix-import" 57 dfref savefolder = GetDataFolderDFR()
59 newdatafolder /o/s packages
60 newdatafolder /o/s $package_name
61 if (exists("v_InitPanelDone") == 2)
62 SetDataFolder savefolder
67 make /o/n=0/i wSelectedFiles,wSelectedDatasets
68 make /o/n=0/t wtDatasets
69 make /o/n=0/t wtPositioners,wtDetectors
70 make /o/n=0/i wSelectedPositioners,wSelectedDetectors
72 make /o/n=(1,1) preview_image
73 make /o/n=0 preview_trace
74 make /o/n=0/t attr_names, attr_values, attr_filter, attr_filter_summary
77 string /g s_filepath = ""
78 string /g s_hdf_options = ""
79 string /g s_reduction_params = ""
80 string /g s_preview_pvs = ""
82 s_preview_pvs = "*OP:CURRENT*;*Stats*Total*;*KEITHLEY*READOUT;*CADC*"
85 string /g s_preview_file = ""
86 string /g s_preview_source = ""
87 string /g s_profiles_graph = ""
88 string /g s_preview_trace_graph = ""
89 string /g s_file_info = ""
91 variable/g v_InitPanelDone = 1
93 SetDataFolder savefolder
99 dfref saveDF = GetDataFolderDFR()
101 string fullPath = SpecialDirPath("Packages", 0, 0, 0)
103 NewPath/O/C/Q tempPackagePrefsPath, fullPath
104 fullPath += ":preferences.pxp"
106 SetDataFolder root:packages
107 SetDataFolder $package_name
108 string objects = "attr_filter;attr_filter_summary;s_filepath;s_hdf_options;s_reduction_params;s_preview_pvs"
109 SaveData /O /Q /J=objects fullPath
111 KillPath/Z tempPackagePrefsPath
119 dfref saveDF = GetDataFolderDFR()
123 NewDataFolder /O/S packages
124 NewDataFolder /O/S $package_name
125 dfref packageDF = GetDataFolderDFR()
126 string fullPath = SpecialDirPath("Packages", 0, 0, 0)
129 GetFileFolderInfo /Q /Z fullPath
131 fullPath += ":preferences.pxp"
132 GetFileFolderInfo /Q /Z fullPath
134 LoadData /O /R /Q fullPath
140 svar /sdfr=packageDF filepath = s_filepath
141 NewPath /O/Z pearl_explorer_filepath, filepath
170 #if exists("MFR_OpenResultFile") 185 dfref saveDF = GetDataFolderDFR()
189 wave wSelectedFiles = $(
package_path + "wSelectedFiles")
192 PathInfo pearl_explorer_filepath
194 all_files = IndexedFile(pearl_explorer_filepath, -1, "????")
195 nn = ItemsInList(all_files)
201 make /n=(nn) /t /free wtAllFiles
202 wtAllFiles = StringFromList(p, all_files)
204 Sort /A /R wtFiles, wtFiles
206 redimension /n=(numpnts(wtFiles)) wSelectedFiles
216 dfref saveDF = GetDataFolderDFR()
219 dfref rootdf = GetDataFolderDFR()
220 setdatafolder $package_path
221 dfref privatedf = GetDataFolderDFR()
224 wave wSelectedDatasets
225 variable maxdf = CountObjectsDFR(rootdf, 4)
226 redimension /n=(maxdf) wtDatasets
233 sdf = GetIndexedObjNameDFR(rootdf, 4, idf)
234 if (strlen(sdf) >= 1)
237 svar /z importer = pearl_explorer_import
238 if (svar_exists(importer))
239 wtDatasets[ndf] = sdf
248 redimension /n=(ndf) wtDatasets, wSelectedDatasets
249 wSelectedDatasets = 0
250 sort wtDatasets, wtDatasets
258 dfref saveDF = GetDataFolderDFR()
278 if (WaveExists(image))
281 if (exists("
PearlElog#set_panel_attributes") == 6) 283 sprintf cmd,
"PearlElog#set_panel_attributes(\"\", \"File=%s\")", ParseFilePath(0, filename,
":", 1, 0)
285 if (strlen(graphname) > 0)
286 sprintf cmd, "
PearlElog#set_panel_graphs(\"\", \"%s\")", graphname 310 dfref saveDF = GetDataFolderDFR()
312 setdatafolder $package_path
313 dfref previewDF = GetDataFolderDFR()
315 svar s_preview_source
317 if (! svar_exists(s_file_info))
318 string /g s_file_info
321 dfref tempDF = NewFreeDataFolder()
326 s_preview_file = filename
327 s_preview_source = ""
329 wave /z data = $dataname
330 if (waveexists(data))
331 duplicate /o data, previewDF:preview_image
333 print "no data found in file " + filename
336 if (strlen(s_preview_file) > 0)
342 dfref attrDF = tempDF:attr
343 if (DataFolderRefStatus(attrDF))
348 wave /z /sdfr=previewDF preview_image
366 dfref saveDF = GetDataFolderDFR()
367 setdatafolder $package_path
369 svar s_preview_source
371 s_preview_file = filename
372 s_preview_source = ""
373 wave /z preview_image
376 if (! svar_exists(s_file_info))
377 string /g s_file_info
379 if (strlen(s_preview_file) > 0)
385 if (DataFolderExists("attr"))
417 dfref saveDF = GetDataFolderDFR()
418 setdatafolder $package_path
420 svar s_preview_source
423 dfref dataDF = newfreedatafolder()
425 LoadWave /t/p=pearl_explorer_filepath/q filename
426 s_preview_file = s_filename
427 s_preview_source = ""
453 #if exists("MFR_OpenResultFile") 454 dfref saveDF = GetDataFolderDFR()
455 setdatafolder $package_path
456 variable /g V_MatrixFileReaderOverwrite = 1
457 variable /g V_MatrixFileReaderFolder = 0
458 variable /g V_MatrixFileReaderDouble = 0
460 svar s_preview_source
464 if (strlen(datanames) > 0)
465 s_preview_file = filename
467 dataname = StringFromList(0, datanames)
468 wave data = $dataname
469 duplicate /o $dataname, preview_image
470 s_preview_source = StringByKey("Dataset", note(data), "=", "\r")
473 if (svar_exists(s_file_info))
478 variable n = ItemsInList(datanames)
480 for (i = 0; i < n; i += 1)
481 s = StringFromList(i, datanames)
485 wave /z preview_image
488 wave /z preview_image = $
"" 501 switch (WaveDims(data))
503 redimension /n=(numpnts(data)) preview
507 redimension /n=(dimsize(data, 0), dimsize(data, 1)) preview
511 redimension /n=(dimsize(data, 0), dimsize(data, 1)) preview
512 z1 = floor(DimSize(data, 2) / 2)
514 wave slab =
ad_extract_slab(data, nan, nan, nan, nan, z1, z2,
"", pscale=1)
521 switch (WaveDims(data))
525 setscale /p y dimoffset(data, 1), dimdelta(data, 1), waveunits(data, 1), preview
527 setscale /p x dimoffset(data, 0), dimdelta(data, 0), waveunits(data, 0), preview
528 setscale d 0, 0, waveunits(data, -1), preview
535 dfref saveDF = GetDataFolderDFR()
537 if (!DataFolderExists("root:" + datasetname))
541 setdatafolder $datasetname
542 dfref datadf = GetDataFolderDFR()
545 setdatafolder $package_path
547 svar s_preview_source
549 if (WaveExists(data))
550 s_preview_file = datasetname
551 s_preview_source = ""
556 s_preview_file = datasetname
564 if (DataFolderExists("attr"))
577 dfref saveDF = GetDataFolderDFR()
579 setdatafolder $package_path
581 svar s_preview_source
590 string d_names = WaveList("*", ";", "DP:1")
591 variable nw = ItemsInList(d_names, ";")
592 variable npv = ItemsInList(s_preview_pvs, ";")
594 string wname, wnote, pv_name, pv_match
595 for (iw = 0; iw < nw; iw += 1)
596 wname = StringFromList(iw, d_names, ";")
598 pv_name = StringByKey("PV", wnote, "=", "\r")
600 for (ipv = 0; ipv < npv; ipv += 1)
601 pv_match = StringFromList(ipv, s_preview_pvs)
602 if (StringMatch(pv_name, pv_match))
604 s_preview_source = pv_name
626 if ((DimOffset(preview, 0) == 0) && (DimDelta(preview, 0) == 1))
627 string xname = StringByKey("Axis1", note(data), "=", "\r")
628 wave /z xwave = $xname
629 if (WaveExists(xwave))
631 variable monotonic = 0
632 duplicate /free xwave, xdiff
633 differentiate /p xwave /D=xdiff
634 duplicate /free xdiff, xflag
636 monotonic = sum(xflag) > numpnts(xwave) * 0.9
638 monotonic = monotonic || (sum(xflag) > numpnts(xwave) * 0.9)
640 setscale /i x xwave[0], xwave[numpnts(xwave)-1], waveunits(xwave, -1), preview
646 static function
preview_attributes(attr_folder, [dest_folder, attr_filter, include_datawaves, include_infowaves])
656 variable include_datawaves
658 variable include_infowaves
661 dfref saveDF = GetDataFolderDFR()
662 setdatafolder $package_path
664 if (ParamIsDefault(dest_folder))
665 dest_folder = GetDataFolderDFR()
667 if (ParamIsDefault(attr_filter))
668 wave /t /z attr_filter
670 if (ParamIsDefault(include_datawaves))
671 include_datawaves = 1
673 if (ParamIsDefault(include_infowaves))
674 include_infowaves = 1
677 setdatafolder dest_folder
678 wave /t /z attr_names, attr_values
679 if (!WaveExists(attr_names) || !WaveExists(attr_values))
680 make /n=(1) /o /t attr_names, attr_values
685 setdatafolder attr_folder
701 if (WaveExists(IN) && include_infowaves)
706 if (include_datawaves)
707 string waves = WaveList("*", ";", "")
708 string exceptions = "ID;IN;IU;IV"
709 waves = RemoveFromList(exceptions, waves)
710 nw = ItemsInList(waves, ";")
715 if (WaveExists(attr_filter) && (numpnts(attr_filter) >= 1))
716 nattr = numpnts(attr_filter)
717 redimension /n=(nattr) attr_names
718 attr_names = attr_filter
721 redimension /n=(ninfo) attr_names
722 attr_names = SelectString(strlen(ID[p]) >= 0, IN[p], ID[p])
727 redimension /n=(nattr) attr_names
728 for (iw = 0; iw < nw; iw +=1 )
729 sw = StringFromList(iw, waves, ";")
730 ss = StringByKey("PV", note($sw), "=", "\r")
731 FindValue /text=sw attr_names
732 if ((v_value < 0) && (strlen(ss) >= 0))
733 attr_names[iattr] = sw
739 redimension /n=(nattr) attr_names, attr_values
740 sort attr_names, attr_names
743 for (iattr = 0; iattr < nattr; iattr += 1)
744 sw = attr_names[iattr]
747 FindValue /text=sw ID
749 attr_values[iattr] = IV[v_value]
751 FindValue /text=sw IN
753 attr_values[iattr] = IV[v_value]
759 switch (WaveType($sw, 1))
762 if (WaveExists(w) && (numpnts(w) >= 1))
763 sprintf ss, "%g", w[0]
764 attr_values[iattr] = ss
769 if (WaveExists(wt) && (numpnts(wt) >= 1))
770 attr_values[iattr] = wt[0]
784 dfref saveDF = GetDataFolderDFR()
786 if (!DataFolderExists("root:" + datasetname))
790 setdatafolder $datasetname
791 dfref datadf = GetDataFolderDFR()
793 if (!WaveExists(data))
797 if (WaveExists(data))
798 switch(WaveDims(data))
814 dfref df = GetDataFolderDFR()
815 wave /t /sdfr=df attr_names
816 wave /t /sdfr=df attr_values
825 dfref saveDF = GetDataFolderDFR()
826 setdatafolder $package_path
827 wave /t/z attr_filter, attr_filter_summary
829 string name = CleanupName("nb_" + title[0,28], 0)
830 if (WinType(name) == 5)
831 Notebook $name selection={startOfFile, endOfFile}
832 Notebook $name text=
"" 834 NewNotebook /F=1 /K=1 /N=$name as title
835 GetWindow $name wsize
836 v_right = v_left + 260
837 v_bottom = v_top + 360
838 MoveWindow /W=$name v_left, v_top, v_right, v_bottom
839 Notebook $name tabs={2*72}
843 if (WaveExists(attr_filter_summary) && (numpnts(attr_filter_summary) >= 1))
844 notebook $name fStyle=1, text=
"Summary\r\r" 845 notebook $name fStyle=0
847 notebook $name text=
"\r" 851 notebook $name fStyle=1, text=
"All Attributes\r\r" 852 notebook $name fStyle=0
854 notebook $name selection={startOfFile,startOfFile}, findText={
"",1}
861 wave /t /z attr_filter
865 variable nw = numpnts(attr_names)
870 variable do_filter = WaveExists(attr_filter)
872 for (iw = 0; iw < nw; iw += 1)
875 FindValue /text=sw attr_filter
880 sprintf ss,
"%s\t%s\r", attr_names[iw], attr_values[iw]
881 notebook $notebook_name text=ss
891 dfref saveDF = GetDataFolderDFR()
892 setdatafolder $package_path
894 svar s_profiles_graph
896 svar s_preview_source
897 svar s_preview_trace_graph
899 if ((strlen(s_profiles_graph) > 0) && (WinType(s_profiles_graph) == 1))
900 KillWindow $s_profiles_graph
902 if ((strlen(s_preview_trace_graph) > 0) && (WinType(s_preview_trace_graph) == 1))
903 KillWindow $s_preview_trace_graph
907 if (wavedims(data) == 2)
909 ModifyGraph /w=$s_profiles_graph /z wbRGB=(48640,56832,60160)
910 graphname = s_profiles_graph
911 elseif (wavedims(data) == 1)
912 duplicate /o data, preview_trace
913 if (!ParamIsDefault(xdata))
914 duplicate /o xdata, preview_trace_x
916 duplicate /o data, preview_trace_x
918 setscale d 0, 0, WaveUnits(data, 0), preview_trace_x
921 ModifyGraph /w=$s_preview_trace_graph wbRGB=(48640,56832,60160)
922 graphname = s_preview_trace_graph
927 string title = "Preview " + s_preview_file
928 if (strlen(s_preview_source) > 0)
929 title = title + " (" + s_preview_source[0,31] + ")"
931 dowindow /f/t $graphname, title
941 display /n=pearl_explorer_1d /k=1 ytrace vs xtrace as "Preview"
942 string graphname = s_name
943 ModifyGraph /w=$graphname rgb[0]=(0,0,0)
944 ModifyGraph /w=$graphname grid=2
945 ModifyGraph /w=$graphname mirror=1
946 ModifyGraph /w=$graphname minor=1
947 ModifyGraph /w=$graphname axThick=0.5
948 ModifyGraph /w=$graphname gridRGB=(52224,52224,52224)
949 ModifyGraph /w=$graphname gridHair=0
950 ModifyGraph /w=$graphname tick=0
951 ModifyGraph /w=$graphname btLen=4
954 string labels = note(ytrace)
956 lab = StringByKey("AxisLabelX", labels, "=", "\r")
960 Label /w=$graphname bottom lab + " (\\U)"
961 lab = StringByKey("AxisLabelD", labels, "=", "\r")
965 Label /w=$graphname left lab + " (\\U)"
973 dfref saveDF = GetDataFolderDFR()
974 setdatafolder $package_path
978 variable nn = numpnts(wSelectedFiles)
980 for (ii = 0; ii < nn; ii += 1)
981 if (wSelectedFiles[ii])
982 if (ParamIsDefault(options))
998 dfref saveDF = GetDataFolderDFR()
1003 if (ParamIsDefault(options))
1010 if (ParamIsDefault(options))
1026 setdatafolder saveDF
1032 string mode = StringByKey("mode", options, ":", ";")
1033 string reduction_func = StringByKey("reduction_func", options, ":", ";")
1035 string modes = "load_reduced"
1038 if (strlen(mode) == 0)
1039 mode = StringFromList(0, modes, ";")
1041 if (strlen(reduction_func) == 0)
1042 reduction_func = StringFromList(0, reduction_functions, ";")
1045 prompt mode, "Mode", popup, modes
1046 prompt reduction_func, "Reduction Function", popup, reduction_functions
1047 doprompt "HDF5 Loading Options", mode, reduction_func
1050 options = ReplaceStringByKey("mode", options, mode, ":", ";")
1051 options = ReplaceStringByKey("reduction_func", options, reduction_func, ":", ";")
1078 string prompt_name = "prompt_" + func_name
1079 if (exists(prompt_name) == 6)
1081 return prompt_func(func_param)
1092 dfref saveDF = GetDataFolderDFR()
1094 string loaded_filename = ""
1096 if (ParamIsDefault(options))
1099 if (strlen(options) == 0)
1101 options = pref_options
1104 pref_options = options
1111 string mode = StringByKey("mode", options, ":", ";")
1114 case "load_reduced":
1115 string reduction_func = StringByKey("reduction_func", options, ":", ";")
1116 svar pref_params = $(
package_path + "s_reduction_params")
1117 string reduction_params = pref_params
1119 pref_params = reduction_params
1120 print reduction_func, reduction_params
1121 psh5_load_reduced(nickname, "pearl_explorer_filepath", filename, $reduction_func, reduction_params)
1123 loaded_filename = s_filepath
1130 if (strlen(loaded_filename) > 0)
1131 setdatafolder $("root:" + nickname)
1132 dataDF = GetDataFolderDFR()
1136 setdatafolder saveDF
1144 dfref saveDF = GetDataFolderDFR()
1146 string loaded_filename = ""
1148 if (ParamIsDefault(options))
1151 if (strlen(options) == 0)
1153 options = pref_options
1156 pref_options = options
1163 string mode = StringByKey("mode", options, ":", ";")
1166 case "load_reduced":
1167 string reduction_func = StringByKey("reduction_func", options, ":", ";")
1168 svar pref_params = $(
package_path + "s_reduction_params")
1169 string reduction_params = pref_params
1171 pref_params = reduction_params
1172 print reduction_func, reduction_params
1173 loaded_filename =
adh5_load_reduced(nickname, "pearl_explorer_filepath", filename, $reduction_func, reduction_params)
1180 if (strlen(loaded_filename) > 0)
1181 setdatafolder $("root:" + nickname)
1182 dataDF = GetDataFolderDFR()
1186 setdatafolder saveDF
1194 dfref saveDF = GetDataFolderDFR()
1197 if (ParamIsDefault(options))
1202 newdatafolder /s/o $("root:" + nickname)
1203 dfref dataDF = GetDataFolderDFR()
1210 LoadWave /t/p=pearl_explorer_filepath/q filename
1211 svar waves = s_wavenames
1212 dfref actDF = GetDataFolderDFR()
1217 if (!DataFolderRefsEqual(actDF, dataDF))
1220 setdatafolder dataDF
1221 if (ItemsInList(WaveList("*", ";", ""), ";") == 0)
1222 killdatafolder /z dataDF
1226 setdatafolder saveDF
1237 dfref saveDF = GetDataFolderDFR()
1240 #if exists("MFR_OpenResultFile") 1242 string datasets =
"" 1244 if (strlen(datasets) > 0)
1245 string /g pearl_explorer_import =
"load_mtrx_file" 1246 string s1 = StringFromList(0, datasets)
1248 dataDF = GetWavesDataFolderDFR(w1)
1252 setdatafolder saveDF
1272 if (ParamIsDefault(ignoredate))
1275 if (ParamIsDefault(unique))
1279 string basename = ParseFilePath(3, filename,
":", 0, 0)
1280 string extension = ParseFilePath(4, filename, ":", 0, 0)
1284 if (strsearch(basename, "X03DA_PC", 0, 2) >= 0)
1285 autosource = "sscan"
1286 basename = ReplaceString("_", basename, "-")
1288 elseif (strsearch(basename, "otf", 0, 2) >= 0)
1291 if (ParamIsDefault(sourcename))
1292 sourcename = autosource
1295 variable nparts = ItemsInList(basename, "-")
1297 string datepart = StringFromList(nparts - 2, basename, "-")
1298 string indexpart = StringFromList(nparts - 1, basename, "-")
1300 sprintf nickname, "%s_%s", sourcename, indexpart
1302 sprintf nickname, "%s_%s_%s", sourcename, datepart, indexpart
1305 nickname = CleanupName(basename, 0)
1308 if (unique && CheckName(nickname, 11))
1309 nickname = UniqueName(nickname + "_", 11, 0)
1316 PauseUpdate; Silent 1
1317 NewPanel /K=1 /W=(800,0,1530,444) as "PEARL Data Explorer"
1318 ModifyPanel cbRGB=(48640,56832,60160)
1320 GroupBox gb_filepath,pos={8,4},size={224,52},title=
"file system folder" 1321 TitleBox tb_filepath,pos={20,24},size={174,20},frame=2
1322 TitleBox tb_filepath,variable=root:packages:pearl_explorer:s_filepath,fixedSize=1
1324 Button b_browse_filepath,fColor=(65280,48896,32768)
1326 GroupBox gb_prefs,pos={240,4},size={58,52},title=
"prefs",help={
"explorer package preferences"}
1328 Button b_save_prefs,help={
"save preferences of the data explorer package (data file path, attributes filter)"}
1329 Button b_save_prefs,fColor=(65280,48896,32768)
1331 Button b_load_prefs,help={
"load preferences of the data explorer package"}
1332 Button b_load_prefs,fColor=(65280,48896,32768)
1334 GroupBox gb_filelist,pos={8,64},size={224,372},title=
"data files" 1336 ListBox lb_files,listWave=root:packages:pearl_explorer:wtFiles
1337 ListBox lb_files,selWave=root:packages:pearl_explorer:wSelectedFiles,row= 11,mode= 4
1338 TitleBox tb_file_info,pos={20,300},size={198,78},frame=2,fixedSize=1
1339 TitleBox tb_file_info,variable= root:packages:pearl_explorer:s_file_info
1342 Button b_update_filelist,fColor=(65280,48896,32768)
1343 CheckBox cb_file_preview,pos={84,390},size={60,20},title=
"preview" 1344 CheckBox cb_file_preview,help={
"enable/disable automatic preview window when selecting a data file"}
1345 CheckBox cb_file_preview,value=1
1347 Button b_file_prev,help={
"previous file"}
1348 Button b_file_prev,fColor=(65280,48896,32768)
1350 Button b_file_next,help={
"next file"}
1351 Button b_file_next,fColor=(65280,48896,32768)
1354 Button b_load_files,help={
"load the complete contents from the selected files"}
1355 Button b_load_files,fColor=(65280,48896,32768)
1357 Button b_load_files_opt,help={
"load data from the selected files with options (reduced dimensions)"}
1358 Button b_load_files_opt,fColor=(65280,48896,32768)
1361 GroupBox gb_datasets,pos={240,64},size={224,372},title=
"datasets" 1363 ListBox lb_datasets,listWave=root:packages:pearl_explorer:wtDatasets
1364 ListBox lb_datasets,selWave=root:packages:pearl_explorer:wSelectedDatasets,mode= 1
1365 ListBox lb_datasets,selRow= -1
1368 Button b_update_datasets,help={
"update the list of datasets"}
1369 Button b_update_datasets,fColor=(65280,48896,32768)
1370 CheckBox cb_dataset_preview,pos={316,390},size={60,20},title=
"preview" 1371 CheckBox cb_dataset_preview,help={
"enable/disable automatic preview window when selecting a dataset"}
1372 CheckBox cb_dataset_preview,value=0
1374 Button b_dataset_prev,help={
"goto previous dataset"}
1375 Button b_dataset_prev,fColor=(65280,48896,32768)
1377 Button b_dataset_next,help={
"goto next dataset"}
1378 Button b_dataset_next,fColor=(65280,48896,32768)
1381 Button b_dataset_folder,help={
"set the current data folder of the selected dataset"}
1382 Button b_dataset_folder,fColor=(65280,48896,32768)
1384 Button b_dataset_display,help={
"display the selected dataset in its own window"}
1385 Button b_dataset_display,fColor=(65280,48896,32768)
1387 GroupBox gb_preview,pos={472,4},size={250,52},title=
"preview" 1388 TitleBox tb_preview_file,pos={484,24},size={226,20},frame=2
1389 TitleBox tb_preview_file,variable=root:packages:pearl_explorer:s_preview_file,fixedSize=1
1391 GroupBox gb_attributes,pos={472,64},size={250,372},title=
"attributes" 1393 Button b_attr_notebook,help={
"show attribute list in a notebook"}
1394 Button b_attr_notebook,fColor=(65280,48896,32768)
1396 String fldrSav0= GetDataFolder(1)
1397 SetDataFolder root:packages:pearl_explorer:
1398 Edit/W=(484,84,710,384)/HOST=# attr_names,attr_values
1399 ModifyTable format(Point)=1,width(Point)=0,width(attr_names)=103,width(attr_values)=103
1400 ModifyTable statsArea=85
1401 SetDataFolder fldrSav0
1403 SetActiveSubwindow ##
1407 STRUCT WMButtonAction &ba
1409 switch( ba.eventCode )
1420 static function bp_save_prefs(ba) : ButtonControl
1421 STRUCT WMButtonAction &ba
1423 switch( ba.eventCode )
1434 static function bp_browse_filepath(ba) : ButtonControl
1435 STRUCT WMButtonAction &ba
1437 dfref saveDF = GetDataFolderDFR()
1439 switch( ba.eventCode )
1441 PathInfo /S pearl_explorer_filepath
1442 NewPath /M=
"select data file folder" /O/Z pearl_explorer_filepath
1444 PathInfo /S pearl_explorer_filepath
1454 setdatafolder saveDF
1458 static function bp_update_filelist(ba) : ButtonControl
1459 STRUCT WMButtonAction &ba
1461 switch( ba.eventCode )
1472 static function bp_load_files(ba) : ButtonControl
1473 STRUCT WMButtonAction &ba
1475 switch( ba.eventCode )
1486 static function bp_load_files_opt(ba) : ButtonControl
1487 STRUCT WMButtonAction &ba
1489 switch( ba.eventCode )
1500 static function bp_file_next(ba) : ButtonControl
1501 STRUCT WMButtonAction &ba
1503 dfref saveDF = GetDataFolderDFR()
1505 switch( ba.eventCode )
1507 setdatafolder $package_path
1510 FindValue /i=1 wSelectedFiles
1512 if (v_value >= numpnts(wtFiles))
1513 v_value = min(numpnts(wtFiles) - 1, 0)
1515 wSelectedFiles = p == v_value
1517 variable ifile = v_value
1528 setdatafolder saveDF
1532 static function bp_file_prev(ba) : ButtonControl
1533 STRUCT WMButtonAction &ba
1535 dfref saveDF = GetDataFolderDFR()
1537 switch( ba.eventCode )
1539 setdatafolder $package_path
1542 FindValue /i=1 wSelectedFiles
1545 v_value = numpnts(wtFiles) - 1
1547 wSelectedFiles = p == v_value
1549 variable ifile = v_value
1560 setdatafolder saveDF
1565 STRUCT WMListboxAction &lba
1567 Variable row = lba.row
1568 Variable col = lba.col
1569 WAVE/T/Z listWave = lba.listWave
1570 WAVE/Z selWave = lba.selWave
1572 switch( lba.eventCode )
1599 static function bp_update_datasets(ba) : ButtonControl
1600 STRUCT WMButtonAction &ba
1602 switch( ba.eventCode )
1613 static function bp_dataset_folder(ba) : ButtonControl
1614 STRUCT WMButtonAction &ba
1616 switch( ba.eventCode )
1620 setdatafolder $package_path
1622 string dataset = wtDatasets[v_value]
1624 sprintf cmd,
"setdatafolder root:%s", PossiblyQuoteName(dataset)
1626 cmd =
"setdatafolder :scan1" 1628 sprintf cmd,
"setdatafolder %s", GetDataFolder(1)
1639 static function bp_dataset_display(ba) : ButtonControl
1640 STRUCT WMButtonAction &ba
1642 switch( ba.eventCode )
1646 setdatafolder $package_path
1648 string dataset = wtDatasets[v_value]
1659 static function bp_dataset_next(ba) : ButtonControl
1660 STRUCT WMButtonAction &ba
1662 switch( ba.eventCode )
1665 wave /t wtDatasets = $(s_datafolder + s_value)
1667 if (v_value >= numpnts(wtDatasets))
1668 v_value = min(0, numpnts(wtDatasets) - 1)
1672 variable ids = v_value
1686 static function bp_dataset_prev(ba) : ButtonControl
1687 STRUCT WMButtonAction &ba
1689 switch( ba.eventCode )
1692 wave /t wtDatasets = $(s_datafolder + s_value)
1695 v_value = max(-1, numpnts(wtDatasets) - 1)
1699 variable ids = v_value
1713 static function lbp_datasets(lba) : ListBoxControl
1714 STRUCT WMListboxAction &lba
1716 Variable row = lba.row
1717 Variable col = lba.col
1718 WAVE/T/Z listWave = lba.listWave
1719 WAVE/Z selWave = lba.selWave
1721 switch( lba.eventCode )
1748 static function bp_attr_notebook(ba) : ButtonControl
1749 STRUCT WMButtonAction &ba
1751 dfref saveDF = GetDataFolderDFR()
1753 switch( ba.eventCode )
1755 setdatafolder $package_path
1757 wave /t /z attr_names
1758 wave /t /z attr_values
1759 if (WaveExists(attr_names))
1767 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)
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