- Timestamp:
- May 13, 2019 11:20:55 AM (4 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf
r1133 r1150 1923 1923 1924 1924 1925 1926 // MAY 2019 SRK 1927 // 1928 // there was a change in the GUI and NICE behavior during the shutdown, before startup 1929 // on 05/22/19 where the units of the sample Ap2 dimensions are changed. supposedly this 1930 // will ensure consistency of all units as [cm]. From what I found in the code, all the units 1931 // were already [cm], so I'm not sure what will happen. 1932 // 1933 // if I flag things here to switch on the date, I can force the output to always be [cm] 1934 // V_Compare_ISO_Dates("2019-05-10T13:36:54.200-04:00",fileDate) 1935 // 1936 // here the first date is a generic date during the shutdown, but before startup. 1937 // fileDate is the actual date of file collection 1938 // if fileDate is more recent (and thus affected by the change), then the function 1939 // will return a value == 2 (2nd date greater) and I can act on that 1940 // 1941 // this change only affects sampleAp2, and this value only affects the resolution calculation 1942 // 1943 // V_Compare_ISO_Dates("2019-05-10T13:36:54.200-04:00",V_getDataStartTime(fname)) 1944 // 1945 1946 1925 1947 /////// sample_aperture_2 (data folder) 1926 1948 // sample aperture (2) is the external aperture, which may or may not be present 1927 1928 1949 Function/S V_getSampleAp2_Description(fname) 1929 1950 String fname -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_ISO8601_Util.ipf
r1024 r1150 82 82 s2 = ISOstr[11,18] // skip the "T" and take the next 8 chars HH:MM:SS 83 83 // skip the time zone... 84 print s185 print s284 // print s1 85 // print s2 86 86 87 87 Variable yr,mo,dy,hh,mm,ss … … 100 100 return(secs) 101 101 End 102 103 104 // utility to compare two iso dates 105 // returns 106 // 1 if iso1 is greater than iso2 (meaning iso1 is more RECENT) 107 // 2 if iso2 is greater than iso1 (meaning iso2 is more RECENT) 108 // 0 if they are the same time 109 // 110 // 111 Function V_Compare_ISO_Dates(iso1,iso2) 112 String iso1,iso2 113 114 if(V_ISO8601_to_IgorTime(iso1) == V_ISO8601_to_IgorTime(iso2)) 115 return(0) 116 endif 117 118 if(V_ISO8601_to_IgorTime(iso1) > V_ISO8601_to_IgorTime(iso2)) 119 return(1) 120 else 121 return(2) 122 endif 123 124 return(-1) 125 End 126 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_PatchFiles.ipf
r1148 r1150 413 413 listWave[0][2] = V_getSampleDescription(fname) 414 414 415 listWave[1][1] = "thickness (cm)"415 listWave[1][1] = "thickness [cm]" 416 416 listWave[1][2] = num2str(V_getSampleThickness(fname)) 417 417 … … 447 447 fname = S_path + fname 448 448 449 Variable nRows = 1 3449 Variable nRows = 17 450 450 Redimension/N=(nRows,3) ListWave 451 451 Redimension/N=(nRows,3) selWave … … 471 471 listWave[4][1] = "wavelength_spread" 472 472 listWave[4][2] = num2str(V_getWavelength_spread(fname)) 473 474 listWave[5][1] = "distance (source aperture to GV) (cm)" 475 listWave[5][2] = num2str(V_getSourceAp_distance(fname)) 476 477 listWave[6][1] = "source aperture size (mm)" 478 listWave[6][2] = V_getSourceAp_size(fname) 479 480 listWave[7][1] = "sample aperture size (internal) (mm)" 481 listWave[7][2] = V_getSampleAp_size(fname) 482 483 listWave[8][1] = "sample aperture(2) diam (external) (cm)" 484 listWave[8][2] = num2str(V_getSampleAp2_size(fname)) 485 486 listWave[9][1] = "beam stop diameter (Middle) (mm)" 487 // listWave[9][2] = num2str(V_getBeamStopC2_size(fname)) 488 listWave[9][2] = num2str(V_DeduceBeamstopDiameter(fname,"MR")) 489 490 listWave[10][1] = "beam stop diameter (Back) (mm)" 491 // listWave[10][2] = num2str(V_getBeamStopC3_size(fname)) 492 listWave[10][2] = num2str(V_DeduceBeamstopDiameter(fname,"B")) 493 494 listWave[11][1] = "sample aperture(2) to gate valve (cm)" 495 listWave[11][2] = num2str(V_getSampleAp2_distance(fname)) 496 497 listWave[12][1] = "sample to gate valve (cm)" 498 listWave[12][2] = num2str(V_getSampleTableOffset(fname)) 473 474 listWave[5][1] = "Number of Guides OR COLLIMATION" 475 listWave[5][2] = V_getNumberOfGuides(fname) 476 477 listWave[6][1] = "distance (source aperture to GV) [cm]" 478 listWave[6][2] = num2str(V_getSourceAp_distance(fname)) 479 480 listWave[7][1] = "source aperture size [mm]" 481 listWave[7][2] = V_getSourceAp_size(fname) 482 483 listWave[8][1] = "sample aperture size (internal) [mm]" 484 listWave[8][2] = V_getSampleAp_size(fname) 485 486 listWave[9][1] = "sample aperture(2) SHAPE (external)" 487 listWave[9][2] = V_getSampleAp2_shape(fname) 488 489 listWave[10][1] = "sample aperture(2) diam (external) [cm]" 490 listWave[10][2] = num2str(V_getSampleAp2_size(fname)) 491 492 listWave[11][1] = "sample aperture(2) height (external) [cm]" 493 listWave[11][2] = num2str(V_getSampleAp2_height(fname)) 494 495 listWave[12][1] = "sample aperture(2) width (external) [cm]" 496 listWave[12][2] = num2str(V_getSampleAp2_width(fname)) 497 498 listWave[13][1] = "beam stop diameter (Middle) [mm]" 499 // listWave[13][2] = num2str(V_getBeamStopC2_size(fname)) 500 listWave[13][2] = num2str(V_DeduceBeamstopDiameter(fname,"MR")) 501 502 listWave[14][1] = "beam stop diameter (Back) [mm]" 503 // listWave[14][2] = num2str(V_getBeamStopC3_size(fname)) 504 listWave[14][2] = num2str(V_DeduceBeamstopDiameter(fname,"B")) 505 506 listWave[15][1] = "sample aperture(2) to gate valve [cm]" 507 listWave[15][2] = num2str(V_getSampleAp2_distance(fname)) 508 509 listWave[16][1] = "sample to gate valve [cm]" 510 listWave[16][2] = num2str(V_getSampleTableOffset(fname)) 499 511 500 512 … … 537 549 String detStr = S_value 538 550 539 listWave[0][1] = "beam_center_x (cm)"551 listWave[0][1] = "beam_center_x [cm]" 540 552 listWave[0][2] = num2str(V_getDet_Beam_center_x(fname,detStr)) 541 553 542 listWave[1][1] = "beam_center_y (cm)"554 listWave[1][1] = "beam_center_y [cm]" 543 555 listWave[1][2] = num2str(V_getDet_Beam_center_y(fname,detStr)) 544 556 545 listWave[2][1] = "distance (nominal) (cm)"557 listWave[2][1] = "distance (nominal) [cm]" 546 558 listWave[2][2] = num2str(V_getDet_NominalDistance(fname,detStr)) 547 559 … … 549 561 listWave[3][2] = num2str(V_getDet_IntegratedCount(fname,detStr)) 550 562 551 listWave[4][1] = "pixel_fwhm_x (cm)"563 listWave[4][1] = "pixel_fwhm_x [cm]" 552 564 listWave[4][2] = num2str(V_getDet_pixel_fwhm_x(fname,detStr)) 553 565 554 listWave[5][1] = "pixel_fwhm_y (cm)"566 listWave[5][1] = "pixel_fwhm_y [cm]" 555 567 listWave[5][2] = num2str(V_getDet_pixel_fwhm_y(fname,detStr)) 556 568 … … 561 573 listWave[7][2] = num2str(V_getDet_pixel_num_y(fname,detStr)) 562 574 563 listWave[8][1] = "setback (cm)"575 listWave[8][1] = "setback [cm]" 564 576 listWave[8][2] = num2str(V_getDet_TBSetback(fname,detStr)) 565 577 566 578 if(cmpstr(detStr,"B") == 0 ||cmpstr(detStr,"FR") == 0 || cmpstr(detStr,"FL") == 0 || cmpstr(detStr,"MR") == 0 || cmpstr(detStr,"ML") == 0) 567 listWave[9][1] = "lateral_offset (cm)" // "B" detector drops here579 listWave[9][1] = "lateral_offset [cm]" // "B" detector drops here 568 580 listWave[9][2] = num2str(V_getDet_LateralOffset(fname,detStr)) 569 581 else 570 listWave[9][1] = "vertical_offset (cm)"582 listWave[9][1] = "vertical_offset [cm]" 571 583 listWave[9][2] = num2str(V_getDet_VerticalOffset(fname,detStr)) 572 584 endif 573 585 574 listWave[10][1] = "x_pixel_size (mm)"586 listWave[10][1] = "x_pixel_size [mm]" 575 587 listWave[10][2] = num2str(V_getDet_x_pixel_size(fname,detStr)) 576 588 577 listWave[11][1] = "y_pixel_size (mm)"589 listWave[11][1] = "y_pixel_size [mm]" 578 590 listWave[11][2] = num2str(V_getDet_y_pixel_size(fname,detStr)) 579 591 … … 1255 1267 err = V_writeWavelength_spread(fname,val) 1256 1268 endif 1257 1258 if ((selWave[5][0] & 2^4) != 0) //"distance (source aperture)" 1259 val = str2num(listWave[5][2]) 1269 1270 if ((selWave[5][0] & 2^4) != 0) //"number of guides (a string value)" 1271 str = listWave[5][2] 1272 err = V_writeNumberOfGuides(fname,str) 1273 endif 1274 1275 if ((selWave[6][0] & 2^4) != 0) //"distance (source aperture)" 1276 val = str2num(listWave[6][2]) 1260 1277 err = V_writeSourceAp_distance(fname,val) 1261 1278 endif 1262 1279 1263 if ((selWave[ 6][0] & 2^4) != 0) //"source aperture size (mm)" (a string with units)1264 str = listWave[ 6][2]1280 if ((selWave[7][0] & 2^4) != 0) //"source aperture size [mm]" (a string with units) 1281 str = listWave[7][2] 1265 1282 err = V_writeSourceAp_size(fname,str) 1266 1283 endif 1267 1284 1268 if ((selWave[ 7][0] & 2^4) != 0) //"sample aperture size (internal) (mm)" (a string with units)1269 str = listWave[ 7][2]1285 if ((selWave[8][0] & 2^4) != 0) //"sample aperture size (internal) [mm]" (a string with units) 1286 str = listWave[8][2] 1270 1287 err = V_writeSampleAp_size(fname,str) 1271 1288 endif 1272 1273 if ((selWave[8][0] & 2^4) != 0) //"sample aperture diam (external) (cm)" 1274 val = str2num(listWave[8][2]) 1289 1290 if ((selWave[9][0] & 2^4) != 0) //"sample aperture SHAPE (external) [cm]" 1291 str = listWave[9][2] 1292 err = V_writeSampleAp2_shape(fname,str) 1293 endif 1294 1295 if ((selWave[10][0] & 2^4) != 0) //"sample aperture diam (external) [cm]" 1296 val = str2num(listWave[10][2]) 1275 1297 err = V_writeSampleAp2_size(fname,val) 1276 1298 endif 1277 1278 if ((selWave[9][0] & 2^4) != 0) //"beam stop diameter (Middle) (mm)" 1279 val = str2num(listWave[9][2]) 1299 1300 if ((selWave[11][0] & 2^4) != 0) //"sample aperture height (external) [cm]" 1301 val = str2num(listWave[11][2]) 1302 err = V_writeSampleAp2_height(fname,val) 1303 endif 1304 1305 if ((selWave[12][0] & 2^4) != 0) //"sample aperture width (external) [cm]" 1306 val = str2num(listWave[12][2]) 1307 err = V_writeSampleAp2_width(fname,val) 1308 endif 1309 1310 if ((selWave[13][0] & 2^4) != 0) //"beam stop diameter (Middle) [mm]" 1311 val = str2num(listWave[13][2]) 1280 1312 err = V_writeBeamStopC2_size(fname,val) 1281 1313 endif 1282 1314 1283 if ((selWave[1 0][0] & 2^4) != 0) //"beam stop diameter (Back) (mm)"1284 val = str2num(listWave[1 0][2])1315 if ((selWave[14][0] & 2^4) != 0) //"beam stop diameter (Back) [mm]" 1316 val = str2num(listWave[14][2]) 1285 1317 err = V_writeBeamStopC3_size(fname,val) 1286 1318 endif 1287 1319 1288 if ((selWave[1 1][0] & 2^4) != 0) //"sample aperture to gate valve (cm)"1289 val = str2num(listWave[1 1][2])1320 if ((selWave[15][0] & 2^4) != 0) //"sample aperture to gate valve [cm]" 1321 val = str2num(listWave[15][2]) 1290 1322 err = V_writeSampleAp_distance(fname,val) 1291 1323 endif 1292 1324 1293 if ((selWave[1 2][0] & 2^4) != 0) //"sample to gate valve (cm)"1294 val = str2num(listWave[1 2][2])1325 if ((selWave[16][0] & 2^4) != 0) //"sample to gate valve [cm]" 1326 val = str2num(listWave[16][2]) 1295 1327 err = V_writeSampleTableOffset(fname,val) 1296 1328 endif … … 2342 2374 DrawText 21,258,"Write to all files (inlcusive)" 2343 2375 SetDrawEnv fsize= 14,fstyle= 1 2344 DrawText 262,30,"Beam Center (cm)"2376 DrawText 262,30,"Beam Center [cm]" 2345 2377 DrawText 20,133,"Run Number(s)" 2346 2378 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf
r1147 r1150 1350 1350 // Prompt autoPlot,"Plot the averaged Data?",popup,"Yes;No" 1351 1351 Prompt side,"Include detector halves?",popup,"both;right;left" 1352 Prompt phi,"Orientation Angle ( 0,359) degrees (Rectangular or Sector)"1353 Prompt dphi, "Sector range (+/-) degrees (0, 45) (Sector only)"1352 Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular or Sector)" 1353 Prompt dphi, "Sector range (+/-) degrees (0,90) (Sector only)" 1354 1354 // Prompt width, "Width of Rectangular average (1,128)" 1355 1355 Prompt binType,"Binning Type?",popup,ksBinTypeStr -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_RAW_Data_Panel.ipf
r1146 r1150 181 181 182 182 Button button_sensor,pos={607,146+33},size={70,20},proc=V_SensorButtonProc,title="Sensors" 183 Button button_mask,pos={689,146+33},size={70,20},proc=V_AvgMaskButtonProc,title="Avg Mask" 183 184 184 185 … … 820 821 End 821 822 822 823 // 824 // opens up the graph of the masking options 825 // 826 Function V_AvgMaskButtonProc(ba) : ButtonControl 827 STRUCT WMButtonAction &ba 828 829 switch( ba.eventCode ) 830 case 2: // mouse up 831 // click code here 832 Execute "V_Display_Four_Panels()" 833 break 834 case -1: // control being killed 835 break 836 endswitch 837 838 return 0 839 End 823 840 824 841 // See V_Detector_Isolate.ipf
Note: See TracChangeset
for help on using the changeset viewer.