Changeset 80 for sans/SANSReduction/branches
- Timestamp:
- Apr 10, 2007 12:40:42 PM (16 years ago)
- Location:
- sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/AvgGraphics.ipf
r76 r80 348 348 DoWindow/F SANS_Data 349 349 if(V_flag ==0) 350 Abort "No SANS data. Use LoadSANSDatato display a 2D data file"350 Abort "No SANS data. Use'Display Raw Data' to display a 2D data file" 351 351 Endif 352 352 SetDrawLayer/K UserFront -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/MainPanel.ipf
r76 r80 30 30 String ctrlName 31 31 32 LoadSANSData() 32 LoadRawSANSData("Select a Raw SANS data file") 33 UpdateDisplayInformation("RAW") 33 34 End 34 35 -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_DataReadWrite.ipf
r75 r80 20 20 21 21 //simple, main entry procedure that will load a RAW sans data file (not a work file) 22 //into the RAW dataFolder 23 //(typically called from main panel button) 24 // 25 Proc LoadSANSData() 26 String msgStr = "Select a SANS data file" 27 28 Variable err 29 err = ReadBinarySANS(msgStr) //will prompt for file 30 //ignore the error here 31 End 32 33 34 //function called by the main entry procedure 35 //sets global display variable, reads in the data, and displays it 36 //displays alert, and returns error if no file was selected 37 // 38 // calling routine must decide whether to abort the execution or not... 39 Function ReadBinarySANS(msgStr) 22 //into the RAW dataFolder. It is up to the calling procedure to display the file 23 // 24 // called by MainPanel.ipf and ProtocolAsPanel.ipf 25 // 26 Function LoadRawSANSData(msgStr) 40 27 String msgStr 41 28 … … 46 33 PathInfo/S catPathName //should set the next dialog to the proper path... 47 34 //get the filename, then read it in 48 filename = PromptForPath(msgStr) 35 filename = PromptForPath(msgStr) //in SANS_Utils.ipf 49 36 //check for cancel from dialog 50 37 if(strlen(filename)==0) … … 57 44 ReadHeaderAndData(filename) //this is the full Path+file 58 45 59 //the calling macro must change the display type 60 String/G root:myGlobals:gDataDisplayType="RAW" //displayed data type is raw 61 62 //data is displayed here 63 fRawWindowHook() 46 ///***** done by a call to UpdateDisplayInformation() 47 // //the calling macro must change the display type 48 // String/G root:myGlobals:gDataDisplayType="RAW" //displayed data type is raw 49 // 50 // //data is displayed here 51 // fRawWindowHook() 64 52 65 53 Return(0) 66 54 End 55 67 56 68 57 //function that does the guts of reading the binary data file … … 74 63 //header information is put into three wave, integers,reals, and text 75 64 //logicals in the header are currently skipped, since they are no use in the 76 //data reduction process. the logicals, however are left untouched. 65 //data reduction process. 66 // 67 // detector data is loaded into an array named "data" 68 // 69 // called by multiple ipfs (when the file name is known) 77 70 // 78 71 Function ReadHeaderAndData(fname) … … 344 337 345 338 //set the globals to the detector dimensions (pixels) 346 Variable/G root:myGlobals:gNPixelsX=128 //default for Ordela data (also set in Initialize .ipf)339 Variable/G root:myGlobals:gNPixelsX=128 //default for Ordela data (also set in Initialize/NCNR_Utils.ipf) 347 340 Variable/G root:myGlobals:gNPixelsY=128 348 341 // if(cmpstr(textW[9],"ILL ")==0) //override if OLD Cerca data … … 368 361 //the input array (in) is larger than 16384 369 362 //(out) is 128x128 data (single precision) as defined in ReadHeaderAndData() 363 // 364 // local function to post-process compressed VAX binary data 365 // 370 366 // 371 367 Function SkipAndDecompressVAX(in,out) … … 400 396 // little consequence. If you have individual pixel values on the detector that are that large, you need 401 397 // to re-think your experiment. 398 // 399 // local function to post-process compressed VAX binary data 400 // 401 // 402 402 Function Decompress(val) 403 403 Variable val … … 424 424 //data is deposited in root:DIV data folder 425 425 // 426 // local, currently unused 427 // 428 // 426 429 Proc ReadWork_DIV() 427 430 // Silent 1 … … 453 456 //this error seems to not be severe, but shoud be corrected (at great pain) 454 457 //************ 458 // 459 // called from ProtocolAsPanel.ipf 460 // 455 461 // 456 462 Function ReadHeaderAndWork(type,fname) … … 811 817 //returns 1 if there was an error 812 818 // 813 // assumes a square detector819 // called by WorkFileUtils.ipf 814 820 // 815 821 Function ReadASCData(fname,destPath) … … 825 831 Variable/G :gIsLogScale=0 826 832 Make/O/T/N=(numHdrLines) hdrLines 827 Make/O/D/N=( num*num) data//,linear_data833 Make/O/D/N=(pixelsX*pixelsY) data //,linear_data 828 834 829 835 //full filename and path is now passed in... … … 855 861 Wave/Z temp0=temp0 856 862 data=temp0 857 Redimension/N=(pixelsX,pixelsY) data //,linear_data863 Redimension/N=(pixelsX,pixelsY) data //,linear_data 858 864 859 865 //linear_data = data … … 868 874 869 875 // fills the "default" fake header so that the SANS Reduction machinery does not have to be altered 870 // pay attention to what is/not to be trusted due to "fake" information 876 // pay attention to what is/not to be trusted due to "fake" information. 877 // uses what it can from the header lines from the ASC file (hdrLines wave) 871 878 // 872 879 // destFolder is of the form "myGlobals:WorkMath:AAA" 880 // 881 // 882 // called by WorkFileUtils.ipf 873 883 // 874 884 Function FillFakeHeader_ASC(destFolder) … … 949 959 950 960 951 952 953 954 955 ////testing procedure that is not called anymore and is out-of-date956 ////with the new data structures. update before re-implementing957 //Proc ReadBinaryWork() //this procedure is not called anymore958 //959 //// Silent 1960 //961 // //make sure the globals are reset properly962 // Variable/G root:myGlobals:gIsLogScale=0 //image is linearly scaled to begin with963 // String/G root:myGlobals:gDataDisplayType="RAW" //displayed data type is raw964 //965 // //each routine is responsible for checking the current (displayed) data folder966 // //selecting it, and returning to root when done967 //968 // ReadHeaderAndWork()969 //970 // SetDataFolder root:RAW971 // //data is displayed here972 // Display;AppendImage data973 //974 //// Silent 0975 //976 // //data folder was changed from root in this macro977 // SetDataFolder root:978 //End979 980 981 //982 983 984 985 961 /////***************** 986 962 ////unused testing procedure for writing a 4 byte floating point value in VAX format -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/ProtocolAsPanel.ipf
r76 r80 1481 1481 do 1482 1482 if((cmpstr(samStr,"ask") == 0) || (cmpstr(samStr,"")==0) ) //zero if strings are equal 1483 err = ReadBinarySANS(msgStr) //will prompt for file1483 err = LoadRawSANSData(msgStr) //will prompt for file 1484 1484 if(err) 1485 1485 PathInfo/S catPathName … … 1491 1491 DoAlert 1,"Do you want to add another Sample file?" 1492 1492 if(V_flag == 1) //yes 1493 err = ReadBinarySANS(msgStr) //will prompt for file1493 err = LoadRawSANSData(msgStr) //will prompt for file 1494 1494 if(err) 1495 1495 PathInfo/S catPathName … … 1528 1528 do 1529 1529 if(cmpstr(prot[0],"ask") == 0) //zero if strings are equal 1530 err = ReadBinarySANS(msgStr) //will prompt for file1530 err = LoadRawSANSData(msgStr) //will prompt for file 1531 1531 if(err) 1532 1532 PathInfo/S catPathName … … 1538 1538 DoAlert 1,"Do you want to add another Background file?" 1539 1539 if(V_flag == 1) //yes 1540 err = ReadBinarySANS(msgStr) //will prompt for file1540 err = LoadRawSANSData(msgStr) //will prompt for file 1541 1541 if(err) 1542 1542 PathInfo/S catPathName … … 1579 1579 do 1580 1580 if(cmpstr(prot[1],"ask") == 0) 1581 err = ReadBinarySANS(msgStr) //will prompt for file1581 err = LoadRawSANSData(msgStr) //will prompt for file 1582 1582 if(err) 1583 1583 PathInfo/S catPathName … … 1589 1589 DoAlert 1,"Do you want to add another Empty Cell file?" 1590 1590 if(V_flag == 1) //yes 1591 err = ReadBinarySANS(msgStr) //will prompt for file1591 err = LoadRawSANSData(msgStr) //will prompt for file 1592 1592 if(err) 1593 1593 PathInfo/S catPathName … … 1974 1974 //ask for file and read it into RAW 1975 1975 //will cancel if no file is selected 1976 err = ReadBinarySANS("select the empty beam file") //reads and displays the RAW data1976 err = LoadRawSANSData("select the empty beam file") //reads and displays the RAW data 1977 1977 if(err) 1978 1978 PathInfo/S catPathName
Note: See TracChangeset
for help on using the changeset viewer.