Ignore:
Timestamp:
Jul 22, 2019 11:58:39 AM (3 years ago)
Author:
krzywon
Message:

Fix issues with processNote, Qdev, and temperature for the VSANS NXcanSAS writer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_NXcanSAS.ipf

    r1184 r1186  
    8282        Make/O/T/N=5 $(dataBase + ":attrVals") = {"SASdata","I","Q","NXdata","0",V_getDataEndTime(folderStr)} 
    8383        CreateStrNxCansas(fileID,dataParent,"","",empty,$(dataBase + ":attr"),$(dataBase + ":attrVals")) 
     84        // 
     85        // TODO: Reinstate Qdev/resolutions when I can fix the reader issue 
     86        // 
    8487        // Create q entry 
    8588        NewDataFolder/O/S $(dataBase + ":q") 
    86         Make/T/N=2 $(dataBase + ":q:attr") = {"units","resolutions"} 
    87         Make/T/N=2 $(dataBase + ":q:attrVals") = {"1/angstrom","Qdev"} 
     89        Make/O/T/N=2 $(dataBase + ":q:attr") = {"units"}//,"resolutions"} 
     90        Make/O/T/N=2 $(dataBase + ":q:attrVals") = {"1/angstrom"}//,"Qdev"} 
    8891        CreateVarNxCansas(fileID,dataParent,"sasdata","Q",qw,$(dataBase + ":q:attr"),$(dataBase + ":q:attrVals")) 
    8992        // Create i entry 
     
    126129// 
    127130// TODO: 
    128 // -- This is a placeholder for the final NXcanSAS writer for VSANS data. 
    129131// -- resolution is not generated here (and it shouldn't be) since resolution is not known yet. 
    130132// -- The final writer will need to be aware of resolution, and there may be different forms 
     
    153155        if(!fileID) 
    154156                abort "Unable to create file at " + saveName + "." 
    155         else 
    156                 Variable sasentry = NumVarOrDefault("root:Packages:NIST:gSASEntryNumber", 1) 
    157                 sPrintf parentBase,"%s:sasentry%d",base,sasentry // Igor memory base path for all 
    158                 sPrintf nxcansasBase,"/sasentry%d/",sasentry // HDF5 base path for all 
    159157        EndIf 
     158                 
     159        Variable sasentry = NumVarOrDefault("root:Packages:NIST:gSASEntryNumber", 1) 
     160        sPrintf parentBase,"%s:sasentry%d",base,sasentry // Igor memory base path for all 
     161        sPrintf nxcansasBase,"/sasentry%d/",sasentry // HDF5 base path for all 
    160162         
    161163        // declare, or make a fake protocol if needed (if the export type is RAW) 
     
    239241                deltaLam = V_getWavelength_spread(type) 
    240242                // TODO -- decipher which beamstop, if any is actually in place 
    241         // or -- V_getBeamStopC3_size(type) 
     243                // or -- V_getBeamStopC3_size(type) 
    242244                bstop = V_getBeamStopC2_size(type) 
    243245 
     
    250252                WAVE data_err = V_getDetectorDataErrW(type,detStr) 
    251253                 
    252                 // TOOD - replace hard wired paths with Read functions 
     254                // TODO - replace hard wired paths with Read functions 
    253255                // hard-wired 
    254256                Wave qx_val = $("root:Packages:NIST:VSANS:"+type+":entry:instrument:detector_"+detStr+":qx_"+detStr) 
     
    778780        CreateVarNxCansas(fileID,sampleParent,"","transmission",$(sampleBase + ":transmission"),empty,empty) 
    779781         
     782        // Create SASsample temperature entry 
     783        If(V_getSampleTemperature(folderStr) != -999999) 
     784                Make/O/N=1 $(sampleBase + ":temperature") = {V_getSampleTemperature(folderStr)} 
     785                CreateVarNxCansas(fileID,sampleParent,"","temperature",$(sampleBase + ":temperature"),empty,empty) 
     786        EndIf 
     787         
     788        // 
     789        // TODO: Include other sample environment when they are available 
     790         
    780791        // SASprocess 
    781792        SVAR samFiles = root:Packages:NIST:VSANS:Globals:Protocols:gSAM 
     
    791802                protoStr8 = proto[8] 
    792803        endif 
    793         String processNote = "" 
    794         sPrintf processNote,"SAM: %s\r\n",samFiles 
    795         sPrintf processNote,"%sBGD: %s\r\n",processNote,proto[0] 
    796         sPrintf processNote,"%sEMP: %s\r\n",processNote,Proto[1] 
    797         sPrintf processNote,"%sDIV: %s\r\n",processNote,Proto[2] 
    798         sPrintf processNote,"%sMASK: %s\r\n",processNote,Proto[3] 
    799         sPrintf processNote,"%sABS Parameters (3-6): %s\r\n",processNote,Proto[4] 
    800         sPrintf processNote,"%sAverage Choices: %s\r\n",processNote,Proto[5] 
    801         sPrintf processNote,"%sBeginning Trim Points: %s\r\n",processNote,ProtoStr7 
    802         sPrintf processNote,"%sEnd Trim Points: %s\r\n",processNote,ProtoStr8 
    803         sPrintf processNote,"%sCOLLIMATION=%s\r\n",processNote,proto[9] 
     804        String processNote0,processNote1,processNote2,processNote3,processNote4 
     805        String processNote5,processNote6,processNote7,processNote8,processNote9 
     806        sPrintf processNote0,"SAM: %s",samFiles 
     807        sPrintf processNote1,"BGD: %s",Proto[0] 
     808        sPrintf processNote2,"EMP: %s",Proto[1] 
     809        sPrintf processNote3,"DIV: %s",Proto[2] 
     810        sPrintf processNote4,"MASK: %s",Proto[3] 
     811        sPrintf processNote5,"ABS Parameters (3-6): %s",Proto[4] 
     812        sPrintf processNote6,"Average Choices: %s",Proto[5] 
     813        sPrintf processNote7,"Beginning Trim Points: %s",ProtoStr7 
     814        sPrintf processNote8,"End Trim Points: %s",ProtoStr8 
     815        sPrintf processNote9,"COLLIMATION=%s",proto[9] 
    804816        // Create SASprocess entry 
    805817        String processParent = parentBase + "sasprocess/" 
     
    812824        Make/O/T/N=1 $(processBase + ":name") = {samFiles} 
    813825        CreateStrNxCansas(fileID,processParent,"","name",$(processBase + ":name"),empty,empty) 
    814         // Create SASprocess note entry 
    815          
    816         // 
    817         // TODO: Reinstate SASprocess.note when I figure out why it won't save 
    818         // 
    819          
    820         //Make/O/T/N=1 $(processBase + ":note") = {processNote} 
    821         //CreateStrNxCansas(fileID,processParent,"","note",$(processBase + ":note"),empty,empty) 
     826        // Create SASprocess note entries 
     827        Make/O/T/N=1 $(processBase + ":note0") = {processNote0} 
     828        CreateStrNxCansas(fileID,processParent,"","note0",$(processBase + ":note0"),empty,empty) 
     829        Make/O/T/N=1 $(processBase + ":note1") = {processNote1} 
     830        CreateStrNxCansas(fileID,processParent,"","note1",$(processBase + ":note1"),empty,empty) 
     831        Make/O/T/N=1 $(processBase + ":note2") = {processNote2} 
     832        CreateStrNxCansas(fileID,processParent,"","note2",$(processBase + ":note2"),empty,empty) 
     833        Make/O/T/N=1 $(processBase + ":note3") = {processNote3} 
     834        CreateStrNxCansas(fileID,processParent,"","note3",$(processBase + ":note3"),empty,empty) 
     835        Make/O/T/N=1 $(processBase + ":note4") = {processNote4} 
     836        CreateStrNxCansas(fileID,processParent,"","note4",$(processBase + ":note4"),empty,empty) 
     837        Make/O/T/N=1 $(processBase + ":note5") = {processNote5} 
     838        CreateStrNxCansas(fileID,processParent,"","note5",$(processBase + ":note5"),empty,empty) 
     839        Make/O/T/N=1 $(processBase + ":note6") = {processNote6} 
     840        CreateStrNxCansas(fileID,processParent,"","note6",$(processBase + ":note6"),empty,empty) 
     841        Make/O/T/N=1 $(processBase + ":note7") = {processNote7} 
     842        CreateStrNxCansas(fileID,processParent,"","note7",$(processBase + ":note7"),empty,empty) 
     843        Make/O/T/N=1 $(processBase + ":note8") = {processNote8} 
     844        CreateStrNxCansas(fileID,processParent,"","note8",$(processBase + ":note8"),empty,empty) 
     845        Make/O/T/N=1 $(processBase + ":note9") = {processNote9} 
     846        CreateStrNxCansas(fileID,processParent,"","note9",$(processBase + ":note9"),empty,empty) 
    822847         
    823848End 
Note: See TracChangeset for help on using the changeset viewer.