#pragma TextEncoding = "MacRoman" // For details execute DisplayHelpTopic "The TextEncoding Pragma" #pragma rtGlobals=3 // Use modern global access method and strict wave access. // // Operation does no scaling, only the basic (default) trim of the ends, concatenate, sort, and save // -- if data has been converted to WORK and the solid angle correction was done, then the data // is per unit solid angle, and matches up - at least the simulated data does... // It should match up in real VSANS data since the flux conditions are identical for // all panels, only the geometry is different. // // // V_DataPlotting.ipf is where the I(q) panel is drawn and the binning is set // // see the VCALC BinAllMiddlePanels() for an example of this // see the binning routines in VC_DetectorBinning_Utils.ipf for the details // // TODO // // -- verify the binning for slit mode. Looks correct, but verify // -- DOCUMENT // // x- detector "B" is currently skipped since the calibration waves are not faked // when the raw data is loaded. Then the qxqyqz waves are not generated. // // x- REDO the logic here. It's a mess, and will get the calculation wrong // // x- figure out the binning type (where is it set for VSANS?) // x- don't know, so currently VSANS binning type is HARD-WIRED // x- figure out when this needs to be called to (force) re-calculate I vs Q // // // NOTE // this is the master conversion function // ***Use no others // *** When other bin types are developed, DO NOT reassign these numbers. // instead, skip the old numbers and assign new ones. // // - the numbers here in the switch can be out of order - it's fine // // old modes can be removed from the string constant ksBinTypeStr(n) (in V_Initialize.ipf), but the // mode numbers are what many different binning, plotting, and reduction functions are // switching on. In the future, it may be necessary to change the key (everywhere) to a string // switch, but for now, stick with the numbers. // // Strconstant ksBinTypeStr = "F4-M4-B;F2-M2-B;F1-M1-B;F2-M1-B;F1-M2xTB-B;F2-M2xTB-B;SLIT-F2-M2-B;" // // Function V_BinTypeStr2Num(binStr) String binStr Variable binType strswitch(binStr) // string switch case "F4-M4-B": binType = 1 break // exit from switch case "F2-M2-B": binType = 2 break // exit from switch case "F1-M1-B": binType = 3 break // exit from switch case "SLIT-F2-M2-B": binType = 4 break // exit from switch case "F2-M1-B": binType = 5 break case "F1-M2xTB-B": binType = 6 break case "F2-M2xTB-B": binType = 7 break default: // optional default expression executed binType = 0 Abort "Binning mode not found"// when no case matches endswitch return(binType) end // // TODO -- binType == 4 (slit mode) should never end up here // -- new logic in calling routines to dispatch to proper routine // -- AND need to write the routine for binning_SlitMode // Function V_QBinAllPanels_Circular(folderStr,binType) String folderStr Variable binType // do the back, middle, and front separately // figure out the binning type (where is it set?) Variable ii,delQ String detStr // binType = V_GetBinningPopMode() // set delta Q for binning (used later inside VC_fDoBinning_QxQy2D) for(ii=0;ii= 0) return(1) else return(0) endif End