Changeset 865


Ignore:
Timestamp:
Feb 27, 2020 9:23:25 PM (3 years ago)
Author:
ilavsky
Message:

Beta version of 12ID-B support in Nika. Few minor changes. Needs work.

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Igor Procedures/Boot Indra2.ipf

    r855 r865  
    3737
    3838//*************************************************************************\
    39 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     39//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    4040//* This file is distributed subject to a Software License Agreement found
    4141//* in the file LICENSE that is included with this distribution.
  • trunk/User Procedures/Indra 2/IN2_GeneralProcedures.ipf

    r859 r865  
    3030// 
    3131//*************************************************************************\
    32 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     32//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    3333//* This file is distributed subject to a Software License Agreement found
    3434//* in the file LICENSE that is included with this distribution.
  • trunk/User Procedures/Nika/NI1_BeamCenterUtils.ipf

    r836 r865  
    55Constant NI1BCversionNumber = 2.25
    66//*************************************************************************\
    7 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     7//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    88//* This file is distributed subject to a Software License Agreement found
    99//* in the file LICENSE that is included with this distribution.
  • trunk/User Procedures/Nika/NI1_ConvProc.ipf

    r843 r865  
    66
    77//*************************************************************************\
    8 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     8//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    99//* This file is distributed subject to a Software License Agreement found
    1010//* in the file LICENSE that is included with this distribution.
     
    12911291        NoteStr = ReplaceStringByKey("SampleToCCDDistance", NoteStr, num2str(SampleToCCDDistance), "=", ";")
    12921292        NoteStr = ReplaceStringByKey("Wavelength", NoteStr, num2str(Wavelength), "=", ";")
    1293 //      NoteStr+="BeamCenterX="+num2str(BeamCenterX)+";"
    1294 //      NoteStr+="BeamCenterY="+num2str(BeamCenterY)+";"
    1295 //      NoteStr+="PixelSizeX="+num2str(PixelSizeX)+";"
    1296 //      NoteStr+="PixelSizeY="+num2str(PixelSizeY)+";"
    1297 //      NoteStr+="HorizontalTilt="+num2str(HorizontalTilt)+";"
    1298 //      NoteStr+="VerticalTilt="+num2str(VerticalTilt)+";"
    1299 //      NoteStr+="SampleToCCDDistance="+num2str(SampleToCCDDistance)+";"
    1300 //      NoteStr+="Wavelength="+num2str(Wavelength)+";" 
    13011293        note/K Q2DWave, NoteStr
    13021294        setDataFolder OldDf
  • trunk/User Procedures/Nika/NI1_DNDCATsupport.ipf

    r794 r865  
    66
    77//*************************************************************************\
    8 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     8//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    99//* This file is distributed subject to a Software License Agreement found
    1010//* in the file LICENSE that is included with this distribution.
  • trunk/User Procedures/Nika/NI1_FileLoaders.ipf

    r844 r865  
    11#pragma TextEncoding = "UTF-8"
    22#pragma rtGlobals=3             // Use modern global access method.
    3 //#pragma rtGlobals=1           // Use modern global access method.
    4 #pragma version=2.51
     3#pragma version=2.52
    54
    65//*************************************************************************\
    7 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     6//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    87//* This file is distributed subject to a Software License Agreement found
    98//* in the file LICENSE that is included with this distribution.
    109//*************************************************************************/
    1110
     11//2.52 added 12ID-B tiff files, these are tiff files with associated metadata file. Location based on folder structure.
    1212//2.51 added passing through NXMetadata, NXSample, NXInstrument, NXUser
    1313//2.50 removed mar345 support. Let's see if someone complains.
     
    9797        NVAR UseCalib2DData=root:Packages:Convert2Dto1D:UseCalib2DData
    9898
    99         if(cmpstr(FileType,".tif")==0 || cmpstr(FileType,"tiff")==0)
     99        if(stringmatch(FileType,".tif") || stringmatch(FileType,"tiff") || stringmatch(FileType,"12IDB_tif"))
    100100                FileNameToLoad= FileName
    101101                if(cmpstr(FileName[strlen(FileName)-4,inf],".tif")!=0&&cmpstr(FileName[strlen(FileName)-5,inf],".tiff")!=0)
     
    110110                NewNote+="DataFileName="+FileNameToLoad+";"
    111111                NewNote+="DataFileType="+".tif"+";"
     112                if(stringmatch(FileType,"12IDB_tif"))
     113                        string AddOnNOte
     114                        AddOnNOte = NI1_12IDBLoadMetadata(FileNameToLoad, LoadedWvHere)
     115                        NewNote+=AddOnNOte+";"
     116                endif           
     117
    112118        elseif(cmpstr(FileType,"EQSANS400x400")==0)
    113119                FileNameToLoad= FileName
     
    723729                elseif(stringmatch(FileNameToLoad, "*.tiff" )&&(PilskipBytes>0))
    724730                        testLine = ReplaceString("\n", testLine, "")
    725         print testline         
    726731                        testLine = ReplaceString("#", testLine, ";")
    727732                        testLine = ReplaceString(":", testLine, "=")
  • trunk/User Procedures/Nika/NI1_InstrumentSupport.ipf

    r782 r865  
    55
    66//*************************************************************************\
    7 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     7//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    88//* This file is distributed subject to a Software License Agreement found
    99//* in the file LICENSE that is included with this distribution.
     
    18041804//*******************************************************************************************************************************************
    18051805//*******************************************************************************************************************************************
     1806
     1807//*******************************************************************************************************************************************
     1808//*******************************************************************************************************************************************
     1809//              APS 12ID-B camera SAXS and WAXS (not test for PE yet)
     1810
     1811Function NI1_12IDBLoadAndSetup()
     1812        //this is function to setup data reduction for APS 12ID-B station using SAXS and WAXS detectors
     1813        //uses 12IDB_tif file type
     1814       
     1815        string OldDFf=GetDataFolder(1)
     1816        //first initialize
     1817        KillWindow/Z CCDImageToConvertFig
     1818        NI1A_Convert2Dto1DMainPanel()
     1819        NI1BC_InitCreateBmCntrFile()
     1820        NI1_12IDBHowTo()
     1821        //setup configuration hwo this will be dome here:
     1822        NVAR UseSampleTransmission = root:Packages:Convert2Dto1D:UseSampleTransmission
     1823        NVAR UseSampleThickness = root:Packages:Convert2Dto1D:UseSampleThickness
     1824        NVAR UseEmptyField = root:Packages:Convert2Dto1D:UseEmptyField
     1825        NVAR UseI0ToCalibrate = root:Packages:Convert2Dto1D:UseI0ToCalibrate
     1826
     1827        NVAR DoGeometryCorrection = root:Packages:Convert2Dto1D:DoGeometryCorrection
     1828        NVAR UseMonitorForEf = root:Packages:Convert2Dto1D:UseMonitorForEf
     1829        NVAR UseSampleTransmFnct = root:Packages:Convert2Dto1D:UseSampleTransmFnct
     1830        NVAR UseSampleThicknFnct = root:Packages:Convert2Dto1D:UseSampleThicknFnct
     1831        NVAR UseSampleMonitorFnct = root:Packages:Convert2Dto1D:UseSampleMonitorFnct
     1832        NVAR UseEmptyMonitorFnct = root:Packages:Convert2Dto1D:UseEmptyMonitorFnct
     1833        NVAR UseMonitorForEF=root:Packages:Convert2Dto1D:UseMonitorForEF
     1834        NVAR XrayEnergy = root:Packages:Convert2Dto1D:XrayEnergy
     1835        NVAR Wavelength = root:Packages:Convert2Dto1D:Wavelength
     1836        NVAR PixelSizeX = root:Packages:Convert2Dto1D:PixelSizeX
     1837        NVAR PixelSizeY = root:Packages:Convert2Dto1D:PixelSizeY
     1838        NVAR SampleToCCDdistance = root:Packages:Convert2Dto1D:SampleToCCDdistance
     1839        NVAR BeamCenterX = root:Packages:Convert2Dto1D:BeamCenterX
     1840        NVAR BeamCenterY = root:Packages:Convert2Dto1D:BeamCenterY
     1841       
     1842        UseSampleTransmission = 1
     1843        UseSampleThickness = 0
     1844        UseEmptyField = 1
     1845        UseI0ToCalibrate = 1
     1846        DoGeometryCorrection = 1
     1847        UseMonitorForEf = 1
     1848
     1849        UseSampleThicknFnct  =1
     1850        UseSampleTransmFnct = 1
     1851//      UseSampleThicknFnct =1
     1852        UseSampleMonitorFnct = 1
     1853        UseEmptyMonitorFnct = 1
     1854        SVAR SampleTransmFnct = root:Packages:Convert2Dto1D:SampleTransmFnct
     1855        SVAR SampleThicknFnct = root:Packages:Convert2Dto1D:SampleThicknFnct
     1856        SVAR SampleMonitorFnct = root:Packages:Convert2Dto1D:SampleMonitorFnct
     1857        SVAR EmptyMonitorFnct = root:Packages:Convert2Dto1D:EmptyMonitorFnct
     1858       
     1859        SampleTransmFnct = "NI1_12IDBGetTranmsission"
     1860        SampleMonitorFnct = "NI1_12IDBGetSampleI0"
     1861        EmptyMonitorFnct = "NI1_12IDBGetEmptyI0"
     1862
     1863        setDataFOlder root:Packages:Convert2Dto1D:
     1864        NI1A_ButtonProc("Select2DDataPath")
     1865        PathInfo Convert2Dto1DDataPath
     1866        string DataFilePath=S_path
     1867        NewPath/Q/O Convert2Dto1DEmptyDarkPath, S_path 
     1868        SVAR DataFileExtension=root:Packages:Convert2Dto1D:DataFileExtension
     1869        //select the right ytpe of data
     1870        DataFileExtension = "12IDB_tif"
     1871        PopupMenu Select2DDataType win=NI1A_Convert2Dto1DPanel, popmatch= "12IDB_tif"
     1872        //now load mask...
     1873        NI1_12IDBLoadGoodPixMask()                      //TODO: Check this for WAXS mask also... 
     1874
     1875
     1876        //send user to Empty/Dark tab
     1877        TabControl Convert2Dto1DTab win=NI1A_Convert2Dto1DPanel, value=3
     1878        NI1A_TabProc("NI1A_Convert2Dto1DPanel",3)       
     1879        setDataFolder OldDFf
     1880
     1881end
     1882
     1883
     1884//*******************************************************************************************************************************************
     1885//*******************************************************************************************************************************************
     1886//*******************************************************************************************************************************************
     1887//*******************************************************************************************************************************************
     1888
     1889//*******************************************************************************************************************************************
     1890//*******************************************************************************************************************************************
     1891Function NI1_12IDBGetTranmsission(fileName)
     1892        string fileName
     1893
     1894        wave/Z CCDImageToConvert = root:Packages:Convert2Dto1D:CCDImageToConvert
     1895        wave/Z EmptyData = root:Packages:Convert2Dto1D:EmptyData
     1896        if(!WaveExists(CCDImageToConvert) || !WaveExists(EmptyData))
     1897                abort "Needed Images do not exist. Load Sample and Emty data before going further"
     1898        endif
     1899        string sampleNote=note(CCDImageToConvert)
     1900        sampleNote = ReplaceString(" ", sampleNote, "")
     1901        string emptyNote=note(EmptyData)
     1902        emptyNote = ReplaceString(" ", emptyNote, "")
     1903        variable SampleBeamStopDiode=NumberByKey("Photodiode", sampleNote , ":" , ";")
     1904        variable EmptyBeamStopDiode=NumberByKey("Photodiode", emptyNote , ":" , ";")
     1905        variable SampleBeamStopI0=NumberByKey("I0", sampleNote , ":" , ";")
     1906        variable EmptyBeamStopI0=NumberByKey("I0", emptyNote , ":" , ";")
     1907        variable transmission = (SampleBeamStopDiode/SampleBeamStopI0)/(EmptyBeamStopDiode/EmptyBeamStopI0)
     1908        print "Found transmission = "+num2str(transmission)
     1909        return transmission
     1910end
     1911//*******************************************************************************************************************************************
     1912
     1913Function NI1_12IDBGetSampleI0(fileName)
     1914        string fileName
     1915        wave/Z CCDImageToConvert = root:Packages:Convert2Dto1D:CCDImageToConvert
     1916        //wave/Z EmptyData = root:Packages:Convert2Dto1D:EmptyData
     1917        if(!WaveExists(CCDImageToConvert))// || !WaveExists(EmptyData))
     1918                abort "Needed Image do not exist. Load Sample data before going further"
     1919        endif
     1920        string sampleNote=note(CCDImageToConvert)
     1921        sampleNote = ReplaceString(" ", sampleNote, "")
     1922        //string emptyNote=note(EmptyData)
     1923        //emptyNote = ReplaceString(" ", emptyNote, "")
     1924        //variable SampleBeamStopDiode=NumberByKey("Photodiode", sampleNote , ":" , ";")
     1925        //variable EmptyBeamStopDiode=NumberByKey("Photodiode", emptyNote , ":" , ";")
     1926        variable SampleBeamStopI0=NumberByKey("I0", sampleNote , ":" , ";")
     1927        //variable EmptyBeamStopI0=NumberByKey("I0", emptyNote , ":" , ";")
     1928        //variable I0Normalized = (SampleBeamStopDiode/SampleBeamStopI0)//(EmptyBeamStopDiode/EmptyBeamStopI0)
     1929        print "Found Sample I0 = "+num2str(SampleBeamStopI0)
     1930        return SampleBeamStopI0
     1931end
     1932//*******************************************************************************************************************************************
     1933Function NI1_12IDBGetEmptyI0(fileName)
     1934        string fileName
     1935        //wave/Z CCDImageToConvert = root:Packages:Convert2Dto1D:CCDImageToConvert
     1936        wave/Z EmptyData = root:Packages:Convert2Dto1D:EmptyData
     1937        if(!WaveExists(EmptyData))// || !WaveExists(EmptyData))
     1938                abort "Needed Image do not exist. Load Empty data before going further"
     1939        endif
     1940        //string sampleNote=note(CCDImageToConvert)
     1941        //sampleNote = ReplaceString(" ", sampleNote, "")
     1942        string emptyNote=note(EmptyData)
     1943        emptyNote = ReplaceString(" ", emptyNote, "")
     1944        //variable SampleBeamStopDiode=NumberByKey("Photodiode", sampleNote , ":" , ";")
     1945        //variable EmptyBeamStopDiode=NumberByKey("Photodiode", emptyNote , ":" , ";")
     1946        //variable SampleBeamStopI0=NumberByKey("I0", sampleNote , ":" , ";")
     1947        variable EmptyBeamStopI0=NumberByKey("I0", emptyNote , ":" , ";")
     1948        //variable I0Normalized = (EmptyBeamStopDiode/EmptyBeamStopI0)//(EmptyBeamStopDiode/EmptyBeamStopI0)
     1949        print "Found Empty I0 = "+num2str(EmptyBeamStopI0)
     1950        return EmptyBeamStopI0
     1951end
     1952
     1953//*******************************************************************************************************************************************
     1954//*******************************************************************************************************************************************
     1955
     1956//*******************************************************************************************************************************************
     1957//*******************************************************************************************************************************************
     1958Function/S NI1_12IDBLoadMetadata(FileNameToLoad, LoadedWvHere)         
     1959        string FileNameToLoad
     1960        wave LoadedWvHere
     1961       
     1962        //get the path to Slogs now, it is one level up and inside the log folder
     1963        PathInfo Convert2Dto1DDataPath
     1964        string DataFilePath=S_path
     1965        string UsingWhat=StringFromList(ItemsInList(DataFilePath,":")-1, DataFilePath,":")
     1966        string LogPathStr= RemoveFromList(UsingWhat, DataFilePath,":")+"log"
     1967        NewPath/O/Q/Z LogFilesPath, LogPathStr
     1968        string LogFileName="L"+FileNameToLoad[1,inf]
     1969        LogFileName = ReplaceString("tif", LogFileName, "meta")
     1970        if(StringMatch(FileNameToLoad[0], "S" ))
     1971                usingWhat = "SAXS"
     1972        elseif(StringMatch(FileNameToLoad[0], "W" ))
     1973                usingWhat = "WAXS"
     1974        elseif(StringMatch(FileNameToLoad[0], "P" ))
     1975                usingWhat = "PE"
     1976                abort "Do not know what to do with PE detectors yet. Fix me"
     1977        else
     1978                abort "Unknown type of data used, fix me first"
     1979        endif
     1980        variable refNum, err
     1981        string OneLineStr, MetadataString="", newWaveNOte=""
     1982        open/R/T="????"/P=LogFilesPath/Z refNum as LogFileName
     1983        if(V_flag!=0)
     1984                close refNum
     1985                Abort "Metadata import failed"
     1986        else            //open succesful
     1987                Do
     1988                        FreadLine refNum,OneLineStr
     1989                        if(strlen(OneLineStr)<=0)
     1990                                //break
     1991                                err=1
     1992                        endif
     1993                        MetadataString+=OneLineStr+";"
     1994                while(err==0)
     1995                Close refNum
     1996        endif
     1997        MetadataString = ReplaceString("%", MetadataString, "")
     1998        MetadataString = ReplaceString("\n", MetadataString, "")
     1999        MetadataString = ReplaceString("\r", MetadataString, "")
     2000        //MetadataString = ReplaceString(" ", MetadataString, "")
     2001        newWaveNOte = NI1_12IDBProcessMetadata(usingWhat, MetadataString, LoadedWvHere)
     2002        return newWaveNote
     2003end
     2004
     2005//*******************************************************************************************************************************************
     2006//*******************************************************************************************************************************************
     2007
     2008Function/S NI1_12IDBProcessMetadata(which, MetadataString, LoadedWvHere)
     2009        string which, MetadataString
     2010        wave LoadedWvHere
     2011
     2012        //parse this string ad do what is needed...
     2013        string NewWaveNote=""
     2014        string currentItemString
     2015        variable i, maxItems, includeMe
     2016        maxItems=ItemsInList(MetadataString,";")
     2017        includeMe = 1
     2018        i = 0
     2019        //read firtst part...
     2020        do
     2021                        currentItemString=StringFromList(i, MetadataString, ";")
     2022                        i+=1
     2023                        NewWaveNote+=currentItemString+";"
     2024        while(!StringMatch(currentItemString, "SAXS Detector"))
     2025        // now read SAXS part, if needed...
     2026        do
     2027                currentItemString=StringFromList(i, MetadataString, ";")
     2028                i+=1
     2029                if(StringMatch(which, "SAXS"))
     2030                        //process the line as needed
     2031                        NI1_12IDBProcessLine(currentItemString, LoadedWvHere)
     2032                        NewWaveNote+=currentItemString+";"
     2033                endif
     2034        while(!StringMatch(currentItemString, "WAXS Detector"))
     2035        do
     2036                currentItemString=StringFromList(i, MetadataString, ";")
     2037                i+=1
     2038                if(StringMatch(which, "WAXS"))
     2039                        //process the line as needed
     2040                        NI1_12IDBProcessLine(currentItemString, LoadedWvHere)
     2041                        NewWaveNote+=currentItemString+";"
     2042                endif
     2043        while(!StringMatch(currentItemString, "*Setup information*"))
     2044        do
     2045                currentItemString=StringFromList(i, MetadataString, ";")
     2046                i+=1
     2047                //process the line as needed
     2048                NI1_12IDBProcessLine(currentItemString, LoadedWvHere)
     2049                NewWaveNote+=currentItemString+";"
     2050        while(i<maxItems)       
     2051        print NewWaveNote
     2052        return NewWaveNote
     2053end
     2054
     2055//*******************************************************************************************************************************************
     2056//*******************************************************************************************************************************************
     2057Function NI1_12IDBProcessLine(LineToProcess, LoadedWvHere)
     2058        string LineToProcess
     2059        wave LoadedWvHere
     2060       
     2061        LineToProcess=ReplaceString(" ", LineToProcess, "")+";"
     2062        if(StringMatch(LineToProcess, "*PixelSize(mm)*" ))
     2063                NVAR PixelSizeX = root:Packages:Convert2Dto1D:PixelSizeX
     2064                NVAR PixelSizeY = root:Packages:Convert2Dto1D:PixelSizeY
     2065                PixelSizeX = NumberByKey("PixelSize(mm)", LineToProcess, ":", ";")
     2066                PixelSizeY = NumberByKey("PixelSize(mm)", LineToProcess, ":", ";")
     2067        endif
     2068        if(StringMatch(LineToProcess, "*Sample-to-detectorDistance(mm)*" ))
     2069                NVAR SampleToCCDdistance = root:Packages:Convert2Dto1D:SampleToCCDdistance
     2070                SampleToCCDdistance = NumberByKey("Sample-to-detectorDistance(mm)", LineToProcess, ":", ";")
     2071        endif
     2072        if(StringMatch(LineToProcess, "*BeamCenterX*" ))
     2073                NVAR BeamCenterX = root:Packages:Convert2Dto1D:BeamCenterX
     2074                BeamCenterX = NumberByKey("BeamCenterX", LineToProcess, ":", ";")
     2075        endif
     2076        if(StringMatch(LineToProcess, "*BeamCenterY*" ))
     2077                NVAR BeamCenterY = root:Packages:Convert2Dto1D:BeamCenterY
     2078                //Again, THIS IS INVERTED...
     2079                variable DimYSize=DimSize(LoadedWvHere, 1 )
     2080                BeamCenterY = DimYSize - NumberByKey("BeamCenterY", LineToProcess, ":", ";")           
     2081        endif
     2082        if(StringMatch(LineToProcess, "*X-rayEnergy(keV)*" ))
     2083                NVAR XrayEnergy = root:Packages:Convert2Dto1D:XrayEnergy
     2084                NVAR Wavelength = root:Packages:Convert2Dto1D:Wavelength
     2085                XrayEnergy = NumberByKey("X-rayEnergy(keV)", LineToProcess, ":", ";")
     2086                Wavelength = 12.39842/XrayEnergy
     2087        endif
     2088        if(StringMatch(LineToProcess, "*TiltAnglePitch(degree)*" ))
     2089                NVAR VerticalTilt = root:Packages:Convert2Dto1D:VerticalTilt
     2090                //Again, THIS IS INVERTED...
     2091                VerticalTilt = -1* NumberByKey("TiltAnglePitch(degree)", LineToProcess, ":", ";")               
     2092        endif
     2093end
     2094//*******************************************************************************************************************************************
     2095//*******************************************************************************************************************************************
     2096Function NI1_12IDBLoadGoodPixMask()                     //todo: some error handling...
     2097                //should be able to find mask in current working folder
     2098        string OldDFf=GetDataFolder(1)
     2099        setDataFOlder root:Packages:Convert2Dto1D:
     2100        //get the path to SAXS_mask2M.bmp or WAXS_mask2M.bpm, it is one level up...
     2101        PathInfo Convert2Dto1DDataPath
     2102        string DataFilePath=S_path
     2103        string UsingWhat=StringFromList(ItemsInList(DataFilePath,":")-1, DataFilePath,":")
     2104        string MaskPathStr= RemoveFromList(UsingWhat, DataFilePath,":")
     2105        //ImageLoad/P=TempMaskPath/T=bmp/Q (UsingWhat+"_mask2M.bmp")
     2106        ImageLoad/T=bmp/Q/N=TMPBMPMask/Z MaskPathStr+UsingWhat+"_mask2M.bmp"
     2107        if(V_Flag)
     2108                print ":Loaded succesfully mask file from "+MaskPathStr+UsingWhat+"_mask2M.bmp"
     2109        else
     2110                DoALert/T="Could not load Mask file" 0, "Could not load expected SAXS/WAXS_mask2M.bmp file with mask, you need to create mask manually"
     2111                return 0
     2112        endif
     2113        Wave LoadedmaskImage = TMPBMPMask
     2114        ImageTransform rgb2gray LoadedmaskImage
     2115        Wave M_RGB2Gray
     2116        //ImageTransform flipRows M_RGB2Gray
     2117        ImageTransform flipCols M_RGB2Gray                      //this is correct flip needed...
     2118        DoWIndow CCDImageToConvertFig
     2119        Wave M_ROIMask
     2120        if(V_Flag)
     2121                RemoveImage/W=CCDImageToConvertFig/Z  M_ROIMask
     2122        endif
     2123        KillWaves/Z M_ROIMask, TMPBMPMask
     2124        wavestats/Q M_RGB2Gray
     2125        M_RGB2Gray/=V_max                               //normalize to be 1 or 0, seem to be 255
     2126        Rename M_RGB2Gray, M_ROIMask
     2127        setDataFolder OldDFf   
     2128        return 1
     2129end
     2130//*******************************************************************************************************************************************
     2131//*******************************************************************************************************************************************
     2132
     2133Function NI1_12IDBHowTo()
     2134       
     2135        doWIndow APS12IDB_Instructions
     2136        if(V_Flag)
     2137                DoWIndow/F APS12IDB_Instructions
     2138        else
     2139        String nb = "APS12IDB_Instructions"
     2140        NewNotebook/N=$nb/F=1/V=1/K=1/ENCG={1,1}/W=(1532,45,2246,823) as "APS12IDB_Instructions"
     2141        Notebook $nb defaultTab=36, magnification=125
     2142        Notebook $nb showRuler=1, rulerUnits=2, updating={1, 1}
     2143        Notebook $nb newRuler=Normal, justification=0, margins={0,0,468}, spacing={0,0,0}, tabs={}, rulerDefaults={"Helvetica",11,0,(0,0,0)}
     2144        Notebook $nb newRuler=Title, justification=0, margins={0,0,468}, spacing={0,0,0}, tabs={}, rulerDefaults={"Geneva",12,3,(0,0,0)}
     2145        Notebook $nb ruler=Title, text="Instructions for use of APS 12IDC special configuration\r"
     2146        Notebook $nb ruler=Normal, text="\r"
     2147        Notebook $nb text="\r"
     2148        Notebook $nb text="1. Find path to your tif images\r"
     2149        Notebook $nb text="\r"
     2150        Notebook $nb text="2. Mask and all configuration and calibration shoudl be read from meta files with metadata for each file"
     2151        Notebook $nb text=" automatically. \r"
     2152        Notebook $nb text="\r"
     2153        Notebook $nb text="This needs a lot more testing!!!! \r"
     2154        Notebook $nb text="\r"
     2155        Notebook $nb text="\r"
     2156        Notebook $nb text="\r"
     2157        Notebook $nb text="Jan Ilavsky, 2/27/2020\r"
     2158        Notebook $nb text="\r"
     2159        Notebook $nb fStyle=2, text="Hint: watch history area for notes on what Nika has found and done. \r"
     2160        endif
     2161end
     2162
     2163//*******************************************************************************************************************************************
     2164//                      end of 12ID-B camera support.
  • trunk/User Procedures/Nika/NI1_LineProfile.ipf

    r827 r865  
    55
    66//*************************************************************************\
    7 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     7//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    88//* This file is distributed subject to a Software License Agreement found
    99//* in the file LICENSE that is included with this distribution.
  • trunk/User Procedures/Nika/NI1_Main.ipf

    r858 r865  
    1111constant NikaNumberOfQCirclesDisp=15
    1212//*************************************************************************\
    13 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     13//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    1414//* This file is distributed subject to a Software License Agreement found
    1515//* in the file LICENSE that is included with this distribution.
     
    103103                "APS 12ID-C SAXS with Gold Detector", NI1_12IDCLoadAndSetup()
    104104                help={"Support for data from APS 12ID-C camera"}
     105                "APS 12ID-B SAXS-WAXS ", NI1_12IDBLoadAndSetup()
     106                help={"Support for data from APS 12ID-B camera"}               
    105107                "DND CAT", NI1_DNDConfigureNika()
    106108                help={"Support for data from DND CAT (5ID) beamline at APS"}
  • trunk/User Procedures/Nika/NI1_MainPanel.ipf

    r843 r865  
    22#pragma rtGlobals=3             // Use modern global access method.
    33//#pragma rtGlobals=1           // Use modern global access method.
    4 #pragma version=2.68
     4#pragma version=2.69
    55Constant NI1AversionNumber = 2.67
    66
    77//*************************************************************************\
    8 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     8//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    99//* This file is distributed subject to a Software License Agreement found
    1010//* in the file LICENSE that is included with this distribution.
    1111//*************************************************************************/
    1212
     13//2.69 added 12ID-B tiff file which is tiff file combined with metadata log file.
    1314//2.68 added passing through NXMetadata, NXSample, NXInstrument, NXUser
    1415//2.67 Fixed case when user set ASCII name for output - apprently this was broken forever...
     
    228229
    229230        //internal loaders
    230         string/g ListOfKnownExtensions=".tif;GeneralBinary;Pilatus;Nexus;BrukerCCD;MarCCD;mpa;mp/bin;BSRC/Gold;DND/txt;RIGK/Raxis;ADSC;ADSC_A;WinView spe (Princeton);ASCII;ibw;BSL/SAXS;BSL/WAXS;ascii512x512;ascii128x128;ESRFedf;"
     231        string/g ListOfKnownExtensions=".tif;GeneralBinary;Pilatus;Nexus;BrukerCCD;MarCCD;mpa;mp/bin;BSRC/Gold;12IDB_tif;DND/txt;RIGK/Raxis;ADSC;ADSC_A;WinView spe (Princeton);ASCII;ibw;BSL/SAXS;BSL/WAXS;ascii512x512;ascii128x128;ESRFedf;"
    231232        ListOfKnownExtensions+="SSRLMatSAXS;TPA/XML;Fuji/img;mpa/UC;FITS;.hdf;GE binary;---;"//mpa/bin;mpa/asc;mp/bin;mp/asc
    232233//#if(Exists("ccp4unpack"))     
  • trunk/User Procedures/Nika/NI1_SaveRecallConfig.ipf

    r750 r865  
    55
    66//*************************************************************************\
    7 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     7//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    88//* This file is distributed subject to a Software License Agreement found
    99//* in the file LICENSE that is included with this distribution.
  • trunk/User Procedures/Nika/NI1_SquareMatrix.ipf

    r798 r865  
    55
    66//*************************************************************************\
    7 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     7//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    88//* This file is distributed subject to a Software License Agreement found
    99//* in the file LICENSE that is included with this distribution.
  • trunk/User Procedures/Nika/NI1_USAXSSupport.ipf

    r846 r865  
    44
    55//*************************************************************************\
    6 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     6//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    77//* This file is distributed subject to a Software License Agreement found
    88//* in the file LICENSE that is included with this distribution.
  • trunk/User Procedures/Nika/NI1_loader.ipf

    r854 r865  
    66
    77//*************************************************************************\
    8 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     8//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    99//* This file is distributed subject to a Software License Agreement found
    1010//* in the file LICENSE that is included with this distribution.
  • trunk/User Procedures/Nika/NI1_mask.ipf

    r811 r865  
    66
    77//*************************************************************************\
    8 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     8//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    99//* This file is distributed subject to a Software License Agreement found
    1010//* in the file LICENSE that is included with this distribution.
     
    432432                DoWindow/F CCDImageForMask
    433433        endif
     434//      if( CmpStr(ctrlName,"EditExistingROI") == 0 )
     435//              ShowTools/W=CCDImageForMask/A rect
     436//              SetDrawLayer/W=CCDImageForMask ProgFront
     437//              Wave w= $NI1M_GetImageWave("CCDImageForMask")           // the target matrix
     438//              String iminfo= ImageInfo("CCDImageForMask", NameOfWave(w), 0)
     439//              String xax= StringByKey("XAXIS",iminfo)
     440//              String yax= StringByKey("YAXIS",iminfo)
     441//              SetDrawEnv/W=CCDImageForMask linefgc= (3,52428,1),fillpat= 5,fillfgc= (0,0,0),xcoord=$xax,ycoord=$yax,save
     442//              DoWindow/F  CCDImageForMask
     443//              AutoPositionWindow/M=0 /R=NI1M_ImageROIPanel CCDImageForMask
     444//              GetWindow CCDImageForMask wsize
     445//              //print V_left, V_top, V_right, V_bottom
     446//              MoveWindow/W=CCDImageForMask V_left+33, V_top, V_right+33, V_bottom
     447//              DoWindow/F CCDImageForMask
     448//      endif
    434449        if( CmpStr(ctrlName,"FinishROI") == 0 )
    435450                GraphNormal/W=CCDImageForMask
  • trunk/User Procedures/Nika/NI1_pix2Dsensitivity.ipf

    r811 r865  
    55
    66//*************************************************************************\
    7 //* Copyright (c) 2005 - 2019, Argonne National Laboratory
     7//* Copyright (c) 2005 - 2020, Argonne National Laboratory
    88//* This file is distributed subject to a Software License Agreement found
    99//* in the file LICENSE that is included with this distribution.
Note: See TracChangeset for help on using the changeset viewer.