Changeset 39


Ignore:
Timestamp:
Apr 29, 2013 9:25:43 PM (9 years ago)
Author:
ilavsky
Message:

Indra 3 update to version 1.79 which can handle USAXS pin diode transmissions and Irena Plotting tool 1 contour plot adition

Location:
trunk
Files:
18 edited

Legend:

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

    r21 r39  
    11#pragma rtGlobals=1             // Use modern global access method.
    2 #pragma version=1.78
     2#pragma version=1.79
    33
     4//1.79 added ability to read pinDiode Transmission measured first during 4/2013
    45//1.78 added weight calibration
    56//1.77 Use I0 and I00 ranges now included in spec files.
  • trunk/User Procedures/CanSAS/cansasXML.ipf

    r6 r39  
    1 #pragma rtGlobals=1             // Use modern global access method.
    2 #pragma version=1.11
    3 #pragma IgorVersion=6.1
    4 
    5 // taken from smallangles.net on 02 APR 2010
    6 // changed Function/T to Function/S on (unused) TrimWS functions
     1#pragma rtGlobals=1             // rtGlobals=3 requires IgorPro 6.3+
     2#pragma version=1.12
    73
    84// file:        cansasXML.ipf
     
    139// SVN ID:      $Id$
    1410// purpose:  implement an IgorPro file reader to read the canSAS 1-D reduced SAS data in XML files
    15 //                      adheres to the cansas1d/1.0 standard
    16 // readme:    http://www.smallangles.net/wgwiki/index.php/cansas1d_binding_IgorPro
    17 // URL: http://www.smallangles.net/wgwiki/index.php/cansas1d_documentation
     11//                      adhering to either the cansas1d/1.0 or cansas1d/1.1 standards
     12// readme:    http://www.cansas.org/formats/canSAS1d/1.1/doc/binding-igorpro.html
     13// URL: http://www.cansas.org/formats/canSAS1d/1.1/doc/
    1814//
    1915// requires:    IgorPro (http://www.wavemetrics.com/)
    2016//                              XMLutils - XOP (http://www.igorexchange.com/project/XMLutils)
    21 // provides:  CS_CmlReader(String fileName)
     17// provides:  CS_XmlReader(String fileName)
    2218//                              all other functions in this file should not be relied upon
    23 
    24 // ==================================================================
    25 // CS_XmlReader("bimodal-test1.xml")
    26 // CS_XmlReader("1998spheres.xml")
    27 // CS_XmlReader("xg009036_001.xml")
    28 // CS_XmlReader("s81-polyurea.xml")
    29 // CS_XmlReader("cs_af1410.xml")
     19//
     20// Copyright (c) 2013, UChicago Argonne, LLC
     21// This file is distributed subject to a Software License Agreement found
     22// in the file LICENSE that is included with this distribution.
     23
     24
     25//  ================  ================  =================  ==========
     26//  #pragma version   canSAS1d version  namespace          released
     27//  ================  ================  =================  ==========
     28//  1.12              v1.1              urn:cansas1d:1.1   2013-04-01
     29//  1.11              v1.0              cansas1d/1.0       2009-09-25
     30//  ================  ================  =================  ==========
     31
     32
     33// ==================================================================
     34// CS_XmlReader("../examples/bimodal-test1.xml")
     35// CS_XmlReader("../examples/1998spheres.xml")
     36// CS_XmlReader("../examples/xg009036_001.xml")
     37// CS_XmlReader("../examples/s81-polyurea.xml")
     38// CS_XmlReader("../examples/cs_af1410.xml")
    3039//  testCollette();  prjTest_cansas1d()
    3140// ==================================================================
    3241
    3342
    34 #if( Exists("XmlOpenFile") )
     43#if( ! Exists("XmlOpenFile") )
    3544        // BEFORE we do anything else, check that XMLutils XOP is available.
    36 
     45        // No XMLutils XOP: provide dummy function so that IgorPro can compile dependent support code
     46
     47        FUNCTION CS_XmlReader(fileName)
     48            String fileName
     49                String msg
     50                msg = "XML function provided by XMLutils XOP is not available,"
     51                msg += " get the XOP from : http://www.igorexchange.com/project/XMLutils"
     52                msg += " (see http://www.cansas.org/formats/canSAS1d/1.1/doc/binding-igorpro.html for details)"
     53            Abort  msg
     54            RETURN(-6)
     55        END
     56
     57#else   // if( Exists("XmlOpenFile") )
    3758
    3859FUNCTION CS_XmlReader(fileName)
     
    4364        //              -1: XML file not found
    4465        //              -2: root element is not <SASroot> with valid canSAS namespace
    45         //              -3: <SASroot> version  is not 1.0
     66        //              -3: <SASroot> version  is not 1.0 or 1.1
    4667        //              -4: no <SASentry> elements
    4768        //              -5: XMLutils XOP needs upgrade
     
    115136        STRSWITCH(ns)   
    116137        CASE "cansas1d/1.0":                                                    // version 1.0 of the canSAS 1-D reduced SAS data standard
    117 //              PRINT fileName, "\t\t identified as: cansas1d/1.0 XML file"
     138        CASE "urn:cansas1d:1.1":                                                // version 1.1 of the canSAS 1-D reduced SAS data standard
     139                PRINT fileName, "\t\t identified as: " + ns + " XML file"
    118140                returnCode = CS_1i_parseXml(fileID)                     //  This is where the action happens!
    119141                IF (returnCode != 0)
     
    154176        STRING ns = "", thisLocation
    155177        VARIABLE i, item
    156         MAKE/T/N=(1)/O nsList           // list of all possible namespaces
     178        MAKE/T/N=(2)/O nsList           // list of all possible namespaces
    157179        nsList[0] = "cansas1d/1.0"              // first version of canSAS 1-D reduced SAS
     180        nsList[1] = "urn:cansas1d:1.1"  // second version of canSAS 1-D reduced SAS
    158181
    159182        FOR (item = 0; item < DimSize(nsList, 0); item += 1)            // loop over all possible namespaces
     
    236259                        ENDFOR
    237260                ENDIF
     261
     262                // TODO: process any transmission spectra
     263                STRING/G ns = CS_getDefaultNamespace(fileID)
     264                IF (cmpstr(ns,  "urn:cansas1d:1.1") == 0)
     265                        XmlListXpath(fileID, SASentryPath + "//cs:SAStransmission_spectrum", nsStr)
     266                        WAVE/T  M_listXPath
     267                        print "Searching for SAStransmission_spectrum groups"
     268                        print DimSize(M_listXPath, 0) , M_listXPath
     269                        // ...
     270                ENDIF
     271               
    238272                KillWaves/Z M_listXPath
    239273        ENDFOR
     
    613647                TitlePath = ""
    614648        ENDIF
    615 //      PRINT "\t Title:", Title
     649        PRINT "\t Title:", Title
    616650        RETURN(Title)
    617651END
     
    649683// ==================================================================
    650684
    651 Function/S   TrimWS(str)
     685Function/T   TrimWS(str)
    652686    // TrimWhiteSpace (code from Jon Tischler)
    653687    String str
     
    657691// ==================================================================
    658692
    659 Function/S   TrimWSL(str)
     693Function/T   TrimWSL(str)
    660694    // TrimWhiteSpaceLeft (code from Jon Tischler)
    661695    String str
     
    668702// ==================================================================
    669703
    670 Function/S   TrimWSR(str)
     704Function/T   TrimWSR(str)
    671705    // TrimWhiteSpaceRight (code from Jon Tischler)
    672706    String str
     
    714748        fList = AddListItem("elmo.xml",                                 fList, ";", Inf)                // non-existent file
    715749        fList = AddListItem("cansasXML.ipf",                    fList, ";", Inf)                // this file (should fail on XML parsing)
    716         fList = AddListItem("book.xml",                                 fList, ";", Inf)                // good XML example file but not canSAS, not even close
    717         fList = AddListItem("bimodal-test1.xml",                fList, ";", Inf)                // simple dataset
    718         fList = AddListItem("bimodal-test2-vector.xml", fList, ";", Inf)                // version 2.0 file (no standard yet)
    719         fList = AddListItem("test.xml",                                 fList, ";", Inf)                // cs_collagen.xml with no namespace
    720         fList = AddListItem("test2.xml",                                fList, ";", Inf)                // version 2.0 file (no standard yet)
    721         fList = AddListItem("ISIS_SANS_Example.xml",    fList, ";", Inf)                // from S. King, 2008-03-17
    722         fList = AddListItem("W1W2.xml",                                 fList, ";", Inf)                // from S. King, 2008-03-17
    723         fList = AddListItem("ill_sasxml_example.xml",   fList, ";", Inf)                // from canSAS 2007 meeting, reformatted
    724         fList = AddListItem("isis_sasxml_example.xml",  fList, ";", Inf)                // from canSAS 2007 meeting, reformatted
    725         fList = AddListItem("r586.xml",                                         fList, ";", Inf)                // from canSAS 2007 meeting, reformatted
    726         fList = AddListItem("r597.xml",                                         fList, ";", Inf)                // from canSAS 2007 meeting, reformatted
    727         fList = AddListItem("xg009036_001.xml",                 fList, ";", Inf)                // foreign elements with other namespaces
    728         fList = AddListItem("cs_collagen.xml",                  fList, ";", Inf)                // another simple dataset, bare minimum info
    729         fList = AddListItem("cs_collagen_full.xml",             fList, ";", Inf)                // more Q range than previous
    730         fList = AddListItem("cs_af1410.xml",                    fList, ";", Inf)                // multiple SASentry and SASdata elements
    731         fList = AddListItem("cansas1d-template.xml",    fList, ";", Inf)                // multiple SASentry and SASdata elements
    732         fList = AddListItem("1998spheres.xml",                  fList, ";", Inf)                // 2 SASentry, few thousand data points each
    733         fList = AddListItem("does-not-exist-file.xml",          fList, ";", Inf)                // non-existent file
    734         fList = AddListItem("cs_rr_polymers.xml",               fList, ";", Inf)                // Round Robin polymer samples from John Barnes @ NIST
    735         fList = AddListItem("s81-polyurea.xml",                         fList, ";", Inf)                // polyurea from APS/USAXS/Indra (with extra metadata)
     750        fList = AddListItem("../examples/book.xml",                             fList, ";", Inf)                // good XML example file but not canSAS, not even close
     751        fList = AddListItem("../examples/bimodal-test1.xml",            fList, ";", Inf)                // simple dataset
     752        fList = AddListItem("../examples/testers/test3.xml",                                    fList, ";", Inf)                // no number provided for wavelength, others, too
     753        fList = AddListItem("../examples/ISIS_SANS_Example.xml",        fList, ";", Inf)                // from S. King, 2008-03-17
     754        fList = AddListItem("../examples/W1W2.xml",                             fList, ";", Inf)                // from S. King, 2008-03-17
     755        fList = AddListItem("../examples/ill_sasxml_example.xml",       fList, ";", Inf)                // from canSAS 2007 meeting, reformatted
     756        fList = AddListItem("../examples/isis_sasxml_example.xml",      fList, ";", Inf)                // from canSAS 2007 meeting, reformatted
     757        fList = AddListItem("../examples/r586.xml",                                     fList, ";", Inf)                // from canSAS 2007 meeting, reformatted
     758        fList = AddListItem("../examples/r597.xml",                                     fList, ";", Inf)                // from canSAS 2007 meeting, reformatted
     759        fList = AddListItem("../examples/xg009036_001.xml",             fList, ";", Inf)                // foreign elements with other namespaces
     760        fList = AddListItem("../examples/cs_collagen.xml",                      fList, ";", Inf)                // another simple dataset, bare minimum info
     761        fList = AddListItem("../examples/cs_collagen_full.xml",                 fList, ";", Inf)                // more Q range than previous
     762        fList = AddListItem("../examples/cs_af1410.xml",                        fList, ";", Inf)                // multiple SASentry and SASdata elements
     763        fList = AddListItem("../examples/cs_rr_polymers.xml",           fList, ";", Inf)                // Round Robin polymer samples from John Barnes @ NIST
     764        fList = AddListItem("../examples/cansas1d-template.xml",        fList, ";", Inf)                // multiple SASentry and SASdata elements
     765        fList = AddListItem("../examples/1998spheres.xml",                      fList, ";", Inf)                // 2 SASentry, few thousand data points each
     766        fList = AddListItem("../examples/does-not-exist-file.xml",              fList, ";", Inf)                // non-existent file
     767        fList = AddListItem("../examples/s81-polyurea.xml",                     fList, ";", Inf)                // polyurea from APS/USAXS/Indra (with extra metadata)
     768        fList = AddListItem("../examples/GLASSYC_C4G8G9_w_TL.xml",                      fList, ";", Inf)                // from S. King, with transmission spectra
    736769       
    737770        // try to load each data set in the table
     
    759792        // 3.   Loading actual data from LOQ caused some problems.
    760793        //      Data created by Colette names files with run number.
    761         //      When entering full path to load the data if you use "\example\31531.X" Igor will read \3 as a character.
    762         //      A simple fix which has worked for this is to use / instead of \ e.g. "\example/31531.X".
     794        //      When entering full path to load the data if you use "
     795\example\31531.X" Igor will read \3 as a character.
     796        //      A simple fix which has worked for this is to use / instead of \ e.g. "
     797\example/31531.X".
    763798       
    764799        //4.    Once data is loaded in Igor it is relatively easy to work with but would be nicer if the SASdata
     
    769804        //Say, for Run=31531, then Qsas_31531
    770805
    771         CS_XmlReader("W1W2.XML")
     806        CS_XmlReader("../examples/W1W2.XML")
    772807        STRING srcDir = "root:Packages:CS_XMLreader"
    773808        STRING destDir = "root", importFolder, target
  • trunk/User Procedures/Indra 2/IN2_USAXS.ipf

    r21 r39  
    11#pragma rtGlobals=1             // Use modern global access method.
    22#pragma IgorVersion=6.2 //requires Igor version 4 or higher
    3 #pragma version = 1.30
    4 
     3#pragma version = 1.31
     4
     5//1.31 added ability to use pinDiode transmission measured first time 4/2013
    56//1.30 added weight calibration
    67//1.29 modified not to fail to compile when XML xop is not present.
     
    133134        SetDrawEnv fsize= 16,textrgb= (16384,28160,65280)
    134135        DrawText 52,64,"@ Jan Ilavsky, 2012"
    135         DrawText 49,103,"release 1.78 from 4/8/2013"
     136        DrawText 49,103,"release 1.79 from 4/23/2013"
    136137        DrawText 11,136,"To get help please contact: ilavsky@aps.anl.gov"
    137138        DrawText 11,156,"http://usaxs.xor.aps.anl.gov/"
  • trunk/User Procedures/Indra 2/IN3_Calculations.ipf

    r18 r39  
    11#pragma rtGlobals=1             // Use modern global access method.
    2 #pragma version=1.06
    3 
     2#pragma version=1.09
     3
     4//1.09 controsl for few more items displayed on Tab0 with pek-to-peak transmission and MSAXS/pinSAXS correction
     5//1.08 added pin diode transmission
     6//1.07 added (beta version now) measurement of transmission by using diode on front of the A stage
    47//1.06 modified for weight calibration
    58//1.05 FIxed bump to Compiler when no data selected in Data selection popup.
     
    5861                IN3_RecalculateData(4)
    5962                IN3_FitDefaultTop()
     63                IN3_GetDiodeTransmission(0)
    6064                IN3_RecalculateData(1)
    6165                TabControl DataTabs , value= 0, win=USAXSDataReduction
     
    117121end
    118122
     123//***********************************************************************************************************************************
     124//***********************************************************************************************************************************
     125//***********************************************************************************************************************************
     126//***********************************************************************************************************************************
     127
     128Function IN3_GetDiodeTransmission(SkipMessage)
     129        variable SkipMessage
     130        SVAR MeasurementParameters = root:Packages:Indra3:MeasurementParameters
     131        SVAR BlankName = root:Packages:Indra3:BlankName
     132        SVAR BLMeasurementParameters = $(BlankName+"MeasurementParameters")
     133        NVAR SampleTransmissionPeakToPeak = root:Packages:Indra3:SampleTransmissionPeakToPeak
     134        NVAR MSAXSCorrection = root:Packages:Indra3:MSAXSCorrection
     135        NVAR SampleTransmission = root:Packages:Indra3:SampleTransmission
     136        NVAR UsePinTransmission=        root:Packages:Indra3:UsePinTransmission
     137       
     138       
     139        variable USAXSPinT_Measure      =NumberByKey("USAXSPinT_Measure", MeasurementParameters, "=", ";")
     140        variable USAXSPinT_AyPosition   =NumberByKey("USAXSPinT_AyPosition", MeasurementParameters, "=", ";")
     141        variable USAXSPinT_Time         =NumberByKey("USAXSPinT_Time", MeasurementParameters, "=", ";")
     142        variable USAXSPinT_pinCounts    =NumberByKey("USAXSPinT_pinCounts", MeasurementParameters, "=", ";")
     143        variable USAXSPinT_pinGain              =NumberByKey("USAXSPinT_pinGain", MeasurementParameters, "=", ";")
     144        variable USAXSPinT_I0Counts     =NumberByKey("USAXSPinT_I0Counts", MeasurementParameters, "=", ";")
     145        variable USAXSPinT_I0Gain               =NumberByKey("USAXSPinT_I0Gain", MeasurementParameters, "=", ";")
     146
     147        variable BLUSAXSPinT_Measure            =NumberByKey("USAXSPinT_Measure", BLMeasurementParameters, "=", ";")
     148        variable BLUSAXSPinT_AyPosition =NumberByKey("USAXSPinT_AyPosition", BLMeasurementParameters, "=", ";")
     149        variable BLUSAXSPinT_Time                       =NumberByKey("USAXSPinT_Time", BLMeasurementParameters, "=", ";")
     150        variable BLUSAXSPinT_pinCounts          =NumberByKey("USAXSPinT_pinCounts", BLMeasurementParameters, "=", ";")
     151        variable BLUSAXSPinT_pinGain            =NumberByKey("USAXSPinT_pinGain", BLMeasurementParameters, "=", ";")
     152        variable BLUSAXSPinT_I0Counts           =NumberByKey("USAXSPinT_I0Counts", BLMeasurementParameters, "=", ";")
     153        variable BLUSAXSPinT_I0Gain             =NumberByKey("USAXSPinT_I0Gain", BLMeasurementParameters, "=", ";")
     154
     155        NVAR/Z USAXSPinTvalue = root:Packages:Indra3:USAXSPinTvalue
     156        if(!NVAR_Exists(USAXSPinTvalue))
     157                variable/g root:Packages:Indra3:USAXSPinTvalue
     158        endif
     159        USAXSPinTvalue=0
     160        if(USAXSPinT_Measure && BLUSAXSPinT_Measure)
     161                USAXSPinTvalue = ((USAXSPinT_pinCounts/USAXSPinT_pinGain)/(USAXSPinT_I0Counts/USAXSPinT_I0Gain))/((BLUSAXSPinT_pinCounts/BLUSAXSPinT_pinGain)/(BLUSAXSPinT_I0Counts/BLUSAXSPinT_I0Gain))
     162                if(!SkipMessage)
     163                        print "Found pin Diode measured transmission for these measurements = "+num2str(USAXSPinTvalue)
     164                endif
     165                if(UsePinTransmission && USAXSPinTvalue>0)
     166                        MSAXSCorrection = USAXSPinTvalue / SampleTransmissionPeakToPeak
     167                endif
     168        else
     169                UsePinTransmission=0
     170        endif
     171       
     172       
     173end
    119174//***********************************************************************************************************************************
    120175//***********************************************************************************************************************************
     
    491546        NVAR CalibrateToVolume=root:Packages:Indra3:CalibrateToVolume
    492547        NVAR CalibrateArbitrary=root:Packages:Indra3:CalibrateArbitrary
     548        NVAR UsePinTransmission=root:Packages:Indra3:UsePinTransmission
     549        NVAR UseMSAXSCorrection=root:Packages:Indra3:UseMSAXSCorrection
    493550
    494551       
     
    552609       
    553610        if (cmpstr("UseMSAXSCorrection",ctrlName)==0)
     611                IF(checked)
     612                         UsePinTransmission=0
     613                endif
    554614                NI3_TabPanelControl("",4)
     615                //IN3_CalculateMSAXSCorrection()
     616                //IN3_CalculateTransmission(1)
     617                //IN3_CalculateSampleThickness()
     618                IN3_RecalculateData(3)
     619        endif
     620        if (cmpstr("UsePinTransmission",ctrlName)==0)
     621                IF(checked)
     622                         UseMSAXSCorrection=0
     623                endif
     624                NI3_TabPanelControl("",0)
    555625                //IN3_CalculateMSAXSCorrection()
    556626                //IN3_CalculateTransmission(1)
     
    13501420        NVAR CalibrateToVolume=root:Packages:Indra3:CalibrateToVolume
    13511421        NVAR CalibrateArbitrary=root:Packages:Indra3:CalibrateArbitrary
     1422        NVAR UsePinTransmission=root:Packages:Indra3:UsePinTransmission
     1423        NVAR UseMSAXSCorrection=root:Packages:Indra3:UseMSAXSCorrection
    13521424
    13531425        Button RecoverDefault,win=USAXSDataReduction, disable=(tab!=0 || IsBlank)
     
    13561428        CheckBox CalibrateArbitrary,win=USAXSDataReduction, disable=(tab!=0 || IsBlank)
    13571429
     1430        SetVariable USAXSPinTvalue, win=USAXSDataReduction, disable=(tab!=0 || IsBlank)
     1431        CheckBox UsePinTransmission, win=USAXSDataReduction, disable=(tab!=0 || IsBlank)
     1432        SetVariable MSAXSCorrectionT0, win=USAXSDataReduction, disable=(tab!=0 || IsBlank || (!UsePinTransmission && !UseMSAXSCorrection) )
     1433        SetVariable PeakToPeakTransmission, win=USAXSDataReduction, disable=(tab!=0 || IsBlank)
     1434       
    13581435        CheckBox CalculateThickness,win=USAXSDataReduction, disable=(tab!=0 || IsBlank)
    13591436        CheckBox CalculateWeight,win=USAXSDataReduction, disable=(tab!=0 || IsBlank || !CalibrateToWeight )
     
    14031480
    14041481
    1405         NVAR UseMSAXSCorrection=root:Packages:Indra3:UseMSAXSCorrection
    14061482        CheckBox UseMSAXSCorrection,win=USAXSDataReduction, disable=(tab!=4 || IsBlank)
    14071483        //UseMSAXSCorrection
    1408         SetVariable MSAXSCorrection,win=USAXSDataReduction, disable=(tab!=4 || !UseMSAXSCorrection || IsBlank)
     1484        SetVariable MSAXSCorrection,win=USAXSDataReduction, disable=(tab!=4 || !(UseMSAXSCorrection ||UsePinTransmission) || IsBlank)
    14091485        SetVariable MSAXSStartPoint,win=USAXSDataReduction, disable=(tab!=4 || !UseMSAXSCorrection || IsBlank)
    14101486        SetVariable MSAXSEndPoint,win=USAXSDataReduction, disable=(tab!=4 || !UseMSAXSCorrection || IsBlank)
  • trunk/User Procedures/Indra 2/IN3_Main.ipf

    r21 r39  
    11#pragma rtGlobals=1             // Use modern global access method.
    2 #pragma version = 1.78
    3 
     2#pragma version = 1.80
     3
     4//1.80 Added few more items on Tab0
     5//1.79 4/2013 JIL, added pin diode transmission
    46//1.78, 2/2013, JIL: Added option to calibrate by weight. Needed for USAXS users.
    57
     
    6163        ListOfVariables+="CalibrateToWeight;CalibrateToVolume;CalibrateArbitrary;SampleWeightInBeam;CalculateWeight;BeamExposureArea;SampleDensity;"
    6264
    63         ListOfVariables+="BlankWidth;MSAXSCorrection;UseMSAXSCorrection;"
     65        ListOfVariables+="BlankWidth;MSAXSCorrection;UseMSAXSCorrection;UsePinTransmission;USAXSPinTvalue;"
    6466        ListOfVariables+="MSAXSStartPoint;MSAXSEndPoint;BlankFWHM;BlankMaximum;"
    6567
     
    105107        NVAR CalibrateToWeight
    106108        NVAR CalibrateToVolume
     109        NVAR CalibrateArbitrary
    107110        //add check so Volume is default and only 1 is selected.
    108        
     111        if(CalibrateArbitrary+CalibrateToVolume+CalibrateToWeight!=1)
     112                 CalibrateToWeight=0
     113                 CalibrateToVolume=1
     114                 CalibrateArbitrary=0
     115        endif
    109116        setDataFolder OldDf
    110117end
     
    233240        SetVariable SampleFilledFraction,limits={0,Inf,0},variable= root:Packages:Indra3:SampleFilledFraction, noedit=!CalculateThickness, frame=CalculateThickness
    234241
    235         //SetVariable BeamExposureArea,pos={5,435},size={280,22},title="Beam area [mm2]  =", help={"Calculated area of the beam from slit positions, do not change unless it is error"}
    236         //SetVariable BeamExposureArea,font="Times New Roman",fSize=14,proc=IN3_ParametersChanged, bodyWidth=100
    237         //SetVariable BeamExposureArea,limits={0,Inf,0},variable= root:Packages:Indra3:BeamExposureArea, noedit=!CalculateWeight, frame=CalculateWeight
     242        SetVariable USAXSPinTvalue,pos={5,435},size={280,22},title="pinDiode Transmission  =", help={"If exists, measured transmission by pin diode"}
     243        SetVariable USAXSPinTvalue,font="Times New Roman",fSize=14, bodyWidth=100
     244        SetVariable USAXSPinTvalue,limits={0,1,0},variable= root:Packages:Indra3:USAXSPinTvalue, noedit=1, frame=CalculateWeight
     245
     246        CheckBox UsePinTransmission,pos={290,437},size={90,14},proc=IN3_MainPanelCheckBox,title="Use?"//, disable=CalibrateToVolume
     247        CheckBox UsePinTransmission,variable= root:Packages:Indra3:UsePinTransmission, help={"Use pin diode trnamission (if exists)"}
     248
     249        SetVariable PeakToPeakTransmission,pos={5,460},size={300,22},title="Peak-to-Peak T =", frame=0, noedit=1
     250        SetVariable PeakToPeakTransmission,font="Times New Roman",fSize=14, bodyWidth=100
     251        SetVariable PeakToPeakTransmission,limits={0,Inf,0},variable= root:Packages:Indra3:SampleTransmissionPeakToPeak
     252        SetVariable MSAXSCorrectionT0,pos={5,485},size={300,22},title="MSAXS/pinSAXS Cor =", frame=0, noedit=1
     253        SetVariable MSAXSCorrectionT0,font="Times New Roman",fSize=14, bodyWidth=100
     254        SetVariable MSAXSCorrectionT0,limits={0,Inf,0},variable= root:Packages:Indra3:MSAXSCorrection
    238255
    239256
  • trunk/User Procedures/Indra 2/IN3_Rwave.ipf

    r17 r39  
    11#pragma rtGlobals=1             // Use modern global access method.
    2 #pragma version 1.02
    3 
     2#pragma version 1.03
     3
     4//1.03 added pinDiode tranmission
    45//1.02 updated to use   I0AmpGain                       
    56//1.01 updated IN3_calculateRwaveQvec to enable analysis of scans down (as usually) or up (as needed for GIUSAXS)
     
    3132        if(StepFrom<=3 && !IsBlank)
    3233                        // calculate transmission (can be done, we have the data now) and scale the data to it...
    33                 IN3_CalcSampleWeightOrThickness()
     34                //IN3_CalcSampleWeightOrThickness()
    3435        endif
    3536        if(StepFrom<=4 && !IsBlank)
    3637        // subtract sample and Blank to create SMR data...
    3738                IN3_CalculateMSAXSCorrection()
     39                IN3_GetDiodeTransmission(1)
    3840                IN3_CalculateTransmission(1)
    3941                IN3_CalcSampleWeightOrThickness()
  • trunk/User Procedures/Indra 2/IN3_SupportFnct.ipf

    r18 r39  
    11#pragma rtGlobals=1             // Use modern global access method.
    2 #pragma version =1.01
     2#pragma version =1.02
    33
    44//1.01 modified for weight calibration
     5//1.02 added pinDiode tranmsission
    56
    67//***********************************************************************************************************************************
     
    120121        NVAR MSAXSCorrection=root:Packages:Indra3:MSAXSCorrection
    121122        NVAR UseMSAXSCorrection=root:Packages:Indra3:UseMSAXSCorrection
     123        NVAR UsePinTransmission=root:Packages:Indra3:UsePinTransmission
    122124        SVAR FolderName = root:Packages:Indra3:DataFolderName
    123125        if (!DataFolderExists(FolderName ))
     
    131133                endif
    132134                SampleTransmission = SampleTransmissionPeakToPeak
    133                 if(UseMSAXSCorrection)
     135                if(UseMSAXSCorrection||UsePinTransmission)
    134136                        SampleTransmission*=MSAXSCorrection
    135137                endif
     
    355357                NVAR MSAXSCorrection = root:Packages:Indra3:MSAXSCorrection
    356358                NVAR UseMSAXSCorrection = root:Packages:Indra3:UseMSAXSCorrection
     359                NVAR UsePinTransmission = root:Packages:Indra3:UsePinTransmission
     360                NVAR USAXSPinTvalue = root:Packages:Indra3:USAXSPinTvalue
    357361                string USAXSorSBUSAXS
    358362                variable MSAXSCorLocal=1
    359                 if(UseMSAXSCorrection)
     363                if(UseMSAXSCorrection || UsePinTransmission)
    360364                        MSAXSCorLocal = MSAXSCorrection
    361365                endif
     
    401405                        endif
    402406                endif
    403 
    404 //              IN2G_AppendAnyText("Transmission :\t\t"+num2str(SampleTransmission))
    405 //              IN2G_AppendAnyText("SMR data created")
    406 
    407                 USAXSorSBUSAXS="USAXS"
    408                
     407                USAXSorSBUSAXS="USAXS"         
    409408        else
    410409                Duplicate /O R_Int, DSM_Int, logBlankInterp, BlankInterp
     
    491490        NVAR MSAXSCorrection=root:Packages:Indra3:MSAXSCorrection
    492491        NVAR UseMSAXSCorrection=root:Packages:Indra3:UseMSAXSCorrection
     492        NVAR UsePinTransmission=root:Packages:Indra3:UsePinTransmission
     493        NVAR USAXSPinTvalue=root:Packages:Indra3:USAXSPinTvalue
     494
     495
    493496        SVAR ListOfASBParametersL=root:Packages:Indra3:ListOfASBParameters
    494497
     
    621624                endif
    622625               
    623                 if(UseMSAXSCorrection)
     626                if(UseMSAXSCorrection || UsePinTransmission)
    624627                        IN2G_AppendAnyText("MSAXSCorrection :\t\t"+num2str(MSAXSCorrection))
    625628                endif
     
    742745                IN2G_AppendNoteToAllWaves("SampleTransmissionPeakToPeak",num2str(SampleTransmissionPeakToPeak))
    743746                IN2G_AppendNoteToAllWaves("UseMSAXSCorrection",num2str(UseMSAXSCorrection))
    744                 if(UseMSAXSCorrection)
     747                IN2G_AppendNoteToAllWaves("UsePinTransmission",num2str(UsePinTransmission))
     748                if(USAXSPinTvalue>0)
     749                        IN2G_AppendNoteToAllWaves("pinDiodeTransmission",num2str(USAXSPinTvalue))
     750                endif
     751                if(UseMSAXSCorrection||UsePinTransmission)
    745752                        IN2G_AppendNoteToAllWaves("MSAXSCorrection",num2str(MSAXSCorrection))
    746753                else
  • trunk/User Procedures/Indra 2/Readme.txt

    r21 r39  
    99Revision history:
    1010______________________________________________________________________________________
     111.79 4/24/2013
     12Added ability to use pinDIode Transmission for USAXS measured first time in April 2013.
     13
    11141.78 4/8/2013
    1215Added calibration to weight, can calculate weight of sample in the beam, and can use transmission to calculate also thickness of 100% dense sample. Therefore it can use area of the beam with transmission, line absorption coefficient and density of the material for  cm2/g calibration.
  • trunk/User Procedures/Irena/IR1_CreateFldrStrctr.ipf

    r6 r39  
    11#pragma rtGlobals=3             // Use modern global access method.
    2 #pragma version=2.03
     2#pragma version=2.04
    33
    44//*************************************************************************\
     
    88//*************************************************************************/
    99
     10//2.04 minor fix for liberal names users keep using
    1011//2.03 converted to rtGlobals=3
    1112//2.02 removed all font and font size from panel definitions to enable user control
     
    209210                Wave/Z SWave = $SWvname
    210211                if(WaveExists(RWave) && WaveExists(QWave) &&WaveExists(SWave))
    211                         Duplicate /O RWave, $(NewBackupFldr+RWvname)
    212                         Duplicate /O QWave, $(NewBackupFldr+QWvname)
    213                         Duplicate /O SWave, $(NewBackupFldr+SWvname)
     212                        Duplicate /O RWave, $(NewBackupFldr+possiblyquotename(RWvname))
     213                        Duplicate /O QWave, $(NewBackupFldr+possiblyquotename(QWvname))
     214                        Duplicate /O SWave, $(NewBackupFldr+possiblyquotename(SWvname))
    214215                endif
    215216        endfor
  • trunk/User Procedures/Irena/IR1_DataManipulation.ipf

    r17 r39  
    844844                        endif
    845845                        if ((BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1] )!=numpnts(ResultsQ)-1)&&(BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1] )!=-2))
    846                                 TempIntInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)])+1,inf]=Nan
    847                                 TempEInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)])+1,inf]=Nan
     846                                TempIntInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1]), ]=Nan
     847                                TempEInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1]), ]=Nan
    848848                        endif
    849849                        ResultsInt = TempInt1 - TempIntInterp2
  • trunk/User Procedures/Irena/IR1_FormFactors.ipf

    r38 r39  
    1919//2.19 removed algebraic form factor and added Janus Core Shell micelles, added special list of form factor for Size Distribution, which cannot handle complex shapes (and should not)...
    2020//2.20 Added Form and Structure factor description as Igor Help file.
     21//2.21 FIxed Janus FF micelle and added version 3 - core as particle shape
    2122
    2223//this is utility package providing various form factors to be used by Standard model package and Sizes
     
    8485       
    8586        string/g ListOfFormFactors="Spheroid;Cylinder;CylinderAR;CoreShell;CoreShellShell;CoreShellCylinder;User;Integrated_Spheroid;Unified_Sphere;Unified_Rod;Unified_RodAR;Unified_Disk;Unified_Tube;Fractal Aggregate;"
    86         ListOfFormFactors+="NoFF_setTo1;SphereWHSLocMonoSq;Janus CoreShell Micelle 1;Janus CoreShell Micelle 2;"
     87        ListOfFormFactors+="NoFF_setTo1;SphereWHSLocMonoSq;Janus CoreShell Micelle 1;Janus CoreShell Micelle 2;Janus CoreShell Micelle 3;"
    8788        string/g ListOfFormFactorsSD="Spheroid;Cylinder;CylinderAR;CoreShell;CoreShellShell;CoreShellCylinder;User;Integrated_Spheroid;Unified_Sphere;Unified_Rod;Unified_RodAR;Unified_Disk;Unified_Tube;Fractal Aggregate;"
    8889        string/g CoreShellVolumeDefinition
     
    210211                //Janus CoreShell Micelle 2     //particle size here is shell thickness!!!
    211212                //                                                      Core_Size=ParticlePar1                  // Core radius A
     213                //                                                      SolventRho=ParticlePar2         // rho for solvent material
     214                //                                                      CoreRho=ParticlePar3                    // rho for core material
     215                //                                                      Shell1Rho=ParticlePar4                  // rho for shell 1 material
     216                //                                                      Shell2Rho=particlePar5                  // rho for shell 2 material
     217                //Janus CoreShell Micelle 3     //particle size here is core radius!!!
     218                //                                                      Shell_Thickness=ParticlePar1    // Shell Thickness A
    212219                //                                                      SolventRho=ParticlePar2         // rho for solvent material
    213220                //                                                      CoreRho=ParticlePar3                    // rho for core material
     
    521528                                For (i=0;i<N;i+=1)                                                                                      //calculate the G matrix in columns!!!
    522529                                        currentR=R_dist[i]
    523                                         multithread TempWave=IR1T_JanusFF(Q_vec[p], CurrentR, CoreRho, Shell1Rho, Shell2Rho, SolventRho,CurrentR-Shell_Thickness)               //this is already 2nd power and should be normalized by volume
     530                                        multithread TempWave=IR1T_JanusFF(Q_vec[p], CurrentR, CoreRho, Shell1Rho, Shell2Rho, SolventRho,CurrentR-Shell_Thickness)       //this is already ^2
     531                                        TempWave*= IR1T_JanusAveContrast(CurrentR-Shell_Thickness, Shell_Thickness, CoreRho, Shell1Rho, Shell2Rho, SolventRho)          //need to crrect for contrast as the above formula
     532                                        //contians only one delta-rho. Average delta-rho seems to fix this... params: Rcore, RShell, RhoCore, RhoA, RhoB, ShoSolv
    524533                                        multithread TempWave*= IR1T_JanusVp(CurrentR,CoreRho, Shell1Rho, Shell2Rho,CurrentR-Shell_Thickness)^VolumePower                        //scale by volume
    525534                                        Gmatrix[][i]=TempWave[p]                                                                //and here put it into G wave
     
    534543                                For (i=0;i<N;i+=1)                                                                                      //calculate the G matrix in columns!!!
    535544                                        currentR=R_dist[i]
    536                                         multithread TempWave=IR1T_JanusFF(Q_vec[p], Core_Size+CurrentR, CoreRho, Shell1Rho, Shell2Rho, SolventRho,Core_Size)            //this is already 2nd power and should be normalized by volume
     545                                        multithread TempWave=IR1T_JanusFF(Q_vec[p], Core_Size+CurrentR, CoreRho, Shell1Rho, Shell2Rho, SolventRho,Core_Size)    //this is already ^2
     546                                        TempWave*= IR1T_JanusAveContrast(Core_Size, CurrentR, CoreRho, Shell1Rho, Shell2Rho, SolventRho)//Rcore, RShell, RhoCore, RhoA, RhoB, ShoSolv
    537547                                        multithread TempWave*= IR1T_JanusVp(Core_Size+CurrentR,CoreRho, Shell1Rho, Shell2Rho,Core_Size)^VolumePower                     //scale by volume
     548                                        //print IR1T_JanusVp(Core_Size+CurrentR,CoreRho, Shell1Rho, Shell2Rho,Core_Size)
     549                                        //multithread TempWave*= IR1T_SphereVolume(Core_Size+CurrentR)^VolumePower                      //scale by volume
     550                                        Gmatrix[][i]=TempWave[p]                                                                //and here put it into G wave
     551                                endfor
     552                        elseif(cmpstr(ParticleModel,"Janus CoreShell Micelle 3")==0)
     553                                //Janus CoreShell Micelle 3             //particle size here is shell thickness!!!
     554                                Shell_Thickness=ParticlePar1    //Core radius A
     555                                SolventRho=ParticlePar5         // rho for solvent material
     556                                CoreRho=ParticlePar2                    // rho for core material
     557                                Shell1Rho=ParticlePar3                  // rho for shell 1 material
     558                                Shell2Rho=particlePar4                  // rho for shell 2 material                                                                                     
     559                                variable NormVal
     560                                For (i=0;i<N;i+=1)                                                                                      //calculate the G matrix in columns!!!
     561                                        currentR=R_dist[i]
     562                                        NormVal=IR1T_JanusFF(0.00001, CurrentR+Shell_Thickness, CoreRho, Shell1Rho, Shell2Rho, SolventRho,CurrentR)
     563                                        multithread TempWave=IR1T_JanusFF(Q_vec[p], CurrentR+Shell_Thickness, CoreRho, Shell1Rho, Shell2Rho, SolventRho,CurrentR)       //this is already ^2
     564                                        TempWave*= IR1T_JanusAveContrast(CurrentR, Shell_Thickness, CoreRho, Shell1Rho, Shell2Rho, SolventRho)//Rcore, RShell, RhoCore, RhoA, RhoB, ShoSolv
     565                                        multithread TempWave*= IR1T_JanusVp(CurrentR+Shell_Thickness,CoreRho, Shell1Rho, Shell2Rho,CurrentR)^VolumePower                        //scale by volume
     566                                        //print IR1T_JanusVp(Core_Size+CurrentR,CoreRho, Shell1Rho, Shell2Rho,Core_Size)
     567                                        //multithread TempWave*= (IR1T_SphereVolume(CurrentR+Shell_Thickness)^VolumePower)/NormVal                      //scale by volume
    538568                                        Gmatrix[][i]=TempWave[p]                                                                //and here put it into G wave
    539569                                endfor
     
    543573//                              For (i=0;i<N;i+=1)                                                                                      //calculate the G matrix in columns!!!
    544574//                                      currentR=R_dist[i]
    545 //                                      for(j=0;j<numpnts(TempWave);j+=1)                                               //calulate separately TempWave
     575//                                      for(j=0;j<numpnts(TempWave);j+=1)                                               //calculate separately TempWave
    546576//                                              QR = currentR * Q_vec[j]
    547577//                                              QH = Q_vec[j] * AspectRatio * currentR
     
    678708//*****************************************************************************************************************
    679709//*****************************************************************************************************************
    680 
    681 threadsafe Function IR1T_CalcCoreShellShellFFPoints(Qvalue,radius,VolumePower,radiusMin,radiusMax, CoreShell_1_Thickness, CoreShell_2_Thickness,SolventRho,CoreRho, Shell1Rho,Shell2Rho,VolDefL)
     710//
     711threadsafe static Function IR1T_CalcCoreShellShellFFPoints(Qvalue,radius,VolumePower,radiusMin,radiusMax, CoreShell_1_Thickness, CoreShell_2_Thickness,SolventRho,CoreRho, Shell1Rho,Shell2Rho,VolDefL)
    682712        variable Qvalue, radius, radiusMin,radiusMax, CoreShell_1_Thickness, CoreShell_2_Thickness,SolventRho,CoreRho, Shell1Rho,Shell2Rho, VolumePower
    683713        string VolDefL
     
    769799//*****************************************************************************************************************
    770800//*****************************************************************************************************************
    771 //
    772 threadsafe  static Function IR1T_CalculateCoreShellFFPoints(Qvalue,radius,VolumePower,radiusMin,radiusMax, Param1, Param2,Param3,Param4,VolDefL)
     801//static
     802threadsafe  Function IR1T_CalculateCoreShellFFPoints(Qvalue,radius,VolumePower,radiusMin,radiusMax, Param1, Param2,Param3,Param4,VolDefL)
    773803        variable Qvalue, radius, radiusMin,radiusMax, Param1, Param2    ,Param3,Param4,VolumePower                                              //does the math for Sphere Form factor function
    774804        string VolDefL
     
    806836        endFor
    807837        result=result/numbOfSteps                                                                                       //this averages the values obtained over the interval....
    808         result=result*  (Param2 - Param3)                                                                       //this scales to contrast difference between shell and core
    809         //another change, 7/3/2006... To sync with NIST macros... Need to plug in the voluem here again...
    810         //result=result* (IR1_SphereVolume(tempRad))^VolumePower                                                        //multiply by volume of sphere
     838        result=result*(Param2 - Param3)                                                                 //this scales to contrast difference between shell and core
    811839        result=result*(IR1T_SphereVolume(radius))                                               //multiply by volume of sphere)
    812840       
     
    828856        result1=result1/numbOfSteps                                                                             //this averages the values obtained over the interval....
    829857        result1=result1*(Param3 - Param4)                                                                       //this scales to contrast difference between shell and solvent
    830         //another change, 7/3/2006... To sync with NIST macros... Need to plug in the volume here again...
    831858        result1=result1*(IR1T_SphereVolume(radius+Param1))                              //multiply by volume of sphere)
    832859       
    833860        variable finalResult=(result + result1)^2                                                                                       //summ and square them together
    834         //finalResult = finalResult / (IR1T_SphereVolume(radius+Param1))                                //scale down volume scaling from above... This assumes the volume of particle is volue of core+shell
    835861        finalResult = finalResult / (IR1T_CoreShellVolume(radius,Param1,VolDefL))                               //scale down volume scaling from above... This assumes the volue of particle is the volume of core ONLY
    836862        //note, after this step we have left Volume^1 in the current form factor!!!! result and result1 both contain Volume^1, then they are squared, and we took out only volume^1...
     
    838864        //this is end of the calculations for form factor... Now we can return, except this form factor contains the contrasts, so future calculations cannot multiply by this form factor...
    839865        //this will be done at higher level...
    840         //result = result *(IR1T_SphereVolume(radius+Param1))^VolumePower                       //add usual volume scaling needed in G matrix... 
    841866//      setDataFolder OldDf
    842867       
     
    19521977        elseif(stringmatch(CurFF,"Janus CoreShell Micelle 2"))
    19531978       
     1979        elseif(stringmatch(CurFF,"Janus CoreShell Micelle 3"))
     1980       
    19541981        elseif(stringmatch(CurFF,"User"))
    19551982       
     
    20262053                Abort "at least one parameter must exist for this shape, bug"
    20272054        endif
    2028         SetVariable P1Value,limits={0,Inf,0},variable= $(P1Str), proc=IR1T_FFCntrlPnlSetVarProc
     2055        SetVariable P1Value,limits={-inf,Inf,0},variable= $(P1Str), proc=IR1T_FFCntrlPnlSetVarProc
    20292056        SetVariable P1Value,pos={5,100},size={180,15},title="Aspect ratio = ", help={"Aspect ratio of this shape (Form factor). Larger than 1 is elongated, less than 1 is prolated object"}
    20302057        NVAR/Z CurVal= $(FitP1Str)
     
    20362063                CheckBox FitP1Value,variable= $(FitP1Str), help={"Fit this parameter?"}
    20372064                NVAR disableMe= $(FitP1Str)
    2038                 SetVariable P1LowLim,limits={0,Inf,0},variable= $(LowP1Str), disable=!disableMe
     2065                SetVariable P1LowLim,limits={-inf,Inf,0},variable= $(LowP1Str), disable=!disableMe
    20392066                SetVariable P1LowLim,pos={220,100},size={80,15},title=" ", help={"Low limit for fitting param 1"}
    2040                 SetVariable P1HighLim,limits={0,Inf,0},variable= $(HighP1Str), disable=!disableMe
     2067                SetVariable P1HighLim,limits={-inf,Inf,0},variable= $(HighP1Str), disable=!disableMe
    20412068                SetVariable P1HighLim,pos={320,100},size={80,15},title=" ", help={"High limit for fitting param 1"}
    20422069        endif
     
    20672094        elseif(stringmatch(CurrentFF,"Janus CoreShell Micelle 2"))
    20682095                SetVariable P1Value, title="Core radius [A] = ", help={"Radius of core for Janus CoreShell Micelle"}
     2096        elseif(stringmatch(CurrentFF,"Janus CoreShell Micelle 3"))
     2097                SetVariable P1Value, title="Shell thickness [A] = ", help={"Thickness of the shell for Janus CoreShell micelle"}
    20692098        endif
    20702099
     
    20762105                NVAR/Z CurVal2= $(LowP2Str)
    20772106                NVAR/Z CurVal3= $(HighP2Str)
    2078                 SetVariable P2Value,limits={0,Inf,0},variable= $(P2Str), proc=IR1T_FFCntrlPnlSetVarProc
     2107                SetVariable P2Value,limits={-inf,Inf,0},variable= $(P2Str), proc=IR1T_FFCntrlPnlSetVarProc
    20792108                SetVariable P2Value,pos={5,120},size={180,15},title="Fractal dimension = ", help={"Fractal dimension"}
    20802109                if (strlen(FitP2Str)>6 && NVAR_Exists(CurVal)&& NVAR_Exists(CurVal2)&& NVAR_Exists(CurVal3))
     
    20822111                        CheckBox FitP2Value,variable= $(FitP2Str), help={"Fit this parameter?"}
    20832112                        NVAR disableMe= $(FitP2Str)
    2084                         SetVariable P2LowLim,limits={0,Inf,0},variable= $(LowP2Str), disable=!disableMe
     2113                        SetVariable P2LowLim,limits={-inf,Inf,0},variable= $(LowP2Str), disable=!disableMe
    20852114                        SetVariable P2LowLim,pos={220,120},size={80,15},title=" ", help={"Low limit for fitting param 2"}
    2086                         SetVariable P2HighLim,limits={0,Inf,0},variable= $(HighP2Str), disable=!disableMe
     2115                        SetVariable P2HighLim,limits={-inf,Inf,0},variable= $(HighP2Str), disable=!disableMe
    20872116                        SetVariable P2HighLim,pos={320,120},size={80,15},title=" ", help={"High limit for fitting param 2"}
    20882117                endif
     
    21042133                NVAR/Z CurVal2= $(LowP2Str)
    21052134                NVAR/Z CurVal3= $(HighP2Str)
    2106                 SetVariable P2Value,limits={0,Inf,0},variable= $(P2Str), proc=IR1T_FFCntrlPnlSetVarProc
     2135                SetVariable P2Value,limits={-inf,Inf,0},variable= $(P2Str), proc=IR1T_FFCntrlPnlSetVarProc
    21072136                SetVariable P2Value,pos={5,120},size={180,15},title="Fractal dimension = ", help={"Fractal dimension"}
    21082137                if (strlen(FitP2Str)>6 && NVAR_Exists(CurVal)&& NVAR_Exists(CurVal2)&& NVAR_Exists(CurVal3))
     
    21102139                        CheckBox FitP2Value,variable= $(FitP2Str), help={"Fit this parameter?"}
    21112140                        NVAR disableMe= $(FitP2Str)
    2112                         SetVariable P2LowLim,limits={0,Inf,0},variable= $(LowP2Str), disable=!disableMe
     2141                        SetVariable P2LowLim,limits={-inf,Inf,0},variable= $(LowP2Str), disable=!disableMe
    21132142                        SetVariable P2LowLim,pos={220,120},size={80,15},title=" ", help={"Low limit for fitting param 2"}
    2114                         SetVariable P2HighLim,limits={0,Inf,0},variable= $(HighP2Str), disable=!disableMe
     2143                        SetVariable P2HighLim,limits={-inf,Inf,0},variable= $(HighP2Str), disable=!disableMe
    21152144                        SetVariable P2HighLim,pos={320,120},size={80,15},title=" ", help={"High limit for fitting param 2"}
    21162145                endif
     
    21192148                NVAR/Z CurVal2= $(LowP3Str)
    21202149                NVAR/Z CurVal3= $(HighP3Str)
    2121                 SetVariable P3Value,limits={0,Inf,0},variable= $(P3Str), proc=IR1T_FFCntrlPnlSetVarProc
     2150                SetVariable P3Value,limits={-inf,Inf,0},variable= $(P3Str), proc=IR1T_FFCntrlPnlSetVarProc
    21222151                SetVariable P3Value,pos={5,140},size={180,15},title="Fractal dimension = ", help={"Fractal dimension"}
    21232152                if (strlen(FitP3Str)>6 && NVAR_Exists(CurVal)&& NVAR_Exists(CurVal2)&& NVAR_Exists(CurVal3))
     
    21252154                        CheckBox FitP3Value,variable= $(FitP3Str), help={"Fit this parameter?"}
    21262155                        NVAR disableMe= $(FitP3Str)
    2127                         SetVariable P3LowLim,limits={0,Inf,0},variable= $(LowP3Str), disable=!disableMe
     2156                        SetVariable P3LowLim,limits={-inf,Inf,0},variable= $(LowP3Str), disable=!disableMe
    21282157                        SetVariable P3LowLim,pos={220,140},size={80,15},title=" ", help={"Low limit for fitting param 3"}
    2129                         SetVariable P3HighLim,limits={0,Inf,0},variable= $(HighP3Str), disable=!disableMe
     2158                        SetVariable P3HighLim,limits={-inf,Inf,0},variable= $(HighP3Str), disable=!disableMe
    21302159                        SetVariable P3HighLim,pos={320,140},size={80,15},title=" ", help={"High limit for fitting param 3"}
    21312160                endif
     
    21342163                NVAR/Z CurVal2= $(LowP4Str)
    21352164                NVAR/Z CurVal3= $(HighP4Str)
    2136                 SetVariable P4Value,limits={0,Inf,0},variable= $(P4Str), proc=IR1T_FFCntrlPnlSetVarProc
     2165                SetVariable P4Value,limits={-inf,Inf,0},variable= $(P4Str), proc=IR1T_FFCntrlPnlSetVarProc
    21372166                SetVariable P4Value,pos={5,160},size={180,15},title="Fractal dimension = ", help={"Fractal dimension"}
    21382167                if (strlen(FitP4Str)>6 && NVAR_Exists(CurVal)&& NVAR_Exists(CurVal2)&& NVAR_Exists(CurVal3))
     
    21402169                        CheckBox FitP4Value,variable= $(FitP4Str), help={"Fit this parameter?"}
    21412170                        NVAR disableMe= $(FitP4Str)
    2142                         SetVariable P4LowLim,limits={0,Inf,0},variable= $(LowP4Str), disable=!disableMe
     2171                        SetVariable P4LowLim,limits={-inf,Inf,0},variable= $(LowP4Str), disable=!disableMe
    21432172                        SetVariable P4LowLim,pos={220,160},size={80,15},title=" ", help={"Low limit for fitting param 4"}
    2144                         SetVariable P4HighLim,limits={0,Inf,0},variable= $(HighP4Str), disable=!disableMe
     2173                        SetVariable P4HighLim,limits={-inf,Inf,0},variable= $(HighP4Str), disable=!disableMe
    21452174                        SetVariable P4HighLim,pos={320,160},size={80,15},title=" ", help={"High limit for fitting param 4"}
    21462175                endif
     
    21612190                        NVAR/Z CurVal2= $(LowP5Str)
    21622191                        NVAR/Z CurVal3= $(HighP5Str)
    2163                         SetVariable P5Value,limits={0,Inf,0},variable= $(P5Str), proc=IR1T_FFCntrlPnlSetVarProc
     2192                        SetVariable P5Value,limits={-inf,Inf,0},variable= $(P5Str), proc=IR1T_FFCntrlPnlSetVarProc
    21642193                        SetVariable P5Value,pos={5,180},size={180,15},title="Fractal dimension = ", help={"Fractal dimension"}
    21652194                        if (strlen(FitP5Str)>6 && NVAR_Exists(CurVal)&& NVAR_Exists(CurVal2)&& NVAR_Exists(CurVal3))
     
    21672196                                CheckBox FitP5Value,variable= $(FitP5Str), help={"Fit this parameter?"}
    21682197                                NVAR disableMe= $(FitP5Str)
    2169                                 SetVariable P5LowLim,limits={0,Inf,0},variable= $(LowP5Str), disable=!disableMe
     2198                                SetVariable P5LowLim,limits={-inf,Inf,0},variable= $(LowP5Str), disable=!disableMe
    21702199                                SetVariable P5LowLim,pos={220,180},size={80,15},title=" ", help={"Low limit for fitting param 5"}
    2171                                 SetVariable P5HighLim,limits={0,Inf,0},variable= $(HighP5Str), disable=!disableMe
     2200                                SetVariable P5HighLim,limits={-inf,Inf,0},variable= $(HighP5Str), disable=!disableMe
    21722201                                SetVariable P5HighLim,pos={320,180},size={80,15},title=" ", help={"High limit for fitting param5"}
    21732202                        endif           
     
    22312260                        NVAR/Z CurVal2= $(LowP6Str)
    22322261                        NVAR/Z CurVal3= $(HighP6Str)
    2233                         SetVariable P6Value,limits={0,Inf,0},variable= $(P6Str), proc=IR1T_FFCntrlPnlSetVarProc
     2262                        SetVariable P6Value,limits={-inf,Inf,0},variable= $(P6Str), proc=IR1T_FFCntrlPnlSetVarProc
    22342263                        SetVariable P6Value,pos={5,200},size={180,15},title="Shell 2 rho = ", help={"Scattering length density of external shell"}
    22352264                        if (strlen(FitP6Str)>6 && NVAR_Exists(CurVal)&& NVAR_Exists(CurVal2)&& NVAR_Exists(CurVal3))
     
    22372266                                CheckBox FitP6Value,variable= $(FitP6Str), help={"Fit this parameter?"}
    22382267                                NVAR disableMe= $(FitP6Str)
    2239                                 SetVariable P6LowLim,limits={0,Inf,0},variable= $(LowP6Str), disable=!disableMe
     2268                                SetVariable P6LowLim,limits={-inf,Inf,0},variable= $(LowP6Str), disable=!disableMe
    22402269                                SetVariable P6LowLim,pos={220,200},size={80,15},title=" ", help={"Low limit for fitting param 5"}
    2241                                 SetVariable P6HighLim,limits={0,Inf,0},variable= $(HighP6Str), disable=!disableMe
     2270                                SetVariable P6HighLim,limits={-inf,Inf,0},variable= $(HighP6Str), disable=!disableMe
    22422271                                SetVariable P6HighLim,pos={320,200},size={80,15},title=" ", help={"High limit for fitting param5"}
    22432272                        endif           
     
    22722301        String varStr
    22732302        String varName
     2303        variable tempValue
    22742304
    22752305        if(stringmatch("P1Value",ctrlName))
     
    22822312                P1LowLimVar=0.8 *  P1Var
    22832313                P1HighLimVar= 1.2 * P1Var
     2314                if(P1LowLimVar>P1HighLimVar)
     2315                        tempValue=P1LowLimVar
     2316                        P1LowLimVar=P1HighLimVar
     2317                        P1HighLimVar=tempValue
     2318                endif
    22842319        endif
    22852320
     
    22932328                P2LowLimVar=0.8 *  P2Var
    22942329                P2HighLimVar= 1.2 * P2Var
     2330                if(P2LowLimVar>P2HighLimVar)
     2331                        tempValue=P2LowLimVar
     2332                        P2LowLimVar=P2HighLimVar
     2333                        P2HighLimVar=tempValue
     2334                endif
    22952335        endif
    22962336
     
    23042344                P3LowLimVar=0.8 *  P3Var
    23052345                P3HighLimVar= 1.2 * P3Var
     2346                if(P3LowLimVar>P3HighLimVar)
     2347                        tempValue=P3LowLimVar
     2348                        P3LowLimVar=P3HighLimVar
     2349                        P3HighLimVar=tempValue
     2350                endif
    23062351        endif
    23072352
     
    23162361                P4LowLimVar=0.8 *  P4Var
    23172362                P4HighLimVar= 1.2 * P4Var
     2363                if(P4LowLimVar>P4HighLimVar)
     2364                        tempValue=P4LowLimVar
     2365                        P4LowLimVar=P4HighLimVar
     2366                        P4HighLimVar=tempValue
     2367                endif
    23182368        endif
    23192369
     
    23282378                P5LowLimVar=0.8 *  P5Var
    23292379                P5HighLimVar= 1.2 * P5Var
     2380                if(P5LowLimVar>P5HighLimVar)
     2381                        tempValue=P5LowLimVar
     2382                        P5LowLimVar=P5HighLimVar
     2383                        P5HighLimVar=tempValue
     2384                endif
    23302385        endif
    23312386
     
    23342389                NVAR P6Var=$(S_DataFolder+S_value)
    23352390                ControlInfo/W=FormFactorControlScreen P6LowLim
    2336                 NVAR P5LowLimVar=$(S_DataFolder+S_value)
     2391                NVAR P6LowLimVar=$(S_DataFolder+S_value)
    23372392                ControlInfo/W=FormFactorControlScreen P6HighLim
    2338                 NVAR P5HighLimVar=$(S_DataFolder+S_value)
    2339                 P5LowLimVar=0.8 *  P6Var
    2340                 P5HighLimVar= 1.2 * P6Var
     2393                NVAR P6HighLimVar=$(S_DataFolder+S_value)
     2394                P6LowLimVar=0.8 *  P6Var
     2395                P6HighLimVar= 1.2 * P6Var
     2396                if(P6LowLimVar>P6HighLimVar)
     2397                        tempValue=P6LowLimVar
     2398                        P6LowLimVar=P6HighLimVar
     2399                        P6HighLimVar=tempValue
     2400                endif
    23412401        endif
    23422402
     
    23452405                NVAR P7Var=$(S_DataFolder+S_value)
    23462406                ControlInfo/W=FormFactorControlScreen P7LowLim
    2347                 NVAR P5LowLimVar=$(S_DataFolder+S_value)
     2407                NVAR P7LowLimVar=$(S_DataFolder+S_value)
    23482408                ControlInfo/W=FormFactorControlScreen P7HighLim
    2349                 NVAR P5HighLimVar=$(S_DataFolder+S_value)
    2350                 P5LowLimVar=0.8 *  P7Var
    2351                 P5HighLimVar= 1.2 * P7Var
     2409                NVAR P7HighLimVar=$(S_DataFolder+S_value)
     2410                P7LowLimVar=0.8 *  P7Var
     2411                P7HighLimVar= 1.2 * P7Var
     2412                if(P7LowLimVar>P7HighLimVar)
     2413                        tempValue=P7LowLimVar
     2414                        P7LowLimVar=P7HighLimVar
     2415                        P7HighLimVar=tempValue
     2416                endif
    23522417        endif
    23532418
     
    28642929//                      Janus coreshell Micelle functions...
    28652930//*****************************************************************************************************************
    2866 threadsafe static Function IR1T_JanusFF(Qv, Ro, RhoA, RhoB, RhoC, RhoSolv,Ri)
     2931//static
     2932threadsafe  Function IR1T_JanusFF(Qv, Ro, RhoA, RhoB, RhoC, RhoSolv,Ri)
    28672933        variable Qv, Ro, RhoA, RhoB, RhoC, RhoSolv, Ri
    28682934
     2935        variable RhoARel, RhoBRel, RhoCRel
     2936        RhoARel = RhoA - RhoSolv
     2937        RhoBRel = RhoB - RhoSolv
     2938        RhoCRel = RhoC - RhoSolv
    28692939        variable numP=JanusCoreShellMicNumIngtPnts     
    28702940        // Ro = Ro in Fig 1
     
    28742944        //we need to integrate this per whole particle - remember to weigh by cos(th) in the integration as AnisoPorod used to be
    28752945        variable kv             //is Q * mu
    2876         variable DrhoBA = RhoA - RhoB   // RhoA - RhoB
    2877         variable DrhoCA = RhoA - RhoC   //RhoA - RhoC
     2946        variable DrhoBA = RhoARel - RhoBRel     // RhoA - RhoB
     2947        variable DrhoCA = RhoARel - RhoCRel     //RhoA - RhoC
    28782948        // now we need to do the calculations.
    2879         variable Vp = IR1T_JanusVp(Ro,RhoA, RhoB, RhoC,Ri)
     2949        variable Vp = IR1T_JanusVp(Ro,RhoARel, RhoBRel, RhoCRel,Ri)
    28802950        make/O/N=(numP) IntgWvMu, weightFac
    28812951        SetScale /I x, 0, pi/2,"", IntgWvMu, weightFac
    28822952        weightFac = sin(x)
    2883         multithread IntgWvMu = IR1T_JanusOneMu(Qv,Ro,Ri, DrhoBA, DrhoCA, RhoB, RhoC, Qv*cos(x), numP, Vp, cos(x))
    2884         IntgWvMu[0]=IntgWvMu[1]                 //IntgWvMu[0] = NaN so needs to be repalced by next point. Known numercial issue...
     2953        multithread IntgWvMu = IR1T_JanusOneMu(Qv,Ro,Ri, DrhoBA, DrhoCA, RhoBRel, RhoCRel, Qv*cos(x), numP, Vp, cos(x))
     2954        IntgWvMu[0]=IntgWvMu[1]                 //IntgWvMu[0] = NaN so needs to be replaced by next point. Known numercial issue...
    28852955        IntgWvMu *=weightFac
    2886         return 2* area(IntgWvMu, 0, pi/2)
    2887 end
     2956        return area(IntgWvMu, 0, pi/2)
     2957end
     2958//*****************************************************************************************************************
     2959//*****************************************************************************************************************
     2960Function IR1T_JanusAveContrast(Rcore, RShell, RhoCore, RhoA, RhoB, RhoSolv)
     2961        variable Rcore, RShell, RhoCore, RhoA, RhoB, RhoSolv
     2962
     2963        variable CoreVolume = 4/3 * pi * Rcore^3
     2964        variable ShellVolume = 4/3 * pi * (Rcore+RShell)^3 - CoreVolume
     2965        variable SummContr = CoreVolume*(RhoCore-RhoSolv) + 0.5*ShellVolume*(RhoA-RhoSolv) +  0.5*ShellVolume*(RhoB-RhoSolv)
     2966        variable DeltaRho = (SummContr / (CoreVolume+ShellVolume))
     2967        return abs(DeltaRho)
     2968end
     2969
    28882970//*****************************************************************************************************************
    28892971//*****************************************************************************************************************
  • trunk/User Procedures/Irena/IR1_Functions.ipf

    r6 r39  
    624624        ListOfWindows += "IR1I_ImportData;IR1V_ControlPanel;IR1V_LogLogPlotV;IR1V_IQ4_Q_PlotV;IR2S_ScriptingToolPnl;IR2Pr_PDFInputGraph;IR2Pr_ControlPanel;"
    625625        ListOfWindows += "PlotingToolWaterfallGrph;LSQF2_MainPanel;LSQF_MainGraph;GraphSizeDistributions;LSQF_ResidualsGraph;Irena_Gizmo;GizmoControlPanel;"
    626         ListOfWindows += "DataMiningTool;ItemsInFolderPanel;ItemsInFolderPanel_DMII;DataManipulationII;IR2R_InsertRemoveLayers;"
     626        ListOfWindows += "DataMiningTool;ItemsInFolderPanel;ItemsInFolderPanel_DMII;DataManipulationII;IR2R_InsertRemoveLayers;PlotingToolContourGrph;"
    627627        variable i
    628628        string TempNm
  • trunk/User Procedures/Irena/IR1_GeneralGraph.ipf

    r13 r39  
    11#pragma rtGlobals=1             // Use modern global access method.
    2 #pragma version=2.14
     2#pragma version=2.15
    33#include <KBColorizeTraces>
    4 Constant IR1PversionNumber=2.13
     4Constant IR1PversionNumber=2.15
    55
    66//*************************************************************************\
     
    1010//*************************************************************************/
    1111
     12//2.15 added contour plot and basic controls.
    1213//2.14 Modified to handle different units for Intensity calibration. Addec control in Change Graph details panel.
    1314//2.13 Added vertical scrolling
     
    4142
    4243        String ListOfWindowsToClose="GizmoControlPanel;Irena_Gizmo;GeneralGraph;PlotingToolWaterfallGrph;IR1P_ControlPanel;IR1P_RemoveDataPanel;"
    43         ListOfWindowsToClose+="PlotingToolWaterfallGrph;IR1P_ModifyDataPanel;IR1P_FittingDataPanel;IR1P_ChangeGraphDetailsPanel;"
     44        ListOfWindowsToClose+="PlotingToolWaterfallGrph;IR1P_ModifyDataPanel;IR1P_FittingDataPanel;IR1P_ChangeGraphDetailsPanel;PlotingToolContourGrph;"
    4445       
    4546        variable i
     
    107108        IR2C_AddDataControls("GeneralplottingTool","IR1P_ControlPanel","M_DSM_Int;DSM_Int;M_SMR_Int;SMR_Int","AllCurrentlyAllowedTypes",UserDataTypes,UserNameString,XUserLookup,EUserLookup, 0,0)
    108109//IR2C_AddDataControls(PckgDataFolder,PanelWindowName,AllowedIrenaTypes, AllowedResultsTypes, AllowedUserTypes, UserNameString, XUserTypeLookup,EUserTypeLookup, RequireErrorWaves)
     110        Button ScriptingTool,pos={302,138},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Scripting tool", help={"Start scripting tool to add multiple data at once"}
    109111        Button AddDataToGraph,pos={2,158},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Add data", help={"Click to add data into the list of data to be displayed in the graph"}
    110112        Button RemoveData,pos={102,158},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Remove data", help={"Click to remove data  from the list of data to be displayed in the graph"}
    111113        Button CreateGraph,pos={202,158},size={95,20}, proc=IR1P_InputPanelButtonProc,title="(Re)Graph (2D)", help={"Click to create graph or regraph with newly added data"}
    112114        Button ResetAll,pos={302,158},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Kill Graph, Reset", help={"Click here to kill graph and reset this tool (remove all data sets from graph)"}
    113         Button ScriptingTool,pos={302,178},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Scripting tool", help={"Start scripting tool to add multiple data at once"}
    114115        Button Create3DGraph,pos={202,178},size={95,20}, proc=IR1P_InputPanelButtonProc,title="(Re)Graph (3D,Wf)", help={"Click to create 3D graph or regraph with newly added data"}
    115         Button CreateMovie,pos={102,178},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Create Movie", help={"Click to create movie from 2D or 3D graph"}
    116         Button CreateGizmoGraph,pos={2,178},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Gizmo (3D)", help={"Click to create 3D graph using Gizmo"}
     116        Button CreateMovie,pos={2,178},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Create Movie", help={"Click to create movie from 2D or 3D graph"}
     117        Button CreateGizmoGraph,pos={102,178},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Gizmo (3D)", help={"Click to create 3D graph using Gizmo"}
     118        Button CreateContourPlot,pos={302,178},size={95,20}, proc=IR1P_InputPanelButtonProc,title="Contour plot", help={"Create contour plot"}
    117119
    118120//graph controls
     
    460462                DoWIndow/F IR1P_ControlPanel
    461463        endif
     464        if (cmpstr(ctrlName,"CreateContourPlot")==0)
     465                //here goes what is done, when user pushes Graph button
     466                IsAllAllRight=1
     467                if (IsAllAllRight)
     468                        IR1P_CreateCountourGraph()
     469                else
     470                        Abort "Data not selected properly"
     471                endif
     472                DoWIndow/F IR1P_ControlPanel
     473        endif
    462474
    463475
     
    17121724        ListOfStrings+="GraphXAxisName;GraphYAxisName;SelectedDataToRemove;GraphLegendPosition;ModifyIntName;ModifyQname;ModifyErrName;"
    17131725        ListOfStrings+="ListOfRemovedPoints;FittingSelectedFitFunction;FittingFunctionDescription;"
    1714         ListOfStrings+="DataFolderName;IntensityWaveName;QWavename;ErrorWaveName;"
     1726        ListOfStrings+="DataFolderName;IntensityWaveName;QWavename;ErrorWaveName;ContGraph3DColorScale;"
    17151727
    17161728        ListOfVariables="UseIndra2Data;UseQRSdata;UseResults;DisplayTimeAndDate;"
     
    17291741        ListOfVariables+="GizmoNumLevels;GizmoUseLogColors;GizmoDisplayGrids;GizmoDisplayLabels;GizmoEstimatedVoronoiTime;"
    17301742        ListOfStrings+="Graph3DColorScale;Graph3DVisibility;"
     1743        //Contour special controls
     1744        ListOfVariables+="ContMinValue;ContMaxValue;ContNumCountours;ContDisplayContValues;ContLogContours;ContUseOnlyRedColor;ContSmoothOverValue;"
    17311745        //Movie special controls
    17321746        ListOfVariables+="MovieUse2Dgraph;MovieUse3DGraph;MovieReplaceData;MovieFrameRate;MovieFileOpened;MovieDisplayDelay;"
     
    17571771        SVAR FittingSelectedFitFunction
    17581772        FittingSelectedFitFunction = "---"
     1773        SVAR ContGraph3DColorScale
     1774        if(strlen(ContGraph3DColorScale)<1)
     1775                ContGraph3DColorScale="none"
     1776        endif
    17591777       
    17601778        ListOfVariables="GraphErrors;GraphXMajorGrid;GraphXMinorGrid;GraphYMajorGrid;GraphYMinorGrid;"
     
    18001818                GizmoNumLevels=100
    18011819        endif
    1802 
     1820       
     1821        NVAR ContNumCountours
     1822        if(ContNumCountours<10)
     1823                ContNumCountours=11
     1824        endif
    18031825       NVAR Graph3DAngle
    18041826       if(Graph3DAngle<10||numtype(Graph3DAngle)!=0)
  • trunk/User Procedures/Irena/IR1_GeneralGraph2.ipf

    r13 r39  
    11#pragma rtGlobals=1             // Use modern global access method.
    2 #pragma version=2.10
     2#pragma version=2.11
    33
    44//*************************************************************************\
     
    1010
    1111//to do: need to handle better the symbols and line types, limit for 8 types is just way too little.
     12//2.11 added contour plot and basic handling
    1213//2.10 modified to handle different Intensity units for calibration
    1314//2.09 added units to lookup string so we can propagate them forward.
     
    19361937end
    19371938
    1938 //************************************************************************************************************************
    1939 //************************************************************************************************************************
     1939
     1940//************************************************************************************************************************
     1941//************************************************************************************************************************
     1942//************************************************************************************************************************
     1943//************************************************************************************************************************
     1944
     1945Function IR1P_CreateCountourGraph()
     1946
     1947        DoWIndow PlotingToolContourGrph
     1948        if(V_Flag)
     1949                DoWIndow/K PlotingToolContourGrph
     1950        endif
     1951        IR1P_CreateDataToPlot()
     1952        IR1P_genGraphCreateDataWF()
     1953        Wave PlottingTool_Int_M=root:Packages:GeneralplottingTool:Waterfall:PlottingTool_Int_M
     1954        Duplicate/O PlottingTool_Int_M, PlottingTool_Int_Contour
     1955        wave PlottingTool_Int_Contour=root:Packages:GeneralplottingTool:Waterfall:PlottingTool_Int_Contour
     1956        NVAR ContSmoothOverValue=root:Packages:GeneralplottingTool:ContSmoothOverValue
     1957        if(ContSmoothOverValue>2)
     1958                MatrixFilter /N=(ContSmoothOverValue) avg PlottingTool_Int_Contour
     1959        endif
     1960        SVAR Graph3DColorScale = root:Packages:GeneralplottingTool:ContGraph3DColorScale
     1961        Display /K=1/W=(405,467,950,900) as "Plotting tool I Contour plot"
     1962        AppendMatrixContour PlottingTool_Int_Contour vs {PlottingTool_Q,*}
     1963        ModifyGraph mirror=2
     1964        DoWindow/C PlotingToolContourGrph
     1965        ControlBar /T/W=PlotingToolContourGrph 52
     1966        SetVariable ContNumCountours,pos={10,2},size={170,15},title="Number of contours",bodyWidth=70
     1967        SetVariable ContNumCountours, proc=IR1P_ContSetVarProc, help={"Number of contours to use"}
     1968        SetVariable ContNumCountours,limits={11,inf,5},value= root:Packages:GeneralplottingTool:ContNumCountours
     1969        SetVariable ContMinValue,pos={10,18},size={170,15},title="Min Contour val ",bodyWidth=70
     1970        SetVariable ContMinValue, proc=IR1P_ContSetVarProc, help={"Value of minimum Contour"}
     1971        SetVariable ContMinValue,limits={0,inf,0},value= root:Packages:GeneralplottingTool:ContMinValue
     1972        SetVariable ContMaxValue,pos={10,35},size={170,15},title="Max Contour val",bodyWidth=70
     1973        SetVariable ContMaxValue, proc=IR1P_ContSetVarProc, help={"change length of slanted axis"}
     1974        SetVariable ContMaxValue,limits={0,inf,0},value= root:Packages:GeneralplottingTool:ContMaxValue
     1975        Checkbox ContDisplayContValues, pos={200,5}, title="Labels?", size={100,15}, variable=root:Packages:GeneralplottingTool:ContDisplayContValues, proc=IR1P_ContCheckProc
     1976        PopupMenu ColorTable,pos={200,30},size={150,20},title="Colors:", help={"Select color table"}
     1977        PopupMenu ColorTable,mode=1,popvalue=Graph3DColorScale,value= #"CTabList()", bodyWidth=100, proc=IR1P_ContPopMenuProc
     1978        PopupMenu SmoothOverValue,pos={350,30},size={150,20},title="Smooth val:", help={"Smooth value"}, proc=IR1P_ContPopMenuProc
     1979        PopupMenu SmoothOverValue,mode=1,popvalue=num2str(ContSmoothOverValue),value= "0;3;5;9;", bodyWidth=40
     1980        Checkbox ContLogContours, pos={300,5}, title="Log countours?", size={100,15}, variable=root:Packages:GeneralplottingTool:ContLogContours, proc=IR1P_ContCheckProc
     1981        Checkbox ContUseOnlyRedColor, pos={400,5}, title="Only red?", size={100,15}, variable=root:Packages:GeneralplottingTool:ContUseOnlyRedColor, proc=IR1P_ContCheckProc
     1982
     1983        IR1P_FormatContourPlot()
     1984end
     1985//************************************************************************************************************************
     1986//************************************************************************************************************************
     1987Function IR1P_FormatContourPlot()
     1988        DoWIndow PlotingToolContourGrph
     1989        if(!V_Flag)
     1990                return 0
     1991        else
     1992                DoWIndow/F PlotingToolContourGrph
     1993        endif
     1994
     1995        SVAR Graph3DColorScale = root:Packages:GeneralplottingTool:ContGraph3DColorScale
     1996        NVAR GraphLeftAxisAuto = root:Packages:GeneralplottingTool:GraphLeftAxisAuto
     1997        NVAR GraphLeftAxisMin = root:Packages:GeneralplottingTool:GraphLeftAxisMin
     1998        NVAR GraphLeftAxisMax = root:Packages:GeneralplottingTool:GraphLeftAxisMax
     1999        NVAR GraphBottomAxisAuto= root:Packages:GeneralplottingTool:GraphBottomAxisAuto
     2000        NVAR GraphBottomAxisMin= root:Packages:GeneralplottingTool:GraphBottomAxisMin
     2001        NVAR GraphBottomAxisMax = root:Packages:GeneralplottingTool:GraphBottomAxisMax
     2002        NVAR ContMinValue = root:Packages:GeneralplottingTool:ContMinValue
     2003        NVAR ContMaxValue = root:Packages:GeneralplottingTool:ContMaxValue
     2004        NVAR ContNumCountours = root:Packages:GeneralplottingTool:ContNumCountours
     2005        NVAR ContDisplayContValues = root:Packages:GeneralplottingTool:ContDisplayContValues
     2006        NVAR ContMinValue = root:Packages:GeneralplottingTool:ContMinValue
     2007        NVAR ContMaxValue = root:Packages:GeneralplottingTool:ContMaxValue
     2008        NVAR ContNumCountours = root:Packages:GeneralplottingTool:ContNumCountours
     2009        NVAR ContDisplayContValues = root:Packages:GeneralplottingTool:ContDisplayContValues
     2010        NVAR ContLogContours = root:Packages:GeneralplottingTool:ContLogContours
     2011        NVAR ContUseOnlyRedColor = root:Packages:GeneralplottingTool:ContUseOnlyRedColor
     2012       
     2013        WAVE PlottingTool_Int_Contour=root:Packages:GeneralplottingTool:Waterfall:PlottingTool_Int_Contour
     2014        WAVE PlottingTool_Q = root:Packages:GeneralplottingTool:Waterfall:PlottingTool_Q
     2015        //let's set the min/max values right...
     2016//      if(!GraphLeftAxisAuto)
     2017//              SetAxis left GraphLeftAxisMin, GraphLeftAxisMax
     2018//      else
     2019//              SetAxis/A left
     2020//      endif   
     2021        //SVAR GraphYAxisName = root:Packages:GeneralplottingTool:GraphYAxisName
     2022        if(!GraphBottomAxisAuto)
     2023                SetAxis bottom GraphBottomAxisMin, GraphBottomAxisMax
     2024        else
     2025                SetAxis/A bottom
     2026        endif   
     2027        SVAR GraphXAxisName = root:Packages:GeneralplottingTool:GraphXAxisName
     2028        Label bottom GraphXAxisName
     2029        //Label left GraphYAxisName
     2030        if(!GraphLeftAxisAuto)
     2031                ContMinValue = GraphLeftAxisMin
     2032                ContMaxValue = GraphLeftAxisMax
     2033                ModifyContour PlottingTool_Int_Contour autoLevels={ContMinValue,ContMaxValue,ContNumCountours}
     2034        else
     2035                ModifyContour PlottingTool_Int_Contour autoLevels={*,*,ContNumCountours}
     2036                ContMinValue = GraphLeftAxisMin
     2037                ContMaxValue = GraphLeftAxisMax
     2038        endif   
     2039        SetVariable ContMinValue,limits={ContMinValue,ContMaxValue,((ContMaxValue-ContMinValue)/25)},win= PlotingToolContourGrph
     2040        SetVariable ContMaxValue,limits={ContMinValue,ContMaxValue,((ContMaxValue-ContMinValue)/25)},win= PlotingToolContourGrph
     2041
     2042        ModifyContour PlottingTool_Int_Contour labels=2*ContDisplayContValues
     2043        NVAR ContUseOnlyRedColor = root:Packages:GeneralplottingTool:ContUseOnlyRedColor
     2044        if(ContUseOnlyRedColor)
     2045                ModifyContour PlottingTool_Int_Contour labelRGB=(65535, 0, 0 )
     2046        else
     2047                ModifyContour PlottingTool_Int_Contour ctabLines={ContMinValue, ContMaxValue, $(Graph3DColorScale), 1 }
     2048        endif
     2049        NVAR ContLogContours = root:Packages:GeneralplottingTool:ContLogContours
     2050        ModifyContour PlottingTool_Int_Contour logLines=ContLogContours
     2051
     2052
     2053end
     2054
     2055
     2056//************************************************************************************************************************
     2057//************************************************************************************************************************
     2058Function IR1P_ContSetVarProc(sva) : SetVariableControl
     2059        STRUCT WMSetVariableAction &sva
     2060
     2061        switch( sva.eventCode )
     2062                case 1: // mouse up
     2063                        if(stringmatch(sva.ctrlName,"ContNumCountours")||stringmatch(sva.ctrlName,"ContMinValue")||stringmatch(sva.ctrlName,"ContMaxValue"))
     2064                                //do something
     2065                                NVAR ContNumCountours = root:Packages:GeneralplottingTool:ContNumCountours
     2066                                NVAR ContMinValue = root:Packages:GeneralplottingTool:ContMinValue
     2067                                NVAR ContMaxValue = root:Packages:GeneralplottingTool:ContMaxValue
     2068                                ModifyContour PlottingTool_Int_Contour autoLevels={ContMinValue,ContMaxValue,ContNumCountours}
     2069                        endif
     2070                        break
     2071                case 2: // Enter key
     2072                        if(stringmatch(sva.ctrlName,"ContNumCountours")||stringmatch(sva.ctrlName,"ContMinValue")||stringmatch(sva.ctrlName,"ContMaxValue"))
     2073                                //do something
     2074                                NVAR ContNumCountours = root:Packages:GeneralplottingTool:ContNumCountours
     2075                                NVAR ContMinValue = root:Packages:GeneralplottingTool:ContMinValue
     2076                                NVAR ContMaxValue = root:Packages:GeneralplottingTool:ContMaxValue
     2077                                ModifyContour PlottingTool_Int_Contour autoLevels={ContMinValue,ContMaxValue,ContNumCountours}
     2078                        endif
     2079                        break
     2080                case 3: // Live update
     2081                        Variable dval = sva.dval
     2082                        String sval = sva.sval
     2083                        break
     2084                case -1: // control being killed
     2085                        break
     2086        endswitch
     2087
     2088        return 0
     2089End
     2090//************************************************************************************************************************
     2091//************************************************************************************************************************
     2092Function IR1P_ContCheckProc(cba) : CheckBoxControl
     2093        STRUCT WMCheckboxAction &cba
     2094
     2095        switch( cba.eventCode )
     2096                case 2: // mouse up
     2097                        Variable checked = cba.checked
     2098                        if(stringmatch(cba.ctrlName,"ContDisplayContValues"))
     2099                                NVAR ContDisplayContValues = root:Packages:GeneralplottingTool:ContDisplayContValues
     2100                                ModifyContour PlottingTool_Int_Contour labels=2*ContDisplayContValues
     2101                                //do something
     2102                        endif
     2103                        NVAR ContLogContours = root:Packages:GeneralplottingTool:ContLogContours
     2104                        NVAR ContUseOnlyRedColor = root:Packages:GeneralplottingTool:ContUseOnlyRedColor
     2105                        if(stringmatch(cba.ctrlName,"ContUseOnlyRedColor"))
     2106                                NVAR ContLogContours = root:Packages:GeneralplottingTool:ContLogContours
     2107                                ContLogContours=0
     2108                                ModifyContour PlottingTool_Int_Contour rgbLines=(65535,0,0 )
     2109                                //do something
     2110                        endif
     2111                        if(stringmatch(cba.ctrlName,"ContLogContours"))
     2112                                NVAR ContLogContours = root:Packages:GeneralplottingTool:ContLogContours
     2113                                ModifyContour PlottingTool_Int_Contour logLines=ContLogContours
     2114                                //do something
     2115                        endif
     2116                        break
     2117                case -1: // control being killed
     2118                        break
     2119        endswitch
     2120
     2121        return 0
     2122End
     2123//************************************************************************************************************************
     2124//************************************************************************************************************************
     2125Function IR1P_ContPopMenuProc(pa) : PopupMenuControl
     2126        STRUCT WMPopupAction &pa
     2127
     2128        switch( pa.eventCode )
     2129                case 2: // mouse up
     2130                        Variable popNum = pa.popNum
     2131                        String popStr = pa.popStr
     2132                        if(stringmatch(pa.ctrlName,"ColorTable"))
     2133                                SVAR Graph3DColorScale = root:Packages:GeneralplottingTool:ContGraph3DColorScale
     2134                                Graph3DColorScale = popStr
     2135                                NVAR ContMinValue = root:Packages:GeneralplottingTool:ContMinValue
     2136                                NVAR ContMaxValue = root:Packages:GeneralplottingTool:ContMaxValue
     2137                                NVAR ContLogContours = root:Packages:GeneralplottingTool:ContLogContours
     2138                                NVAR ContUseOnlyRedColor = root:Packages:GeneralplottingTool:ContUseOnlyRedColor
     2139                                ContUseOnlyRedColor=0
     2140                                if(stringMatch(Graph3DColorScale,"none"))
     2141                                        ModifyContour PlottingTool_Int_Contour labelRGB=(65535, 0, 0 )
     2142                                else
     2143                                        ModifyContour PlottingTool_Int_Contour ctabLines={ContMinValue, ContMaxValue, $(Graph3DColorScale), 1 }
     2144                                        ModifyContour PlottingTool_Int_Contour logLines=ContLogContours
     2145                                endif
     2146                        endif
     2147                        if(stringmatch(pa.ctrlName,"SmoothOverValue"))
     2148                                NVAR ContSmoothOverValue=root:Packages:GeneralplottingTool:ContSmoothOverValue
     2149                                WAVE PlottingTool_Int_M = root:Packages:GeneralplottingTool:Waterfall:PlottingTool_Int_M
     2150                                WAVE PlottingTool_Int_Contour = root:Packages:GeneralplottingTool:Waterfall:PlottingTool_Int_Contour
     2151                                Duplicate /O PlottingTool_Int_M, PlottingTool_Int_Contour
     2152                                ContSmoothOverValue = str2num(pa.popStr)
     2153                                if(ContSmoothOverValue>2)
     2154                                        MatrixFilter /N=(ContSmoothOverValue) avg PlottingTool_Int_Contour
     2155                                endif
     2156                                IR1P_FormatContourPlot()
     2157                        endif
     2158                        break
     2159                case -1: // control being killed
     2160                        break
     2161        endswitch
     2162
     2163        return 0
     2164End
    19402165//************************************************************************************************************************
    19412166//************************************************************************************************************************
  • trunk/User Procedures/Irena/IR1_Unified_Panel.ipf

    r6 r39  
    633633        SetVariable Level2RGCOHighLimit,limits={0,inf,0},value= root:Packages:Irena_UnifFit:Level2RgCOHighLimit, help={"RgCutOff high limit"}
    634634
    635         //Button Level2SetRGCODefault,pos={20,450},size={100,20}, proc=IR1A_InputPanelButtonProc,title="Rg(level-1)->RGCO", help={"This button sets the RgCutOff to value of Rg from previous level (or 0 for level 1)"}
     635        Button Level2SetRGCODefault,pos={20,450},size={100,20}, proc=IR1A_InputPanelButtonProc,title="Rg(level-1)->RGCO", help={"This button sets the RgCutOff to value of Rg from previous level (or 0 for level 1)"}
    636636        CheckBox Level2LinkRGCO,pos={160,455},size={80,16},proc=IR1A_InputPanelCheckboxProc,title="Link RGCO"
    637637        CheckBox Level2LinkRGCO,variable= root:Packages:Irena_UnifFit:Level2LinkRgCo, help={"Link the RgCO to lower level and fit at the same time?"}
  • trunk/User Procedures/Irena/IR2L_NLSQFsupport.ipf

    r38 r39  
    11#pragma rtGlobals=1             // Use modern global access method.
    2 #pragma version=1.15
     2#pragma version=1.16
    33
    44//*************************************************************************\
     
    88//*************************************************************************/
    99
     10//1.16 fixed fix limits check so if the value is negative, it sorts out limits correctly. Needed for core shell systems with negative SLD
    1011//1.15 added Form and Structrue factor description as Igor help file. Added buttons to call the help file from GUI.
    1112//1.14 Modified to handle Janus CoreShell Micelle FF
     
    32223223        variable scale
    32233224       
    3224         variable i, j
     3225        variable i, j, tempValue
    32253226        //Input Data parameters... Will have _setX attached, in this method background needs to be here...
    32263227        //0.1 - 10x
     
    32383239                                BckgMin = scale*0.1 * Bckg
    32393240                                BckgMax = scale*10 * Bckg
     3241                                if(BckgMin>BckgMax)
     3242                                        tempValue=BckgMin
     3243                                        BckgMin=BckgMax
     3244                                        BckgMax=tempValue
     3245                                endif
    32403246                        endif
    32413247                endif
     
    32903296                                                MaxVarVal=scale*2 * VarVal
    32913297                                        endif
     3298                                if(MinVarVal>MaxVarVal)
     3299                                        tempValue=MinVarVal
     3300                                        MinVarVal=MaxVarVal
     3301                                        MaxVarVal=tempValue
     3302                                endif
    32923303                                endif
    32933304                        endfor
  • trunk/User Procedures/Irena/Modification history.txt

    r38 r39  
    99Form factors - removed algebraic form factors. Useless, use Unified ones if needed.
    1010Form/Structure factors - created Igor help file with the description. Added call buttons from Modeling II GUI. Needs to be finished on Sizes.
     11Plotting tool I - added basic contour plot capabilities
    1112
    1213
Note: See TracChangeset for help on using the changeset viewer.