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

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

more additions to the basic infrastructure for VSANS

File size: 2.7 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
10
11
12//
13// copy what is needed for data processing (not the DAS_logs)
14// from the RawVSANS storage folder to the local WORK folder as needed
15//
16// TODO -- at what stage do I make copies of data in linear/log forms for data display?
17//                      -- when do I make the 2D error waves?
18//
19// TODO - decide what exactly I need to copy over. May be best to copy all, and delete
20//       what I know that I don't need
21//
22//
23// hdfDF is the name only of the data in storage. May be full file name with extension (clean as needed)
24// type is the destination WORK folder for the copy
25//
26Function CopyHDFToWorkFolder(hdfDF,type)
27        String hdfDF,type
28       
29//      Printf "CopyHDFToWorkFolder(%s,%s) stub\r",hdfDF,type
30       
31        String loadedDF,fromDF, toDF
32        // clean up the hdfDF to get a proper DF (same method as in file loader)
33        loadedDF = StringFromList(0,hdfDF,".")
34       
35        // make the DF paths - source and destination
36        fromDF = "root:Packages:NIST:VSANS:RawVSANS:"+loadedDF+":entry"
37        toDF = "root:Packages:NIST:VSANS:"+type+":entry"
38        // copy the folders
39        KillDataFolder/Z toDF                   //DuplicateDataFolder will not overwrite, so Kill
40        DuplicateDataFolder $fromDF,$toDF
41       
42        // make a copy of the file name for my own use, since it's not in the file
43        String/G $(toDF+":file_name") = hdfDF
44       
45        // ***need to copy folders:
46        // control
47        // instrument
48        // reduction
49        // sample
50       
51        // ***what about the variables @ the top level?
52        // data directory, identifiers, etc.?
53       
54        // ***I can skip (or delete)
55        // DAS_logs
56        // top-level copies of data (duplicate links)
57        KillDataFolder/Z $(toDF+":DAS_logs")
58        KillDataFolder/Z $(toDF+":data")
59        KillDataFolder/Z $(toDF+":data_B")
60        KillDataFolder/Z $(toDF+":data_ML")
61        KillDataFolder/Z $(toDF+":data_MR")
62        KillDataFolder/Z $(toDF+":data_MT")
63        KillDataFolder/Z $(toDF+":data_MB")
64        KillDataFolder/Z $(toDF+":data_FL")
65        KillDataFolder/Z $(toDF+":data_FR")
66        KillDataFolder/Z $(toDF+":data_FT")
67        KillDataFolder/Z $(toDF+":data_FB")
68
69       
70        return(0)
71end
72
73
74
75//
76// copy from one local WORK folder to another
77// does NO rescaling of the data or any other modifications to data
78//
79// TODO -- do I need to do more to clean out the destination folder first?
80//
81//  CopyWorkToWorkFolder("RAW","EMP")
82//
83Function CopyWorkToWorkFolder(fromDF,toDF)
84        String fromDF,toDF
85       
86//      Printf "CopyWorkToWorkFolder(%s,%s) stub\r",fromDF,toDF
87       
88       
89        // make the DF paths - source and destination
90        fromDF = "root:Packages:NIST:VSANS:"+fromDF+":entry"
91        toDF = "root:Packages:NIST:VSANS:"+toDF+":entry"
92        // copy the folders
93        KillDataFolder/Z toDF                   //DuplicateDataFolder will not overwrite, so Kill
94        DuplicateDataFolder $fromDF,$toDF
95       
96        return(0)
97end
Note: See TracBrowser for help on using the repository browser.