source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf @ 975

Last change on this file since 975 was 975, checked in by srkline, 7 years ago

adding more functions for VSANS infrastructure

File size: 3.5 KB
Line 
1#pragma rtGlobals=3             // Use modern global access method and strict wave access.
2
3//
4// Functions used for manipulation of the local Igor "WORK" folder
5// structure as raw data is displayed and processed.
6//
7//
8
9// TODO: write function
10//              KillVANSObjects()               //Kills (/Z) the list of objects that I generate
11//                      !! but I must maintain the list
12//
13
14
15//
16// copy what is needed for data processing (not the DAS_logs)
17// from the RawVSANS storage folder to the local WORK folder as needed
18//
19// TODO -- at what stage do I make copies of data in linear/log forms for data display?
20//                      -- when do I make the 2D error waves?
21//
22// TODO - decide what exactly I need to copy over. May be best to copy all, and delete
23//       what I know that I don't need
24//
25// TODO !!! DuplicateDataFolder will FAIL - in the base case of RAW data files, the
26//  data is actually in use - so it will fail every time. need an alternate solution. in SANS,
27// there are a limited number of waves to carry over, so Dupliate/O is used for rw, tw, data, etc.
28//
29//
30//
31// TODO : I also need a list of what is generated during processing that may be hanging around - that I need to
32//     be sure to get rid of - like the calibration waves, solidAngle, etc.
33//
34// hdfDF is the name only of the data in storage. May be full file name with extension (clean as needed)
35// type is the destination WORK folder for the copy
36//
37Function CopyHDFToWorkFolder(hdfDF,type)
38        String hdfDF,type
39       
40//      Printf "CopyHDFToWorkFolder(%s,%s) stub\r",hdfDF,type
41       
42        String loadedDF,fromDF, toDF
43        // clean up the hdfDF to get a proper DF (same method as in file loader)
44        loadedDF = StringFromList(0,hdfDF,".")
45       
46        // make the DF paths - source and destination
47        fromDF = "root:Packages:NIST:VSANS:RawVSANS:"+loadedDF+":entry"
48        toDF = "root:Packages:NIST:VSANS:"+type+":entry"
49        // copy the folders
50        KillDataFolder/Z toDF                   //DuplicateDataFolder will not overwrite, so Kill
51        // this will fail if something was in use
52        DuplicateDataFolder $fromDF,$toDF
53       
54        // make a copy of the file name for my own use, since it's not in the file
55        String/G $(toDF+":file_name") = hdfDF
56       
57        // ***need to copy folders:
58        // control
59        // instrument
60        // reduction
61        // sample
62       
63       
64       
65        KillDataFolder/Z toDF+":control"
66        Print V_flag
67        // if not OK, need to duplicate/O
68       
69       
70       
71        // ***what about the variables @ the top level?
72        // data directory, identifiers, etc.?
73       
74        // ***I can skip (or delete)
75        // DAS_logs
76        // top-level copies of data (duplicate links)
77        KillDataFolder/Z $(toDF+":DAS_logs")
78        KillDataFolder/Z $(toDF+":data")
79        KillDataFolder/Z $(toDF+":data_B")
80        KillDataFolder/Z $(toDF+":data_ML")
81        KillDataFolder/Z $(toDF+":data_MR")
82        KillDataFolder/Z $(toDF+":data_MT")
83        KillDataFolder/Z $(toDF+":data_MB")
84        KillDataFolder/Z $(toDF+":data_FL")
85        KillDataFolder/Z $(toDF+":data_FR")
86        KillDataFolder/Z $(toDF+":data_FT")
87        KillDataFolder/Z $(toDF+":data_FB")
88
89       
90        return(0)
91end
92
93
94
95//
96// copy from one local WORK folder to another
97// does NO rescaling of the data or any other modifications to data
98//
99// TODO -- do I need to do more to clean out the destination folder first?
100//
101//  CopyWorkToWorkFolder("RAW","EMP")
102//
103Function CopyWorkToWorkFolder(fromDF,toDF)
104        String fromDF,toDF
105       
106//      Printf "CopyWorkToWorkFolder(%s,%s) stub\r",fromDF,toDF
107       
108       
109        // make the DF paths - source and destination
110        fromDF = "root:Packages:NIST:VSANS:"+fromDF+":entry"
111        toDF = "root:Packages:NIST:VSANS:"+toDF+":entry"
112        // copy the folders
113        KillDataFolder/Z toDF                   //DuplicateDataFolder will not overwrite, so Kill
114        DuplicateDataFolder $fromDF,$toDF
115       
116        return(0)
117end
Note: See TracBrowser for help on using the repository browser.