Changeset 1044


Ignore:
Timestamp:
Jun 8, 2017 1:27:07 PM (5 years ago)
Author:
srkline
Message:

Significant changes to the base READ of individual data fields from data files. Now, if the field requested is from a WORK file, and it does not exist, an error condition is returned (or a null wave). Calling procedures are responsible for handling errors. This prevents a string of open file dialogs if fields are missing from a file if they were never in the file to begin with (like sensor logs, polarization hardware, etc.)

New get/write calls were added for the updated temperature sensor fields.

group_ID is now only in the sample block, not the duplicated in the reduction block, and is correctly a number not a string.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
Files:
14 edited

Legend:

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

    r1035 r1044  
    691691//    but this is a lousy choice. 
    692692// x- binning is now Mask-aware. If mask is not present, all data is used. If data is from VCALC, all data is used 
    693 // -- Where do I put the solid angle correction? In here as a weight for each point, or later on as  
    694 //    a blanket correction (matrix multiply) for an entire panel? 
     693// x- Where do I put the solid angle correction? In here as a weight for each point, or later on as  
     694//    a blanket correction (matrix multiply) for an entire panel? (Solid Angle correction is done in the 
     695//    step where data is added to a WORK file (see Raw_to_Work()) 
    695696// 
    696697// 
     
    12141215// just like in CircSectAve.ipf 
    12151216// TODO: 
    1216 // -- 2D Errors were NOT properly acculumated above, so this loop of calculations is NOT MEANINGFUL (yet) 
     1217// -- 2D Errors were NOT properly acculumated through reduction, so this loop of calculations is NOT MEANINGFUL (yet) 
    12171218// x- the error on the 1D intensity, is correctly calculated as the standard error of the mean. 
    12181219        for(ii=0;ii<nq;ii+=1) 
     
    12811282        while(val>0) 
    12821283         
     1284        // TODO: 
     1285        // -- is this where I do the resolution calculation? 
     1286        // -- or do I do it as a separate call? 
     1287        // -- use the isVCALC flag to exclude VCALC from the resolution calculation if necessary 
     1288        // 
     1289         
     1290         
     1291         
    12831292        SetDataFolder root: 
    12841293         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DataPlotting.ipf

    r1042 r1044  
    110110 
    111111// TODO 
    112 // -- winStr is currently hard-wired, but this may not be an issue 
     112// x- winStr is currently hard-wired, but this may not be an issue 
    113113Function V_Update1D_Graph(workType,binType) 
    114114        String workType 
     
    408408        SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType 
    409409 
    410         V_QBinAllPanels(type,popNum) 
     410        V_QBinAllPanels_Circular(type,popNum) 
    411411 
    412412        String str,winStr="V_1D_Data",workTypeStr 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf

    r1041 r1044  
    2828// 
    2929// TODO 
    30 // -- verify the direction of the tubes and indexing 
     30// x- verify the direction of the tubes and indexing 
    3131// x- decide on the appropriate functional form for the tubes 
    3232// x- need count time as input 
    33 // -- be sure I'm working in the right data folder 
    34 // -- clean up when done 
    35 // -- calculate + return the error contribution? 
    36 // -- verify the error propagation 
     33// x- be sure I'm working in the right data folder (all waves are passed in) 
     34// x- clean up when done 
     35// x- calculate + return the error contribution? 
     36// x- verify the error propagation 
    3737Function V_DeadTimeCorrectionTubes(dataW,data_errW,dtW,ctTime) 
    3838        Wave dataW,data_errW,dtW 
     
    111111// TODO 
    112112// -- UNITS!!!! currently this is mm, which certainly doesn't match anything else!!! 
    113 // -- verify the direction of the tubes and indexing 
    114 // -- be sure I'm working in the right data folder 
    115 // -- clean up when done 
    116 // -- calculate + return the error contribution? 
    117 // -- do I want this to return a wave? 
    118 // -- do I need to write a separate function that returns the distance wave for later calculations? 
    119 // -- do I want to make the distance array 3D to keep the x and y dims together? Calculate them all right now? 
    120 // -- what else do I need to pass to the function? (fname=folder? detStr?) 
    121 // -- need a separate block or function to handle "B" detector which will be ? different 
     113// x- verify the direction of the tubes and indexing 
     114// x- be sure I'm working in the right data folder (it is passed in, and the full path is used) 
     115// x- clean up when done 
     116// x- calculate + return the error contribution? (there is none for this operation) 
     117// x- do I want this to return a wave? (no, default names are generated) 
     118// x- do I need to write a separate function that returns the distance wave for later calculations? 
     119// x- do I want to make the distance array 3D to keep the x and y dims together? Calculate them all right now? 
     120// x- what else do I need to pass to the function? (fname=folder? detStr?) 
     121// y- (yes,see below) need a separate block or function to handle "B" detector which will be ? different 
    122122// 
    123123// 
     
    269269// -- verify where this needs to be done (if the beam center is changed) 
    270270// -- then the q-calculation needs to be re-done 
    271 // -- the position along the tube length is referenced to tube[0], for no particular reason 
    272 //    It may be better to take an average? but [0] is an ASSUMPTION 
    273 // -- distance along tube is simple interpolation 
    274 // 
    275 // -- distance in the lateral direction is based on tube width, which is well known 
     271// 
     272// -- not much is known about the "B" detector, so this 
     273//    all hinges on the non-linear corrections being done correctly for that detector 
    276274// 
    277275// 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_FileCatalog.ipf

    r1037 r1044  
    1212// 
    1313// TODO 
    14 // -- clean up and remove all of the references to other facilities, since they will not have VSANS modules 
     14// x- clean up and remove all of the references to other facilities, since they will not have VSANS modules 
    1515// -- add in more appropriate and some missing fields more useful to VSANS (intent, multiple beam centers, etc.) 
    1616// -- can I make the choice of columns customizable? There are "sets" of columns that are not used for  
     
    3232// will not be read in, the "bad" local copy will be read in. 
    3333// TODO: 
    34 //  -- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies. If 
     34//  x- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies. If 
    3535//     the "patched" values are written locally too, then maybe the update from disk is not needed. 
    3636//     But typically, I'd like to see that the disk version really did get updated... 
     
    159159 
    160160// TODO: 
    161 //  -- experimental hook with contextual menu 
     161//  x- experimental hook with contextual menu 
    162162//               
    163163                SetWindow kwTopWin hook=V_CatTableHook, hookevents=1    // mouse down events 
     
    170170// will not be read in, the "bad" local copy will be read in for any subsequent operations. 
    171171// TODO: 
    172 //  -- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies? If 
     172//  x- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies? If 
    173173//     the "patched" values are written locally too, then maybe the update from disk is not needed. 
    174174//     But typically, I'd like to see that the disk version really did get updated... 
     
    242242        // 
    243243        // clean out again, so that the file SAVE is not slow due to the large experiment size 
    244         // TODO -- decide if this is really necessary 
     244        // TODO x- decide if this is really necessary (not necessary at this point) 
    245245//       
    246246//      V_CleanOutRawVSANS() 
     
    255255// -- what else to add to the menu? (MSK and DIV now work) 
    256256// -- add directly to WORK files? 
    257 // -- "set" as some special file type, intent, use? 
     257// -- "set" as some special file type, intent, use? (quick "patch" operations) 
    258258// -- "check" the reduction protocol for completeness? 
    259259// 
     
    453453         
    454454//      //read the file alphanumeric suffix 
    455 //      // TODO -- this does not exist for VSANS - so is there an equivalent, or delete? 
     455//      // TODO x- this does not exist for VSANS - so is there an equivalent, or delete? ((delete)) 
    456456//      InsertPoints lastPoint,1,GSuffix 
    457457//      GSuffix[lastPoint]="unknown" 
     
    482482         
    483483        //Attenuators 
    484         // TODO -- this is not really the number -- 
     484        // TODO -- this is not really the number -- but rather the thickness 
    485485        InsertPoints lastPoint,1,GNumAttens 
    486486        GNumAttens[lastPoint]=V_getAttenThickness(fname) 
     
    519519        GRot[lastPoint]=V_getSampleRotationAngle(fname) 
    520520         
    521         // TODO -- this is not yet implemented 
    522521        //Sample Temperature 
    523522        InsertPoints lastPoint,1,GTemp 
    524         GTemp[lastPoint]=-273 
     523        GTemp[lastPoint]=V_getSampleTemperature(fname) 
    525524 
    526525        // TODO -- this is not yet implemented 
    527526        //Sample Field 
    528527        InsertPoints lastPoint,1,GField 
    529         GField[lastPoint]=1000 
     528        GField[lastPoint]=-999 
    530529         
    531530 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf

    r1042 r1044  
    2222 
    2323// the list of WORK Folders 
    24 Strconstant ksWorkFolderList = "RAW;SAM;EMP;BGD;COR;DIV;ABS;MSK;CAL;STO;SUB;DRK;ADJ;VCALC;RawVSANS;" 
     24// RawVSANS does not behave as a WORK folder, but it is local. so add it in explicitly to the list if needed 
     25// VCALC behaves *almost* as a WORK folder, but it is local. so add it in explicitly to the list if needed 
     26//Strconstant ksWorkFolderList = "RAW;SAM;EMP;BGD;COR;DIV;ABS;MSK;CAL;STO;SUB;DRK;ADJ;VCALC;RawVSANS;" 
    2527Strconstant ksWorkFolderListShort = "RAW;SAM;EMP;BGD;COR;DIV;ABS;MSK;CAL;STO;SUB;DRK;ADJ;" 
    2628 
     
    416418//      endif 
    417419         
    418         // if base_name is from my list of WORK folders, then base_name = "" 
     420        // if base_name is from my list of WORK folders + RawVSANS;, then base_name = "" 
    419421        // use a stringSwitch? WhichListItem? 
    420         Variable isFolder = WhichListItem(base_name,ksWorkFolderList) 
     422        Variable isFolder = WhichListItem(base_name,ksWorkFolderListShort+"RawVSANS;") 
    421423        if(isFolder != -1) 
    422424                base_name = "" 
     
    516518 
    517519// read a single real value  
    518 // - fname passed in is the full path to the file on disk 
     520// - fname passed in is the full path to the file on disk --OR-- a WORK folder 
    519521// - path is the path to the value in the HDF tree 
    520522// 
     523/// -- if data requested from a WORK or VCALC folder: 
    521524// check to see if the value exists (It will be a wave) 
     525// -- if it does, return the value from the local WORK folder 
     526//              if it does not exist, return DUMMY value 
     527// 
     528//// -- if data requested from a file: 
     529// check to see if the value exists locally in RawVSANS (It will be a wave) 
    522530// -- if it does, return the value from the local folder 
    523531// -- if not, read the file in, then return the value 
    524532// 
    525 // TODO: 
    526 // currently, the work folders have the following path - so passing in "RAW" as fname 
    527 // will take some re-configuring.  
    528 //  root:Packages:NIST:VSANS:RAW:entry:instrument:detector_FL:distance 
    529 // -- be sure this read from work folders is not broken in the future, and is passed to ALL of the 
    530 //    top-level R/W routines. (Write is necessary ONLY for SIM data files. Patch is direct to disk.) 
     533// 
    531534Function V_getRealValueFromHDF5(fname,path) 
    532535        String fname,path 
     
    534537        String folderStr="" 
    535538        Variable valExists=0 
     539        Variable errorValue = -999999 
    536540         
    537541        folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 
    538542 
    539 // check for a work folder first (note that "entry" is now NOT doubled) 
    540         if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
    541                 Wave/Z w = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
    542                 return(w[0]) 
    543         endif 
    544          
     543// (1) if requesting data from a WORK folder, get it, or report error 
     544        Variable isWORKFolder = WhichListItem(fname,ksWorkFolderListShort+"VCALC;") 
     545        if(isWORKFolder != -1)          //requesting value from a WORK folder (not RawVSANS) 
     546        // check for a work folder first (note that "entry" is now NOT doubled) 
     547                if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
     548                        Wave/Z w = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
     549                        return(w[0]) 
     550                else 
     551                        return(errorValue) 
     552                endif 
     553        endif 
     554 
     555 
     556        // (2) requesting from a file. 
     557        // look locally in RawVSANS if possible, or if not, load in the data from disk 
     558        // - if thee both fail, report an error 
    545559        if(Exists(ksBaseDFPath+folderStr+":"+path)) 
    546560                valExists=1 
     
    560574                return(w[0]) 
    561575        else 
    562                 return(-999999) 
     576                return(errorValue) 
    563577        endif    
    564578End 
     
    574588// -- if not, read the file in, then return the value 
    575589// 
     590// if the wave is null, then that is returned, and the calling function is responsible 
     591// 
    576592Function/WAVE V_getRealWaveFromHDF5(fname,path) 
    577593        String fname,path 
     
    582598        folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 
    583599 
    584 // check for a work folder first (note that "entry" is NOT doubled) 
    585         if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
    586                 Wave wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
    587                 return wOut 
    588         endif 
    589                  
     600// (1) if requesting data from a WORK folder, get it 
     601// no need to check for any existence, null return is OK 
     602        Variable isWORKFolder = WhichListItem(fname,ksWorkFolderListShort+"VCALC;") 
     603        if(isWORKFolder != -1)          //requesting value from a WORK folder (not RawVSANS) 
     604//      // check for a work folder first (note that "entry" is now NOT doubled) 
     605//              if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
     606                        Wave/Z wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
     607                        return wOut 
     608        endif 
     609 
     610//// check for a work folder first (note that "entry" is NOT doubled) 
     611//      if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
     612//              Wave wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
     613//              return wOut 
     614//      endif 
     615         
     616// (2) requesting from a file 
    590617        if(Exists(ksBaseDFPath+folderStr+":"+path)) 
    591618                valExists=1 
     
    616643// -- if not, read the file in, then return the value 
    617644// 
     645// if the wave is null, then that is returned, and the calling function is responsible 
     646// 
    618647Function/WAVE V_getTextWaveFromHDF5(fname,path) 
    619648        String fname,path 
     
    624653        folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 
    625654 
    626 // check for a work folder first (note that "entry" is NOT doubled) 
    627         if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
    628                 Wave/T wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
    629                 return wOut 
    630         endif 
    631          
     655// (1) if requesting data from a WORK folder, get it 
     656// no need to check for any existence, null return is OK 
     657        Variable isWORKFolder = WhichListItem(fname,ksWorkFolderListShort+"VCALC;") 
     658        if(isWORKFolder != -1)          //requesting value from a WORK folder (not RawVSANS) 
     659//      // check for a work folder first (note that "entry" is now NOT doubled) 
     660//              if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
     661                        Wave/Z/T wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
     662                        return wOut 
     663        endif 
     664         
     665//// check for a work folder first (note that "entry" is NOT doubled) 
     666//      if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
     667//              Wave/T wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
     668//              return wOut 
     669//      endif 
     670 
     671// (2) requesting from a file    
    632672        if(Exists(ksBaseDFPath+folderStr+":"+path)) 
    633673                valExists=1 
     
    674714 
    675715// read a single string 
    676 // - fname passed in is the full path to the file on disk 
     716// - fname passed in is the full path to the file on disk --OR-- a WORK folder 
    677717// - path is the path to the value in the HDF tree 
    678718// - num is the number of characters in the VAX string 
     719// 
     720/// -- if data requested from a WORK or VCALC folder: 
    679721// check to see if the value exists (It will be a wave) 
     722// -- if it does, return the value from the local WORK folder 
     723//              if it does not exist, return DUMMY value 
     724// 
     725//// -- if data requested from a file: 
     726// check to see if the value exists locally in RawVSANS (It will be a wave) 
    680727// -- if it does, return the value from the local folder 
    681728// -- if not, read the file in, then return the value 
     
    691738        String folderStr="" 
    692739        Variable valExists=0 
     740        String errorString = "The specified wave does not exist: " + path 
    693741         
    694742        folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 
    695743 
    696 // check for a work folder first (note that "entry" is NOT doubled) 
    697         if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
    698                 Wave/Z/T tw = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
    699                 return(tw[0]) 
    700         endif 
    701          
     744// (1) if requesting data from a WORK folder, get it, or report error 
     745        Variable isWORKFolder = WhichListItem(fname,ksWorkFolderListShort+"VCALC;") 
     746        if(isWORKFolder != -1)          //requesting value from a WORK folder (not RawVSANS) 
     747        // check for a work folder first (note that "entry" is now NOT doubled) 
     748                if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 
     749                        Wave/Z/T tw = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 
     750                        return(tw[0]) 
     751                else 
     752                        return(errorSTring) 
     753                endif 
     754        endif 
     755 
     756// (2) requesting from a file. 
     757// look locally in RawVSANS if possible, or if not, load in the data from disk 
     758// - if thee both fail, report an error  
    702759        if(Exists(ksBaseDFPath+folderStr+":"+path)) 
    703760                valExists=1 
     
    722779                return(tw[0]) 
    723780        else 
    724                 return("The specified wave does not exist: " + path) 
     781                return(errorString) 
    725782        endif 
    726783End 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf

    r1042 r1044  
    259259End 
    260260 
    261 // TODO - should be the file name as saved on disk, currently it's not 
    262 Function/S V_getFile_name(fname) 
    263         String fname 
    264          
    265         String path = "entry:file_name"  
    266         Variable num=60 
    267         return(V_getStringFromHDF5(fname,path,num)) 
    268 End 
    269                  
    270 // 
    271 Function/S V_getHDF_version(fname) 
    272         String fname 
    273          
    274         String path = "entry:hdf_version"        
    275         Variable num=60 
    276         return(V_getStringFromHDF5(fname,path,num)) 
    277 End 
     261// cut in JUNE 2017 
     262//// TODO - should be the file name as saved on disk, currently it's not 
     263//Function/S V_getFile_name(fname) 
     264//      String fname 
     265//       
     266//      String path = "entry:file_name"  
     267//      Variable num=60 
     268//      return(V_getStringFromHDF5(fname,path,num)) 
     269//End 
     270 
     271// cut in JUNE 2017              
     272//// 
     273//Function/S V_getHDF_version(fname) 
     274//      String fname 
     275//       
     276//      String path = "entry:hdf_version"        
     277//      Variable num=60 
     278//      return(V_getStringFromHDF5(fname,path,num)) 
     279//End 
    278280 
    279281// TODO -- not mine, added somewhere by Nexus writer? 
     
    328330// TODO -- for the control section, document each of the fields 
    329331 
    330 Function/S V_getCount_end(fname) 
    331         String fname 
    332          
    333         Variable num 
    334         String path = "entry:control:count_end"  
    335         return(V_getStringFromHDF5(fname,path,num)) 
    336 end 
    337  
    338  
    339 Function/S V_getCount_start(fname) 
    340         String fname 
    341          
    342         Variable num 
    343         String path = "entry:control:count_start"        
    344         return(V_getStringFromHDF5(fname,path,num)) 
    345 end 
     332// cut in JUNE 2017 
     333//Function/S V_getCount_end(fname) 
     334//      String fname 
     335//       
     336//      Variable num 
     337//      String path = "entry:control:count_end"  
     338//      return(V_getStringFromHDF5(fname,path,num)) 
     339//end 
     340 
     341// cut in JUNE 2017 
     342// 
     343//Function/S V_getCount_start(fname) 
     344//      String fname 
     345//       
     346//      Variable num 
     347//      String path = "entry:control:count_start"        
     348//      return(V_getStringFromHDF5(fname,path,num)) 
     349//end 
    346350 
    347351 
     
    377381end 
    378382 
    379  
    380 Function V_getIntegral(fname) 
    381         String fname 
    382          
    383         String path = "entry:control:integral"   
    384         return(V_getRealValueFromHDF5(fname,path)) 
    385 end 
     383// cut in JUNE 2017 
     384// 
     385//Function V_getIntegral(fname) 
     386//      String fname 
     387//       
     388//      String path = "entry:control:integral"   
     389//      return(V_getRealValueFromHDF5(fname,path)) 
     390//end 
    386391 
    387392// control mode for data acquisition, "timer" 
     
    411416end 
    412417 
     418// cut in JUNE 2017 
    413419// TODO - what are the enumerated types for this? 
    414 Function/S V_getPreset(fname) 
    415         String fname 
    416          
    417         Variable num 
    418         String path = "entry:control:preset"     
    419         return(V_getStringFromHDF5(fname,path,num)) 
    420 end 
     420//Function/S V_getPreset(fname) 
     421//      String fname 
     422//       
     423//      Variable num 
     424//      String path = "entry:control:preset"     
     425//      return(V_getStringFromHDF5(fname,path,num)) 
     426//end 
    421427 
    422428 
     
    20432049End 
    20442050 
     2051Function V_getSampleTemperature(fname) 
     2052        String fname 
     2053         
     2054        String path = "entry:sample:temperature"         
     2055        return(V_getRealValueFromHDF5(fname,path)) 
     2056end 
     2057 
     2058Function V_getSampleTempSetPoint(fname) 
     2059        String fname 
     2060         
     2061        String path = "entry:sample:temperature_setpoint"        
     2062        return(V_getRealValueFromHDF5(fname,path)) 
     2063end 
     2064 
     2065 
    20452066//Sample Thickness 
    20462067// TODO -- somehow, this is not set correctly in the acquisition, so NaN results 
     
    20772098 
    20782099 
    2079  
     2100// 
     2101// TODO -- this is all a big mess with the changes in the data file structure 
     2102//  in JUNE 2017, which completely wrecks what was decided in 2016. 
     2103// Now, I'm not sure at all what I'll get...or what the field will be called... or what they mean... 
     2104// 
     2105// 
    20802106//// SAMPLE / DATA LOGS 
    20812107// write this generic , call with the name of the environment log desired 
    20822108// 
    2083 // temperature_1 
    2084 // temperature_2 
    2085 // temperature_3 
    2086 // temperature_4 
     2109// 
    20872110// shear_field 
    20882111// pressure 
     
    21182141End 
    21192142 
    2120 // TODO -- this may not exist if it is not a "controlling" sensor, but there still may be logged data present 
    2121 // TODO -- it may also have different names for each sensor (setpoint_1, setpoint_2, etc. which will be a big hassle) 
    2122 Function V_getLog_setPoint(fname,logStr) 
     2143 
     2144 
     2145// for temperature only, logStr = "temperature_env" 
     2146Function/S V_getTemp_ControlSensor(fname,logStr) 
    21232147        String fname,logStr 
    2124          
    2125         String path = "entry:sample:"+logstr+":setpoint_1" 
    2126         return(V_getRealValueFromHDF5(fname,path)) 
    2127 end 
    2128  
    2129 Function/S V_getLog_startTime(fname,logStr) 
     2148 
     2149        String path = "entry:sample:"+logstr+":control_sensor" 
     2150        Variable num=60 
     2151        return(V_getStringFromHDF5(fname,path,num)) 
     2152End 
     2153 
     2154// for temperature only, logStr = "temperature_env" 
     2155Function/S V_getTemp_MonitorSensor(fname,logStr) 
    21302156        String fname,logStr 
    21312157 
    2132         String path = "entry:sample:"+logstr+":start" 
    2133         Variable num=60 
    2134         return(V_getStringFromHDF5(fname,path,num)) 
    2135 End 
    2136  
    2137  
    2138 // TODO -- this may only exist for electric field and magnetic field... 
    2139 // or may be elimnated altogether 
    2140 Function V_getLog_nomValue(fname,logStr) 
     2158        String path = "entry:sample:"+logstr+":monitor_sensor" 
     2159        Variable num=60 
     2160        return(V_getStringFromHDF5(fname,path,num)) 
     2161End 
     2162 
     2163         
     2164 
     2165//// TODO -- this may not exist if it is not a "controlling" sensor, but there still may be logged data present 
     2166//// TODO -- it may also have different names for each sensor (setpoint_1, setpoint_2, etc. which will be a big hassle) 
     2167//Function V_getLog_setPoint(fname,logStr) 
     2168//      String fname,logStr 
     2169//       
     2170//      String path = "entry:sample:"+logstr+":setpoint_1" 
     2171//      return(V_getRealValueFromHDF5(fname,path)) 
     2172//end 
     2173// 
     2174//Function/S V_getLog_startTime(fname,logStr) 
     2175//      String fname,logStr 
     2176// 
     2177//      String path = "entry:sample:"+logstr+":start" 
     2178//      Variable num=60 
     2179//      return(V_getStringFromHDF5(fname,path,num)) 
     2180//End 
     2181// 
     2182// 
     2183//// TODO -- this may only exist for electric field and magnetic field... 
     2184//// or may be eliminated altogether 
     2185//Function V_getLog_nomValue(fname,logStr) 
     2186//      String fname,logStr 
     2187//       
     2188//      String path = "entry:sample:"+logstr+":value" 
     2189//      return(V_getRealValueFromHDF5(fname,path)) 
     2190//end 
     2191 
     2192 
     2193 
     2194/////////// 
     2195// for temperature, the "attached_to", "measurement", and "name" fields 
     2196// are one level down farther than before, and down deeper than for other sensors 
     2197// 
     2198// 
     2199// read the value of V_getTemp_MonitorSensor/ControlSensor to get the name of the sensor level . 
     2200// 
     2201 
     2202Function/S V_getTempLog_attachedTo(fname,logStr) 
    21412203        String fname,logStr 
    2142          
    2143         String path = "entry:sample:"+logstr+":value" 
    2144         return(V_getRealValueFromHDF5(fname,path)) 
    2145 end 
    2146  
     2204 
     2205        String path = "entry:sample:temperature_env:"+logstr+":attached_to" 
     2206        Variable num=60 
     2207        return(V_getStringFromHDF5(fname,path,num)) 
     2208End 
     2209 
     2210Function V_getTempLog_highTrip(fname,logStr) 
     2211        String fname,logStr 
     2212         
     2213        String path = "entry:sample:temperature_env:"+logstr+":high_trip_value" 
     2214        return(V_getRealValueFromHDF5(fname,path)) 
     2215end 
     2216 
     2217Function V_getTempLog_holdTime(fname,logStr) 
     2218        String fname,logStr 
     2219         
     2220        String path = "entry:sample:temperature_env:"+logstr+":hold_time" 
     2221        return(V_getRealValueFromHDF5(fname,path)) 
     2222end 
     2223 
     2224Function V_getTempLog_lowTrip(fname,logStr) 
     2225        String fname,logStr 
     2226         
     2227        String path = "entry:sample:temperature_env:"+logstr+":low_trip_value" 
     2228        return(V_getRealValueFromHDF5(fname,path)) 
     2229end 
     2230 
     2231Function/S V_getTempLog_measurement(fname,logStr) 
     2232        String fname,logStr 
     2233 
     2234        String path = "entry:sample:temperature_env:"+logstr+":measurement" 
     2235        Variable num=60 
     2236        return(V_getStringFromHDF5(fname,path,num)) 
     2237End 
     2238 
     2239 
     2240Function/S V_getTempLog_Model(fname,logStr) 
     2241        String fname,logStr 
     2242 
     2243        String path = "entry:sample:temperature_env:"+logstr+":model" 
     2244        Variable num=60 
     2245        return(V_getStringFromHDF5(fname,path,num)) 
     2246End 
     2247 
     2248Function/S V_getTempLog_Name(fname,logStr) 
     2249        String fname,logStr 
     2250 
     2251        String path = "entry:sample:temperature_env:"+logstr+":name" 
     2252        Variable num=60 
     2253        return(V_getStringFromHDF5(fname,path,num)) 
     2254End 
     2255 
     2256Function V_getTempLog_runControl(fname,logStr) 
     2257        String fname,logStr 
     2258         
     2259        String path = "entry:sample:temperature_env:"+logstr+":run_control" 
     2260        return(V_getRealValueFromHDF5(fname,path)) 
     2261end 
     2262 
     2263Function V_getTempLog_Setpoint(fname,logStr) 
     2264        String fname,logStr 
     2265         
     2266        String path = "entry:sample:temperature_env:"+logstr+":setpoint" 
     2267        return(V_getRealValueFromHDF5(fname,path)) 
     2268end 
     2269 
     2270Function/S V_getTempLog_ShortName(fname,logStr) 
     2271        String fname,logStr 
     2272 
     2273        String path = "entry:sample:temperature_env:"+logstr+":short_name" 
     2274        Variable num=60 
     2275        return(V_getStringFromHDF5(fname,path,num)) 
     2276End 
     2277 
     2278Function V_getTempLog_Timeout(fname,logStr) 
     2279        String fname,logStr 
     2280         
     2281        String path = "entry:sample:temperature_env:"+logstr+":timeout" 
     2282        return(V_getRealValueFromHDF5(fname,path)) 
     2283end 
     2284 
     2285Function V_getTempLog_Tolerance(fname,logStr) 
     2286        String fname,logStr 
     2287         
     2288        String path = "entry:sample:temperature_env:"+logstr+":tolerance" 
     2289        return(V_getRealValueFromHDF5(fname,path)) 
     2290end 
     2291 
     2292Function V_getTempLog_ToleranceBand(fname,logStr) 
     2293        String fname,logStr 
     2294         
     2295        String path = "entry:sample:temperature_env:"+logstr+":tolerance_band_time" 
     2296        return(V_getRealValueFromHDF5(fname,path)) 
     2297end 
     2298 
     2299Function V_getTempLog_Value(fname,logStr) 
     2300        String fname,logStr 
     2301         
     2302        String path = "entry:sample:temperature_env:"+logstr+":value" 
     2303        return(V_getRealValueFromHDF5(fname,path)) 
     2304end 
     2305 
     2306 
     2307 
     2308 
     2309 
     2310 
     2311// 
     2312// temperature_env:temp_Internal_1:value_log 
     2313// 
    21472314////            value_log (data folder) 
    2148  
     2315// 
     2316// TODO: 
     2317// -- be sure that the calling function properly calls for temperture 
     2318// logs which are down an extra layer: 
     2319//      for example, logStr = "temperature_env:temp_Internal_1" 
     2320// 
     2321// read the value of V_getTemp_MonitorSensor to get the name of the sensor the next level down. 
     2322// 
    21492323Function V_getLog_avgValue(fname,logStr) 
    21502324        String fname,logStr 
     
    21842358// DONE -- this needs to be a WAVE reference 
    21852359// DONE -- verify that the field is really read in as "time0" 
    2186 Function V_getLog_time(fname,logStr,outW) 
     2360Function V_getLog_timeWave(fname,logStr,outW) 
    21872361        String fname,logStr 
    21882362        Wave outW 
     
    21962370 
    21972371// DONE -- this needs to be a WAVE reference 
    2198 Function V_getLog_Value(fname,logStr,outW) 
     2372Function V_getLog_ValueWave(fname,logStr,outW) 
    21992373        String fname,logStr 
    22002374        Wave outW 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf

    r1041 r1044  
    58085808 
    58095809// 
    5810 // TODO -- I need to make sure that this is an integer in the JSON definition 
    5811 //              -- currently a text value in the data file - see trac ticket 
     5810// TODO x- I need to make sure that this is an integer in the JSON definition 
     5811//              x- currently a text value in the data file - see trac ticket 
    58125812// x- this is also a duplicated field in the reduction block (reduction/group_id is no longer used) 
    58135813// 
     
    58945894End 
    58955895 
     5896 
     5897 
     5898//Sample Temperature 
     5899Function V_writeSampleTemperature(fname,val) 
     5900        String fname 
     5901        Variable val 
     5902         
     5903//      String path = "entry:sample:temperature"         
     5904         
     5905        Make/O/D/N=1 wTmpWrite 
     5906//      Make/O/R/N=1 wTmpWrite 
     5907        String groupName = "/entry/sample" 
     5908        String varName = "temperature" 
     5909        wTmpWrite[0] = val 
     5910 
     5911        variable err 
     5912        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     5913        if(err) 
     5914                Print "HDF write err = ",err 
     5915        endif 
     5916        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     5917//      err = V_KillNamedDataFolder(fname) 
     5918//      if(err) 
     5919//              Print "DataFolder kill err = ",err 
     5920//      endif 
     5921        return(err) 
     5922end 
     5923 
     5924 
     5925//Sample Temperature set point 
     5926Function V_writeSampleTempSetPoint(fname,val) 
     5927        String fname 
     5928        Variable val 
     5929         
     5930//      String path = "entry:sample:temperature_setpoint"        
     5931         
     5932        Make/O/D/N=1 wTmpWrite 
     5933//      Make/O/R/N=1 wTmpWrite 
     5934        String groupName = "/entry/sample" 
     5935        String varName = "temperature_setpoint" 
     5936        wTmpWrite[0] = val 
     5937 
     5938        variable err 
     5939        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     5940        if(err) 
     5941                Print "HDF write err = ",err 
     5942        endif 
     5943        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     5944//      err = V_KillNamedDataFolder(fname) 
     5945//      if(err) 
     5946//              Print "DataFolder kill err = ",err 
     5947//      endif 
     5948        return(err) 
     5949end 
     5950 
     5951 
    58965952//Sample Thickness 
    58975953// TODO -- somehow, this is not set correctly in the acquisition, so NaN results 
     
    59215977end 
    59225978 
     5979 
    59235980//Sample Translation 
    59245981Function V_writeSampleTranslation(fname,val) 
     
    60046061// write this generic , call with the name of the environment log desired 
    60056062// 
    6006 // temperature_1 
    6007 // temperature_2 
    6008 // temperature_3 
    6009 // temperature_4 
     6063// 
    60106064// shear_field 
    60116065// pressure 
     
    60936147 
    60946148 
    6095 // TODO -- this may require multiple entries, for each sensor _1, _2, etc. 
    6096 Function V_writeLog_setPoint(fname,logStr,val) 
     6149//// TODO -- this may require multiple entries, for each sensor _1, _2, etc. 
     6150//Function V_writeLog_setPoint(fname,logStr,val) 
     6151//      String fname,logStr 
     6152//      Variable val 
     6153//       
     6154////    String path = "entry:sample:"+logstr+":setpoint_1" 
     6155//       
     6156//      Make/O/D/N=1 wTmpWrite 
     6157////    Make/O/R/N=1 wTmpWrite 
     6158//      String groupName = "/entry/sample/"+logStr 
     6159//      String varName = "setpoint_1" 
     6160//      wTmpWrite[0] = val 
     6161// 
     6162//      variable err 
     6163//      err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6164//      if(err) 
     6165//              Print "HDF write err = ",err 
     6166//      endif 
     6167//      // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6168////    err = V_KillNamedDataFolder(fname) 
     6169////    if(err) 
     6170////            Print "DataFolder kill err = ",err 
     6171////    endif 
     6172//      return(err) 
     6173//end 
     6174// 
     6175//Function V_writeLog_startTime(fname,logStr,str) 
     6176//      String fname,logStr,str 
     6177// 
     6178////    String path = "entry:sample:"+logstr+":start" 
     6179// 
     6180//      Make/O/T/N=1 tmpTW 
     6181//      String groupName = "/entry/sample/"+logStr 
     6182//      String varName = "start" 
     6183//      tmpTW[0] = str // 
     6184// 
     6185//      variable err 
     6186//      err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     6187//      if(err) 
     6188//              Print "HDF write err = ",err 
     6189//      endif 
     6190//       
     6191//      // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6192////    err = V_KillNamedDataFolder(fname) 
     6193////    if(err) 
     6194////            Print "DataFolder kill err = ",err 
     6195////    endif 
     6196//               
     6197//      return(err) 
     6198//End 
     6199// 
     6200// 
     6201//// TODO -- this may only exist for electric and magnetic field, or be removed 
     6202//Function V_writeLog_nomValue(fname,logStr,val) 
     6203//      String fname,logStr 
     6204//      Variable val 
     6205//       
     6206////    String path = "entry:sample:"+logstr+":value" 
     6207//       
     6208//      Make/O/D/N=1 wTmpWrite 
     6209////    Make/O/R/N=1 wTmpWrite 
     6210//      String groupName = "/entry/sample/"+logStr 
     6211//      String varName = "value" 
     6212//      wTmpWrite[0] = val 
     6213// 
     6214//      variable err 
     6215//      err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6216//      if(err) 
     6217//              Print "HDF write err = ",err 
     6218//      endif 
     6219//      // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6220////    err = V_KillNamedDataFolder(fname) 
     6221////    if(err) 
     6222////            Print "DataFolder kill err = ",err 
     6223////    endif 
     6224//      return(err) 
     6225//end 
     6226 
     6227 
     6228// for temperature only, logStr must be "temperature_env" 
     6229Function V_writeTempLog_ControlSensor(fname,logStr,str) 
     6230        String fname,logStr,str 
     6231 
     6232//      String path = "entry:sample:"+logstr+":control_sensor" 
     6233 
     6234        Make/O/T/N=1 tmpTW 
     6235        String groupName = "/entry/sample/"+logStr 
     6236        String varName = "control_sensor" 
     6237        tmpTW[0] = str // 
     6238 
     6239        variable err 
     6240        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     6241        if(err) 
     6242                Print "HDF write err = ",err 
     6243        endif 
     6244         
     6245        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6246//      err = V_KillNamedDataFolder(fname) 
     6247//      if(err) 
     6248//              Print "DataFolder kill err = ",err 
     6249//      endif 
     6250                 
     6251        return(err) 
     6252End 
     6253 
     6254// for temperature only, logStr must be "temperature_env" 
     6255Function V_writeTempLog_MonitorSensor(fname,logStr,str) 
     6256        String fname,logStr,str 
     6257 
     6258//      String path = "entry:sample:"+logstr+":monitor_sensor" 
     6259 
     6260        Make/O/T/N=1 tmpTW 
     6261        String groupName = "/entry/sample/"+logStr 
     6262        String varName = "monitor_sensor" 
     6263        tmpTW[0] = str // 
     6264 
     6265        variable err 
     6266        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     6267        if(err) 
     6268                Print "HDF write err = ",err 
     6269        endif 
     6270         
     6271        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6272//      err = V_KillNamedDataFolder(fname) 
     6273//      if(err) 
     6274//              Print "DataFolder kill err = ",err 
     6275//      endif 
     6276                 
     6277        return(err) 
     6278End 
     6279 
     6280 
     6281 
     6282//////////////////// 
     6283// 
     6284/////////// 
     6285// NOTE 
     6286// 
     6287// for temperature, the "attached_to", "measurement", and "name" fields 
     6288// are one level down farther than before, and down deeper than for other sensors 
     6289// 
     6290// 
     6291// read the value of V_getTemp_MonitorSensor/ControlSensor to get the name of the sensor level . 
     6292// 
     6293 
     6294Function V_writeTempLog_attachedTo(fname,logStr,str) 
     6295        String fname,logStr,str 
     6296 
     6297//      String path = "entry:sample:temperature_env:"+logstr+":attached_to" 
     6298 
     6299        Make/O/T/N=1 tmpTW 
     6300        String groupName = "/entry/sample/temperature_env/"+logStr 
     6301        String varName = "attached_to" 
     6302        tmpTW[0] = str // 
     6303 
     6304        variable err 
     6305        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     6306        if(err) 
     6307                Print "HDF write err = ",err 
     6308        endif 
     6309         
     6310        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6311//      err = V_KillNamedDataFolder(fname) 
     6312//      if(err) 
     6313//              Print "DataFolder kill err = ",err 
     6314//      endif 
     6315                 
     6316        return(err) 
     6317End 
     6318 
     6319 
     6320Function V_writeTempLog_highTrip(fname,logStr,val) 
    60976321        String fname,logStr 
    60986322        Variable val 
    60996323         
    6100 //      String path = "entry:sample:"+logstr+":setpoint_1" 
    6101          
    6102         Make/O/D/N=1 wTmpWrite 
    6103 //      Make/O/R/N=1 wTmpWrite 
    6104         String groupName = "/entry/sample/"+logStr 
    6105         String varName = "setpoint_1" 
    6106         wTmpWrite[0] = val 
    6107  
    6108         variable err 
    6109         err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    6110         if(err) 
    6111                 Print "HDF write err = ",err 
    6112         endif 
    6113         // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    6114 //      err = V_KillNamedDataFolder(fname) 
    6115 //      if(err) 
    6116 //              Print "DataFolder kill err = ",err 
    6117 //      endif 
    6118         return(err) 
    6119 end 
    6120  
    6121 Function V_writeLog_startTime(fname,logStr,str) 
     6324//      String path = "entry:sample:temperature_env:"+logstr+":high_trip_value" 
     6325         
     6326        Make/O/D/N=1 wTmpWrite 
     6327//      Make/O/R/N=1 wTmpWrite 
     6328        String groupName = "/entry/sample/temperature_env/"+logStr 
     6329        String varName = "high_trip_value" 
     6330        wTmpWrite[0] = val 
     6331 
     6332        variable err 
     6333        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6334        if(err) 
     6335                Print "HDF write err = ",err 
     6336        endif 
     6337        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6338//      err = V_KillNamedDataFolder(fname) 
     6339//      if(err) 
     6340//              Print "DataFolder kill err = ",err 
     6341//      endif 
     6342        return(err) 
     6343end 
     6344 
     6345Function V_writeTempLog_holdTime(fname,logStr,val) 
     6346        String fname,logStr 
     6347        Variable val 
     6348         
     6349//      String path = "entry:sample:temperature_env:"+logstr+":hold_time" 
     6350         
     6351        Make/O/D/N=1 wTmpWrite 
     6352//      Make/O/R/N=1 wTmpWrite 
     6353        String groupName = "/entry/sample/temperature_env/"+logStr 
     6354        String varName = "hold_time" 
     6355        wTmpWrite[0] = val 
     6356 
     6357        variable err 
     6358        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6359        if(err) 
     6360                Print "HDF write err = ",err 
     6361        endif 
     6362        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6363//      err = V_KillNamedDataFolder(fname) 
     6364//      if(err) 
     6365//              Print "DataFolder kill err = ",err 
     6366//      endif 
     6367        return(err) 
     6368end 
     6369 
     6370Function V_writeTempLog_lowTrip(fname,logStr,val) 
     6371        String fname,logStr 
     6372        Variable val 
     6373         
     6374//      String path = "entry:sample:temperature_env:"+logstr+":low_trip_value" 
     6375         
     6376        Make/O/D/N=1 wTmpWrite 
     6377//      Make/O/R/N=1 wTmpWrite 
     6378        String groupName = "/entry/sample/temperature_env/"+logStr 
     6379        String varName = "low_trip_value" 
     6380        wTmpWrite[0] = val 
     6381 
     6382        variable err 
     6383        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6384        if(err) 
     6385                Print "HDF write err = ",err 
     6386        endif 
     6387        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6388//      err = V_KillNamedDataFolder(fname) 
     6389//      if(err) 
     6390//              Print "DataFolder kill err = ",err 
     6391//      endif 
     6392        return(err) 
     6393end 
     6394 
     6395Function V_writeTempLog_measurement(fname,logStr,str) 
    61226396        String fname,logStr,str 
    61236397 
    6124 //      String path = "entry:sample:"+logstr+":start" 
    6125  
    6126         Make/O/T/N=1 tmpTW 
    6127         String groupName = "/entry/sample/"+logStr 
    6128         String varName = "start" 
    6129         tmpTW[0] = str // 
    6130  
    6131         variable err 
    6132         err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
    6133         if(err) 
    6134                 Print "HDF write err = ",err 
    6135         endif 
    6136          
    6137         // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    6138 //      err = V_KillNamedDataFolder(fname) 
    6139 //      if(err) 
    6140 //              Print "DataFolder kill err = ",err 
    6141 //      endif 
    6142                  
    6143         return(err) 
    6144 End 
    6145  
    6146  
    6147 // TODO -- this may only exist for electric and magnetic field, or be removed 
    6148 Function V_writeLog_nomValue(fname,logStr,val) 
     6398//      String path = "entry:sample:temperature_env:"+logstr+":measurement" 
     6399 
     6400        Make/O/T/N=1 tmpTW 
     6401        String groupName = "/entry/sample/temperature_env/"+logStr 
     6402        String varName = "measurement" 
     6403        tmpTW[0] = str // 
     6404 
     6405        variable err 
     6406        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     6407        if(err) 
     6408                Print "HDF write err = ",err 
     6409        endif 
     6410         
     6411        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6412//      err = V_KillNamedDataFolder(fname) 
     6413//      if(err) 
     6414//              Print "DataFolder kill err = ",err 
     6415//      endif 
     6416                 
     6417        return(err) 
     6418End 
     6419 
     6420Function V_writeTempLog_model(fname,logStr,str) 
     6421        String fname,logStr,str 
     6422 
     6423//      String path = "entry:sample:temperature_env:"+logstr+":model" 
     6424 
     6425        Make/O/T/N=1 tmpTW 
     6426        String groupName = "/entry/sample/temperature_env/"+logStr 
     6427        String varName = "model" 
     6428        tmpTW[0] = str // 
     6429 
     6430        variable err 
     6431        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     6432        if(err) 
     6433                Print "HDF write err = ",err 
     6434        endif 
     6435         
     6436        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6437//      err = V_KillNamedDataFolder(fname) 
     6438//      if(err) 
     6439//              Print "DataFolder kill err = ",err 
     6440//      endif 
     6441                 
     6442        return(err) 
     6443End 
     6444 
     6445Function V_writeTempLog_name(fname,logStr,str) 
     6446        String fname,logStr,str 
     6447 
     6448//      String path = "entry:sample:temperature_env:"+logstr+":name" 
     6449 
     6450        Make/O/T/N=1 tmpTW 
     6451        String groupName = "/entry/sample/temperature_env/"+logStr 
     6452        String varName = "name" 
     6453        tmpTW[0] = str // 
     6454 
     6455        variable err 
     6456        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     6457        if(err) 
     6458                Print "HDF write err = ",err 
     6459        endif 
     6460         
     6461        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6462//      err = V_KillNamedDataFolder(fname) 
     6463//      if(err) 
     6464//              Print "DataFolder kill err = ",err 
     6465//      endif 
     6466                 
     6467        return(err) 
     6468End 
     6469 
     6470Function V_writeTempLog_runControl(fname,logStr,val) 
    61496471        String fname,logStr 
    61506472        Variable val 
    61516473         
    6152 //      String path = "entry:sample:"+logstr+":value" 
    6153          
    6154         Make/O/D/N=1 wTmpWrite 
    6155 //      Make/O/R/N=1 wTmpWrite 
    6156         String groupName = "/entry/sample/"+logStr 
     6474//      String path = "entry:sample:temperature_env:"+logstr+":run_control" 
     6475         
     6476        Make/O/D/N=1 wTmpWrite 
     6477//      Make/O/R/N=1 wTmpWrite 
     6478        String groupName = "/entry/sample/temperature_env/"+logStr 
     6479        String varName = "run_control" 
     6480        wTmpWrite[0] = val 
     6481 
     6482        variable err 
     6483        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6484        if(err) 
     6485                Print "HDF write err = ",err 
     6486        endif 
     6487        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6488//      err = V_KillNamedDataFolder(fname) 
     6489//      if(err) 
     6490//              Print "DataFolder kill err = ",err 
     6491//      endif 
     6492        return(err) 
     6493end 
     6494 
     6495Function V_writeTempLog_setPoint(fname,logStr,val) 
     6496        String fname,logStr 
     6497        Variable val 
     6498         
     6499//      String path = "entry:sample:temperature_env:"+logstr+":setpoint" 
     6500         
     6501        Make/O/D/N=1 wTmpWrite 
     6502//      Make/O/R/N=1 wTmpWrite 
     6503        String groupName = "/entry/sample/temperature_env/"+logStr 
     6504        String varName = "setpoint" 
     6505        wTmpWrite[0] = val 
     6506 
     6507        variable err 
     6508        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6509        if(err) 
     6510                Print "HDF write err = ",err 
     6511        endif 
     6512        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6513//      err = V_KillNamedDataFolder(fname) 
     6514//      if(err) 
     6515//              Print "DataFolder kill err = ",err 
     6516//      endif 
     6517        return(err) 
     6518end 
     6519 
     6520Function V_writeTempLog_shortName(fname,logStr,str) 
     6521        String fname,logStr,str 
     6522 
     6523//      String path = "entry:sample:temperature_env:"+logstr+":short_name" 
     6524 
     6525        Make/O/T/N=1 tmpTW 
     6526        String groupName = "/entry/sample/temperature_env/"+logStr 
     6527        String varName = "short_name" 
     6528        tmpTW[0] = str // 
     6529 
     6530        variable err 
     6531        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     6532        if(err) 
     6533                Print "HDF write err = ",err 
     6534        endif 
     6535         
     6536        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6537//      err = V_KillNamedDataFolder(fname) 
     6538//      if(err) 
     6539//              Print "DataFolder kill err = ",err 
     6540//      endif 
     6541                 
     6542        return(err) 
     6543End 
     6544 
     6545Function V_writeTempLog_timeout(fname,logStr,val) 
     6546        String fname,logStr 
     6547        Variable val 
     6548         
     6549//      String path = "entry:sample:temperature_env:"+logstr+":timeout" 
     6550         
     6551        Make/O/D/N=1 wTmpWrite 
     6552//      Make/O/R/N=1 wTmpWrite 
     6553        String groupName = "/entry/sample/temperature_env/"+logStr 
     6554        String varName = "timeout" 
     6555        wTmpWrite[0] = val 
     6556 
     6557        variable err 
     6558        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6559        if(err) 
     6560                Print "HDF write err = ",err 
     6561        endif 
     6562        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6563//      err = V_KillNamedDataFolder(fname) 
     6564//      if(err) 
     6565//              Print "DataFolder kill err = ",err 
     6566//      endif 
     6567        return(err) 
     6568end 
     6569 
     6570Function V_writeTempLog_tolerance(fname,logStr,val) 
     6571        String fname,logStr 
     6572        Variable val 
     6573         
     6574//      String path = "entry:sample:temperature_env:"+logstr+":tolerance" 
     6575         
     6576        Make/O/D/N=1 wTmpWrite 
     6577//      Make/O/R/N=1 wTmpWrite 
     6578        String groupName = "/entry/sample/temperature_env/"+logStr 
     6579        String varName = "tolerance" 
     6580        wTmpWrite[0] = val 
     6581 
     6582        variable err 
     6583        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6584        if(err) 
     6585                Print "HDF write err = ",err 
     6586        endif 
     6587        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6588//      err = V_KillNamedDataFolder(fname) 
     6589//      if(err) 
     6590//              Print "DataFolder kill err = ",err 
     6591//      endif 
     6592        return(err) 
     6593end 
     6594 
     6595Function V_writeTempLog_toleranceBand(fname,logStr,val) 
     6596        String fname,logStr 
     6597        Variable val 
     6598         
     6599//      String path = "entry:sample:temperature_env:"+logstr+":tolerance_band_time" 
     6600         
     6601        Make/O/D/N=1 wTmpWrite 
     6602//      Make/O/R/N=1 wTmpWrite 
     6603        String groupName = "/entry/sample/temperature_env/"+logStr 
     6604        String varName = "tolerance_band_time" 
     6605        wTmpWrite[0] = val 
     6606 
     6607        variable err 
     6608        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6609        if(err) 
     6610                Print "HDF write err = ",err 
     6611        endif 
     6612        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     6613//      err = V_KillNamedDataFolder(fname) 
     6614//      if(err) 
     6615//              Print "DataFolder kill err = ",err 
     6616//      endif 
     6617        return(err) 
     6618end 
     6619 
     6620Function V_writeTempLog_Value(fname,logStr,val) 
     6621        String fname,logStr 
     6622        Variable val 
     6623         
     6624//      String path = "entry:sample:temperature_env:"+logstr+":value" 
     6625         
     6626        Make/O/D/N=1 wTmpWrite 
     6627//      Make/O/R/N=1 wTmpWrite 
     6628        String groupName = "/entry/sample/temperature_env/"+logStr 
    61576629        String varName = "value" 
    61586630        wTmpWrite[0] = val 
     
    61716643end 
    61726644 
     6645 
     6646 
     6647 
     6648 
     6649// 
     6650// temperature_env:temp_Internal_1:value_log 
     6651// 
     6652////            value_log (data folder) 
     6653// 
     6654// TODO: 
     6655// -- be sure that the calling function properly calls for temperture 
     6656// logs which are down an extra layer: 
     6657//      for example, logStr = "temperature_env:temp_Internal_1" 
     6658// 
     6659// read the value of V_getTemp_MonitorSensor to get the name of the sensor the next level down. 
     6660// 
     6661// 
     6662///////////////////////////////////// 
    61736663////            value_log (data folder) 
    61746664// 
     
    63036793// TODO -- this needs to be a WAVE reference 
    63046794// be sure this gets written as "time", even though it is read in as "time0" 
    6305 Function V_writeLog_time(fname,logStr,inW) 
     6795Function V_writeLog_timeWave(fname,logStr,inW) 
    63066796        String fname,logStr 
    63076797        Wave inW 
     
    63326822 
    63336823// TODO -- this needs to be a WAVE reference 
    6334 Function V_writeLog_Value(fname,logStr,inW) 
     6824Function V_writeLog_ValueWave(fname,logStr,inW) 
    63356825        String fname,logStr 
    63366826        Wave inW 
     
    63586848        return(err) 
    63596849end 
     6850 
     6851 
     6852 
     6853 
     6854 
    63606855 
    63616856 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Utilities.ipf

    r1042 r1044  
    8181end 
    8282 
    83 Function V_QBinAllPanels(folderStr,binType) 
     83// 
     84// TODO -- binType == 4 (slit mode) should never end up here 
     85// -- new logic in calling routines to dispatch to proper routine 
     86// -- AND need to write the routine for binning_SlitMode 
     87// 
     88Function V_QBinAllPanels_Circular(folderStr,binType) 
    8489        String folderStr 
    8590        Variable binType 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Initialize.ipf

    r1040 r1044  
    138138        //check platform, so Angstrom can be drawn correctly 
    139139 
    140         //TODO  - this is different on Igor 7. Macintosh # has been updated, but Windows has not 
     140        //TODO  -- this is different on Igor 7. Macintosh # has been updated, but Windows has not 
    141141        // use Print char2num("à
    142142") to find the magic number 
     
    154154        endif 
    155155         
    156         // TODO -- find the SANS preferences, copy over and update for VSANS 
    157         // -- these are all in PlotUtilsMacro_v40.ipf as the preferences are set up as common 
     156        // TODO x- find the SANS preferences, copy over and update for VSANS 
     157        // x- these are all in PlotUtilsMacro_v40.ipf as the preferences are set up as common 
    158158        // to all packages. I'm not sure that I want to do this with VSANS, but make the packages 
    159159        // separate entities. I'm seeing little benefit of the crossover, especially now that  
     
    279279 
    280280// TODO 
    281 // do I need to make the protocols any longer for VSANS? 
     281// do I need to make the protocols any longer for VSANS? (yes -- now 12 points) 
    282282// What other options for processing / averaging / saving are needed?? 
    283283// - TODO 
    284 // -- likely that I'll want to have #pts to cut from I(q) as input to NSORT within the protocol so that the  
     284// x- likely that I'll want to have #pts to cut from I(q) as input to NSORT within the protocol so that the  
    285285// entire reduction can be automatic 
    286286// 
     
    289289// -- all protocols are kept in the root:Packages:NIST:VSANS:Globals:Protocols folder, created here 
    290290// 
     291// 
     292//*****as of 05_2017, protocols are 12 points long, [6] is used for work.drk, [7,8] are for trimmig points, and [9,11] are currently unused  
     293// 
    291294Function V_InitFakeProtocols() 
    292295         
    293         //*****as of 05_2017, protocols are 12 points long, [6] is used for work.drk, [7,8] are for trimmig points, and [9,11] are currently unused  
    294296        NewDataFolder/O root:Packages:NIST:VSANS:Globals:Protocols 
    295297        Make/O/T $"root:Packages:NIST:VSANS:Globals:Protocols:Base"={"none","none","ask","ask","none","AVTYPE=Circular;SAVE=Yes;NAME=Manual;PLOT=Yes","DRK=none,DRKMODE=0,","","","","",""} 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Marquee_Operations.ipf

    r1041 r1044  
    1212// 
    1313// -- writing the box coordinates and the counts (and error) to the data file 
    14 // -- determining the beam center (centroid) of the selection + writing this to the file 
     14// x- determining the beam center (centroid) of the selection  
     15//  -- writing beam center (centroid) to the file? 
    1516//  -- a box sum over a range of files (with a plot) 
    1617// -- box sum over annular regions 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf

    r1043 r1044  
    23882388 
    23892389 
     2390// 
     2391// TODO: 
     2392// -- do I calculate the proper resolution here? I've already decoded the binning type 
     2393//   and the averaging type has been specified by the protocol 
     2394// -- if I calculate the resolution here, then the Trimming routines must be updated 
     2395//    to trim the resolution waves also. This positioning may work for  
     2396//    pinhole resolution, but anything using the matrix method - it won't work - and I'll need  
     2397//    a different solution 
     2398// 
    23902399        strswitch(av_type)      //dispatch to the proper routine to average to 1D data 
    23912400                case "none":             
     
    24082417                        break 
    24092418                case "Circular": 
    2410 //                      CircularAverageTo1D(activeType) 
    2411                         V_QBinAllPanels(activeType,binType)             // this does a default circular average 
     2419 
     2420                        V_QBinAllPanels_Circular(activeType,binType)            // this does a default circular average 
    24122421                        break 
    24132422                case "Sector": 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf

    r1043 r1044  
    819819// 
    820820// -- currently just the graph, no controls 
    821 // -- this re-bins the data every time by calling V_QBinAllPanels(folderStr,binType) 
     821// -- this re-bins the data every time by calling V_QBinAllPanels(folderStr,binType) from inside V_BinningModePopup() 
    822822Function V_IvsQPanelButtonProc(ba) : ButtonControl 
    823823        STRUCT WMButtonAction &ba 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Testing_Data_Procs.ipf

    r1028 r1044  
    120120         
    121121        // reduction group_id 
    122         // TODO - skip for now. group_id is incorrectly written to the data file as a text value. trac ticket 
     122        // TODO x- (file has been corected)skip for now. group_id is incorrectly written to the data file as a text value. trac ticket 
    123123        //        has been written to fix in the future. 
    124 //      V_writeReduction_group_ID(fileName,group_id) 
     124        V_writeSample_GroupID(fileName,group_id) 
    125125 
    126126 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf

    r1035 r1044  
    124124// NOTE -- use V_CleanupData_w_Progress(0,1) to get a progress bar - since this will take more than 
    125125//     a few seconds to complete, especially if a file catalog was done, or a "batch" patching, etc. 
     126// 
     127// *** this appears to be unused, in favor of V_CleanupData_w_Progress(0,1)  ********** 
    126128// 
    127129Function V_CleanOutRawVSANS() 
     
    493495 
    494496        // TODO 
    495         // -- update the 1D plotting as needed. these are SANS calls (OK for now, but will need to be better) 
     497        // x- update the 1D plotting as needed. these are SANS calls (OK for now, but will need to be better) 
    496498        //do the average and plot (either the default, or what is on the panel currently) 
    497499        SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType 
     
    642644End 
    643645 
    644 // TODO -- need to fill in correctly by determining this from the INTENT field 
     646// TODO x- need to fill in correctly by determining this from the INTENT field 
    645647// 
    646648Function V_isTransFile(fname) 
     
    650652        String testStr="" 
    651653         
    652 //      testStr = V_getInstrumentName(fname) 
    653  
    654         if(cmpstr(testStr,"NG3-VSANS") == 0)            //wrong test 
    655                 //testStr exists, ASSUMING it's a raw VSANS data file 
     654        testStr = V_getReduction_intent(fname) 
     655 
     656        if(cmpstr(testStr,"TRANSMISSION") == 0)         // 
     657                //yes, a transmission file 
    656658                Return(1) 
    657659        else 
    658                 //some other file 
     660                //some other file intent 
    659661                Return(0) 
    660662        Endif 
Note: See TracChangeset for help on using the changeset viewer.