source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DIVUtils.ipf @ 1019

Last change on this file since 1019 was 1019, checked in by srkline, 6 years ago

adding procedures for:

simple save of a DIV file. no functionality to generate a DIV file yet, since I don't know how this will happen.

Simple dump of the file structure in a data "tree"

Verified that the error bars on the I(q) data are correctly calculated as standard error of the mean. There was never an issue with this, or with SANS calculations.

Started filling in "Correct" routines based on the SANS version. Only stubs present currently.

File size: 4.5 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2
3//
4// ********
5// TODO -- this is only a fake DIV file. need to identify how to generate a real DIV file
6//     for the different detectors, and how to fill it into a file. ProDIV for SANS may be a good
7//     starting point, or it may be cumbersome. Not sure how it will be measured in practice
8//     on VSANS.
9//
10//   JAN 2017
11//
12//
13//
14//
15//
16
17// TODO
18// currently, there are no dummy fill values or attributes for the fake DIV file
19//
20Proc Setup_VSANS_DIV_Struct()
21
22        // lays out the tree and fills with dummy values
23        H_Setup_VSANS_DIV_Structure()
24       
25        // writes in the attributes
26//      H_Fill_VSANS_Attributes()
27       
28        // fill in with VCALC simulation bits
29//      H_Fill_VSANS_wSim()
30       
31End
32
33Proc Save_VSANS_DIV_Nexus(fileName)
34        String fileName="Test_VSANS_DIV_file"
35
36        // save as HDF5 (no attributes saved yet)
37        Save_VSANS_file("root:VSANS_DIV_file", fileName+".h5")
38       
39//      // read in a data file using the gateway-- reads from the home path
40//      H_HDF5Gate_Read_Raw(fileName+".h5")
41//     
42//      // after reading in a "partial" file using the gateway (to generate the xref)
43//      // Save the xref to disk (for later use)
44//      Save_HDF5___xref("root:"+fileName,"HDF5___xref")
45//     
46//      // after you've generated the HDF5___xref, load it in and copy it
47//      // to the necessary folder location.
48//      Copy_HDF5___xref("root:VSANS_DIV_file", "HDF5___xref")
49//     
50//      // writes out the contents of a data folder using the gateway
51//      H_HDF5Gate_Write_Raw("root:VSANS_DIV_file", fileName+".h5")
52//
53//      // re-load the data file using the gateway-- reads from the home path
54//      // now with attributes
55//      H_HDF5Gate_Read_Raw(fileName+".h5")
56       
57End
58
59////////////// fake DIV file tests
60//
61//
62//      Make/O/T/N=1    file_name       = "VSANS_DIV_test.h5"
63//
64// simple generation of a fake div file. for sans, nothing other than the creation date was written to the
65// file header. nothing more is needed (possibly)
66//
67// TODO -- I want to re-visit the propagation of errors in the DIV file. No errors are ever calculated/saved
68//   during the generation of the file, but there's no reason it couldn't. the idea is that the plex
69//   is counted so long that the errors are insignificant compared to the data errors, but that may not
70//   always be the case. A bit of math may prove this. or not. Plus, the situation for VSANS may be different.
71//
72//
73// TODO -- make the number of pixels GLOBAL
74// TODO -- there will be lots of work to do to develop the procedures necessary to actually generate the
75//      9 data sets to become the DIV file contents. More complexity here than for the simple SANS case.
76//
77Proc H_Setup_VSANS_DIV_Structure()
78       
79        NewDataFolder/O/S root:VSANS_DIV_file           
80
81        NewDataFolder/O/S root:VSANS_DIV_file:entry     
82                Make/O/T/N=1    title   = "This is a fake DIV file for VSANS"
83                Make/O/T/N=1    start_date      = "2015-02-28T08:15:30-5:00"
84                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument         
85                        Make/O/T/N=1    name    = "NG3_VSANS"
86                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_B       
87                        Make/O/D/N=(150,150)    data    = 1 + (enoise(0.1))
88                        Make/O/D/N=(150,150)    linear_data_error       = 0.01*abs(gnoise(1))
89                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MR             
90                        Make/O/D/N=(48,128)     data    = 1 + (enoise(0.1))
91                        Make/O/D/N=(48,128)     linear_data_error       = 0.01*abs(gnoise(1))
92                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_ML             
93                        Make/O/D/N=(48,128)     data    = 1 + (enoise(0.1))
94                        Make/O/D/N=(48,128)     linear_data_error       = 0.01*abs(gnoise(1))
95                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MT             
96                        Make/O/D/N=(128,48)     data    = 1 + (enoise(0.1))
97                        Make/O/D/N=(128,48)     linear_data_error       = 0.01*abs(gnoise(1))
98                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MB             
99                        Make/O/D/N=(128,48)     data    = 1 + (enoise(0.1))
100                        Make/O/D/N=(128,48)     linear_data_error       = 0.01*abs(gnoise(1))
101                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FR             
102                        Make/O/D/N=(48,128)     data    = 1 + (enoise(0.1))
103                        Make/O/D/N=(48,128)     linear_data_error       = 0.01*abs(gnoise(1))
104                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FL             
105                        Make/O/D/N=(48,128)     data    = 1 + (enoise(0.1))
106                        Make/O/D/N=(48,128)     linear_data_error       = 0.01*abs(gnoise(1))
107                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FT             
108                        Make/O/D/N=(128,48)     data    = 1 + (enoise(0.1))
109                        Make/O/D/N=(128,48)     linear_data_error       = 0.01*abs(gnoise(1))
110                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FB             
111                        Make/O/D/N=(128,48)     data    = 1 + (enoise(0.1))
112                        Make/O/D/N=(128,48)     linear_data_error       = 0.01*abs(gnoise(1))
113                       
114        SetDataFolder root:
115
116End
Note: See TracBrowser for help on using the repository browser.