Ignore:
Timestamp:
Apr 27, 2016 4:16:09 PM (7 years ago)
Author:
srkline
Message:

more changes, lots of files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Testing_Data_Procs.ipf

    r993 r994  
    11#pragma TextEncoding = "MacRoman" 
    22#pragma rtGlobals=3             // Use modern global access method and strict wave access. 
     3 
     4 
     5 
     6//////// function to take VCALC information and  
     7// fill in the simulated information as needed to make a "fake" data file 
     8// 
     9// TODO: 
     10// -- identify all of the necessary bits to change 
     11// -- maybe want a panel to make it easier to decide what inputs to change in the file 
     12// -- decide if it's better to write wholesale, or as individual waves 
     13// 
     14Macro Copy_VCALC_to_VSANSFile() 
     15         
     16        String fileName = V_DoSaveFileDialog("pick the file to write to") 
     17        print fileName 
     18//       
     19        if(strlen(fileName) > 0) 
     20                writeVCALC_to_file(fileName) 
     21        endif 
     22End 
     23 
     24// 
     25// TODO -- fill this in as needed to get fake data that's different 
     26// 
     27Function writeVCALC_to_file(fileName) 
     28        String fileName 
     29 
     30 
     31// the detectors, all 9 + the correct SDD (that accounts for the offset of T/B panels 
     32// the data itself (as INT32) 
     33// the front SDD (correct units) 
     34// the middle SDD (correct units) 
     35// the back SDD (correct units) 
     36        Variable ii,val 
     37        String detStr 
     38        for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
     39                detStr = StringFromList(ii, ksDetectorListAll, ";") 
     40                Duplicate/O $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":det_"+detStr) tmpData 
     41                Redimension/I tmpData 
     42                tmpData = (tmpData ==   2147483647) ? 0 : tmpData               //the NaN "mask" in the sim data (T/B only)shows up as an ugly integer 
     43                V_writeDetectorData(fileName,detStr,tmpData) 
     44                 
     45                val = VCALC_getTopBottomSDDOffset(detStr)/10 + VCALC_getSDD(detStr)*100         // make sure value is in cm 
     46                print val 
     47                V_writeDet_distance(fileName,detStr,val) 
     48                 
     49                // x and y pixel sizes for each detector should be correct in the "base" file - but if not... 
     50                //Function VCALC_getPixSizeX(type)              // returns the pixel X size, in [cm] 
     51                //Function VCALC_getPixSizeY(type) 
     52                V_writeDet_x_pixel_size(fileName,detStr,VCALC_getPixSizeX(detStr)*10)           // data file is expecting mm 
     53                V_writeDet_y_pixel_size(fileName,detStr,VCALC_getPixSizeY(detStr)*10) 
     54         
     55                // write out the xCtr and yCtr (pixels) that was used in the q-calculation, done in VC_CalculateQFrontPanels() 
     56                V_writeDet_beam_center_x(fileName,detStr,V_getDet_beam_center_x("VCALC",detStr)) 
     57                V_writeDet_beam_center_y(fileName,detStr,V_getDet_beam_center_y("VCALC",detStr)) 
     58                 
     59                 
     60         
     61                // the calibration data for each detector (except B) is already correct in the "base" file 
     62                //V_writeDetTube_spatialCalib(fname,detStr,inW) 
     63                // and for "B" 
     64                //V_writeDet_cal_x(fname,detStr,inW) 
     65                //V_writeDet_cal_y(fname,detStr,inW) 
     66                 
     67                                 
     68                // the dead time for each detector is already correct in the "base" file 
     69                // V_writeDetector_deadtime(fname,detStr,inW) 
     70                // TODO: need a new, separate function to write the single deadtime value in/out of "B" 
     71 
     72        endfor 
     73         
     74         
     75//? other detector geometry - lateral separation? 
     76 
     77// the wavelength 
     78//      Variable lam = V_getWavelength("VCALC")         //doesn't work, the corresponding folder in VCALC has not been defined 
     79        V_writeWavelength(fileName,VCALC_getWavelength()) 
     80 
     81// description of the sample 
     82 
     83// sample information 
     84// name, title, etc 
     85         
     86// fake the information about the count setup, so I have different numbers to read 
     87// count time = fake time of 100 s 
     88        V_writeCount_time(fileName,100) 
     89 
     90// monitor count (= imon) 
     91// returns the number of neutrons on the sample 
     92//Function VCALC_getImon() 
     93 
     94// ?? anything else that I'd like to see on the catalog - I could change them here to see different values 
     95// different collimation types? 
     96// 
     97 
     98        return(0) 
     99end 
     100 
     101 
    3102 
    4103 
Note: See TracChangeset for help on using the changeset viewer.