Changeset 1182 for sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures
- Timestamp:
- Jul 17, 2019 4:50:44 PM (4 years ago)
- Location:
- sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf
r1154 r1182 3275 3275 String fullpath = "", newfileName="" 3276 3276 String saveType = StringByKey("SAVE",avgStr,"=",";") //does user want to save data? 3277 NVAR useNXcanSASOutput = root:Packages:NIST:gNXcanSAS_Write 3277 3278 3278 3279 If( (cmpstr(saveType[0,2],"Yes")==0) && (cmpstr(av_type,"none") != 0) ) … … 3341 3342 // endif 3342 3343 // 3344 3343 3345 if(cmpstr(saveType,"Yes - Concatenate")==0) 3344 3346 V_Trim1DDataStr(activeType,binType,trimBegStr,trimEndStr) // x- passing null strings uses global or default trim values … … 3348 3350 V_RemoveDuplicateQvals("root:Packages:NIST:VSANS:",activeType) // works with the "tmp_x" waves from concatenateForSave 3349 3351 // prot[9] = collimationStr 3350 3351 V_Write1DData("root:Packages:NIST:VSANS:",activeType,newFileName+"."+exten) //don't pass the full path, just the name 3352 if (useNXcanSASOutput == 1) 3353 WriteNxCanSAS1D(activeType,fullPath,dialog) 3354 else 3355 V_Write1DData("root:Packages:NIST:VSANS:",activeType,newFileName+"."+exten) //don't pass the full path, just the name 3356 EndIf 3352 3357 3353 3358 endif … … 3371 3376 V_QxQy_Export(activeType,fullPath,newFileName,dialog) 3372 3377 break 3378 case "2D_NXcanSAS": 3379 fullPath = S_Path + newFileName+".h5" 3380 V_WriteNXcanSAS2DData(activeType,fullPath,newFileName,dialog) 3381 break 3373 3382 case "PNG_Graphic": 3374 3383 // SaveAsPNG(activeType,fullpath,dialog) -
sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_NXcanSAS.ipf
r1181 r1182 14 14 15 15 SetDataFolder $(pathStr+folderStr) 16 17 Print "Starting the process of writing to NXcanSAS files" 16 18 17 19 // Check fullpath and dialog … … 72 74 Make/O/T/N=1 $(parentBase + ":run") = {V_getExperiment_identifier(folderStr)} 73 75 CreateStrNxCansas(fileID,nxcansasBase,"","run",$(parentBase + ":run"),empty,empty) 76 77 Print "Writing VSANS 1D Data in NXcanSAS format" 74 78 75 79 // SASData … … 97 101 CreateVarNxCansas(fileID,dataParent,"sasdata","Qmean",qbar,units,inv_angstrom) 98 102 103 Print "Writing VSANS Meta Data in NXcanSAS format" 104 99 105 // Write all VSANS meta data 100 106 V_WriteMetaData(fileID,parentBase,nxcansasBase,folderStr,proto) … … 217 223 pixY = V_getDet_pixel_num_y(type,detStr) 218 224 219 fileName = newFileName225 fileName = saveName 220 226 fileDate = V_getDataStartTime(type) // already a string 221 227 fileLabel = V_getSampleDescription(type) … … 299 305 300 306 Variable ret1,ret2,ret3,nq 301 String collimationStr 302 303 304 collimationStr = proto[9] 307 String collimationStr = proto[9] 305 308 306 309 nq = pixX*pixY … … 321 324 v_tic() 322 325 Make/O/N=(2,pixX,pixY) qxy_vals 323 //everything in 1D now324 326 Make/O/N=(pixX,pixY) shadow 325 327 Make/O/N=(2,pixX,pixY) SigmaQ_combined … … 327 329 jj = 0 328 330 do 329 nq = ii * pix elsX + jj330 get2DResolution(qval[nq],phi[nq],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,pixSize,usingLenses,r_dist[nq],ret1,ret2,ret3)331 nq = ii * pixX + jj 332 V_get2DResolution(qval[nq],phi[nq],r_dist[nq],folderStr,detStr,collimationStr,ret1,ret2,ret3) 331 333 qxy_vals[0][ii][jj] = qx_val[nq] 332 334 qxy_vals[1][ii][jj] = qy_val[nq] 333 SigmaQ_combined[0][ii][jj] = ret1 335 SigmaQ_combined[0][ii][jj] = ret1 334 336 SigmaQ_combined[1][ii][jj] = ret2 335 shadow[ii][jj] = ret3 337 shadow[ii][jj] = ret3 336 338 jj+=1 337 while(jj<pix elsX)339 while(jj<pixX) 338 340 ii+=1 339 while(ii<pixelsY) 340 v_toc() 341 while(ii<pixY) 342 v_toc() 343 341 344 ////********************* 342 345 Duplicate/O qx_val,qx_val_s … … 355 358 Redimension/N=(pixX*pixY) qx_val_s,qy_val_s,qz_val_s,z_val_s,sw_s 356 359 360 String dataParent,dataBase 357 361 // SASData 358 String dataParent = nxcansasBase + "sasdata" + kk + "/"362 sPrintf dataParent,"%ssasdata%d/",nxcansasBase,kk 359 363 // Create SASdata entry 360 String dataBase = parentBase + ":sasdata" +kk364 sPrintf dataBase,"%s:sasdata%d",parentBase,kk 361 365 NewDataFolder/O/S $(dataBase) 362 366 Make/O/T/N=5 $(dataBase + ":attr") = {"canSAS_class","signal","I_axes","NX_class","Q_indices", "timestamp"} 363 Make/O/T/N=5 $(dataBase + ":attrVals") = {"SASdata","I","Q,Q","NXdata","0,1", textw[1]}367 Make/O/T/N=5 $(dataBase + ":attrVals") = {"SASdata","I","Q,Q","NXdata","0,1",V_getDataEndTime(folderStr)} 364 368 CreateStrNxCansas(fileID,dataParent,"","",empty,$(dataBase + ":attr"),$(dataBase + ":attrVals")) 365 369 // Create i entry … … 386 390 387 391 KillWaves/Z qx_val_s,qy_val_s,z_val_s,qz_val_s,SigmaQx_s,SigmaQy_s,fSubS_s,sw,sw_s 388 389 392 Killwaves/Z qval,sigmaQx,SigmaQy,fSubS,phi,r_dist 390 391 392 393 393 394 endfor … … 395 396 KillWaves/Z labelWave,dum 396 397 397 398 399 // Write all meta data 400 WriteMetaData(fileID,parentBase,nxcansasBase,rw,textw) 398 // Write all VSANS meta data 399 V_WriteMetaData(fileID,parentBase,nxcansasBase,folderStr,proto) 400 401 // 402 /////////////////////////////////////////////////////////////////////////// 401 403 402 404 // Close the file
Note: See TracChangeset
for help on using the changeset viewer.