Changeset 918


Ignore:
Timestamp:
Apr 13, 2020 9:37:57 AM (2 years ago)
Author:
ilavsky
Message:

WIP PDDF

Location:
trunk/User Procedures/Irena
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/User Procedures/Irena/IR1_Main.ipf

    r917 r918  
    281281        //"Irena PDF", IR2Pr_MainPDDF()
    282282        //help={"Calculate pair distribution function using various methods in Irena"}
    283         "PDDF (Gnom, AutoGnom, Regulr, Moore)", IRB1_PDDFInterfaceFunction()
     283        "PDDF + MW (Gnom, AutoGnom, ...)", IRB1_PDDFInterfaceFunction()
    284284        help={"GUI to run PDDF and some ATSAS tools from Irena"}
    285285end
  • trunk/User Procedures/Irena/IRB1_bioSAXS.ipf

    r916 r918  
    15231523        Setvariable DataQEnd, variable=root:Packages:Irena:PDDFInterface:DataQEnd, limits={-inf,inf,0}
    15241524
    1525         checkbox PDDFUseProtein, pos={300,130}, title="\Zr120Protein", size={120,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFUseProtein, fColor=(65535,0,0), mode=1, help={"Run PDDF with setting for Proteins. Changes density and SLD"}
    1526         checkbox PDDFUseNucleicAcid, pos={450,130}, title="\Zr120Nucleic Acid", size={120,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFUseNucleicAcid, fColor=(65535,0,0), mode=1, help={"Run PDDF with settings from Nucleai acid. Changes density and SLD"}
    1527 
    1528 
     1525
     1526        //Dist Tabs definition
     1527        TabControl PDDFTabs,pos={260,130},size={330,330}, proc=IRB1_PDDFTabProc
     1528        TabControl PDDFTabs,tabLabel(0)="PDDF",tabLabel(1)="MolWeight", value=0
     1529
     1530        //MW controls
    15291531        TitleBox PDDFInstructions1 title="\Zr120SAXSMoW2 MW Calc : ",size={230,15},pos={270,156},frame=0,fColor=(0,0,65535),labelBack=0
    1530         Button CalculateDmaxOnData,pos={420,152},size={170,20}, proc=IRB1_PDDFButtonProc,title="Calculate Rg, Dmax, MW", help={"Calculate Dmax on these data"}
    1531         checkbox CalculateDmaxEstOnImport, pos={480,185}, title="Calc. on add data?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:CalculateDmaxEstOnImport, help={"Calculate Dmax when new data are added (useful when multiprocessing)"}
     1532        checkbox PDDFUseProtein, pos={300,180}, title="\Zr120Protein", size={120,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFUseProtein, fColor=(65535,0,0), mode=1, help={"Run PDDF with setting for Proteins. Changes density and SLD"}
     1533        checkbox PDDFUseNucleicAcid, pos={450,180}, title="\Zr120Nucleic Acid", size={120,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFUseNucleicAcid, fColor=(65535,0,0), mode=1, help={"Run PDDF with settings from Nucleai acid. Changes density and SLD"}
     1534        Button CalculateMolecularWieght,pos={290,220},size={170,20}, proc=IRB1_PDDFButtonProc,title="Fit Rg and calculate MW", help={"Calculate Dmax on these data"}
     1535        //checkbox CalculateDmaxEstOnImport, pos={480,185}, title="Calc. on add data?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:CalculateDmaxEstOnImport, help={"Calculate Dmax when new data are added (useful when multiprocessing)"}
    15321536        //Unified fit/Porod analysis results
    1533         SetVariable FittedI0,pos={270,185},size={210,15}, noproc,title="Fitted I0                   =  ", variable=root:Packages:Irena:PDDFInterface:FittedI0, noedit=1,limits={0,inf,0},frame=0, help={"Porod Invariant calcualtion result"}
    1534         SetVariable FittedRg,pos={270,207},size={250,15}, noproc,title="Fitted Rg [A]            =  ", variable=root:Packages:Irena:PDDFInterface:FittedRg, noedit=1,limits={0,inf,0},frame=0, help={"Density of protein, user changeable, in g/cm3"}
    1535         SetVariable MWTrueVolumeA3,pos={270,229},size={250,15}, noproc,title="Porod Volume [A^3] =  ", variable=root:Packages:Irena:PDDFInterface:MWTrueVolumeA3, noedit=1,limits={0,inf,0},frame=0, help={"True Volume of protein in [cm3] "}
    1536         SetVariable MWMolecularWeightkDa,pos={270,251},size={250,15}, noproc,title="MW [kDa]              =  ", variable=root:Packages:Irena:PDDFInterface:MWMolecularWeightkDa, noedit=1,fstyle=1, fsize=13, limits={0,inf,0},frame=0, help={"Molecula weight in kDa"}
    1537 
    1538         //Gnom specifics
    1539         TitleBox PDDFInstructions5 title="\Zr120Main PDDF controls - method selection : ",size={430,15},pos={270,283},frame=0,fColor=(0,0,65535),labelBack=0
     1537        //SetVariable SAXSMoW2I0,pos={270,185},size={210,15}, noproc,title="Fitted I0                   =  ", variable=root:Packages:Irena:PDDFInterface:SAXSMoW2I0, noedit=1,limits={0,inf,0},frame=0, help={"Porod Invariant calcualtion result"}
     1538        //SetVariable SAXSMoW2Rg,pos={270,207},size={250,15}, noproc,title="Fitted Rg [A]            =  ", variable=root:Packages:Irena:PDDFInterface:SAXSMoW2Rg, noedit=1,limits={0,inf,0},frame=0, help={"Density of protein, user changeable, in g/cm3"}
     1539        SetVariable MWTrueVolumeA3,pos={270,250},size={250,15}, noproc,title="Porod Volume [A^3] =  ", variable=root:Packages:Irena:PDDFInterface:MWTrueVolumeA3, noedit=1,limits={0,inf,0},frame=0, help={"True Volume of protein in [cm3] "}
     1540        //SetVariable MWMolecularWeightkDa,pos={270,251},size={250,15}, noproc,title="MW [kDa]              =  ", variable=root:Packages:Irena:PDDFInterface:MWMolecularWeightkDa, noedit=1,fstyle=1, fsize=13, limits={0,inf,0},frame=0, help={"Molecula weight in kDa"}
     1541
     1542        //PDDF Gnom specifics
     1543        TitleBox PDDFInstructions5 title="\Zr120PDDF controls - method & parameters : ",size={430,15},pos={270,156},frame=0,fColor=(0,0,65535),labelBack=0
    15401544        //PDDFUseGNOM;PDDFuseMoore;PDDFuseregularization
    1541         checkbox PDDFUseGNOM, pos={270,310}, title="GNOM", size={80,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFUseGNOM, mode=1, help={"Run PDDF using ATSAS gnom"}
    1542         checkbox PDDFUseAutoGNOM, pos={340,310}, title="autoGNOM", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFUseAutoGNOM, mode=1, help={"Run PDDF using ATSAS datgnom"}
    1543         checkbox PDDFuseregularization, pos={430,310}, title="Irena Reg.", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFuseregularization,mode=1 , help={"Run PDDF using Irena regularization method"}
    1544         checkbox PDDFuseMoore, pos={530,310}, title="Moore", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFuseMoore,mode=1,  help={"Run PDDF using Irena Moore method"}
    1545 
    1546         TitleBox PDDFInstructions8 title="\Zr100Optional PDDF input parameters : ",size={500,15},pos={270,335},frame=0,fColor=(0,0,65535),labelBack=0
    1547 
    1548         checkbox GnomForceRmin0, pos={300,355}, title="Rmin==0?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:GnomForceRmin0, help={"Force Rmin=0 for Gnom"}
    1549         checkbox GnomForceRmax0, pos={440,355}, title="Rmax==0?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:GnomForceRmax0, help={"Force Dmax=0 for Gnom"}
    1550 
    1551         SetVariable GnomAlfaValue,pos={260,380},size={140,15}, noproc,title="Alfa in = ",variable=root:Packages:Irena:PDDFInterface:GnomAlfaValue, limits={0,5,0.1}, help={"Alfa value estimate for Gnom, if you know. ) for automatic"}
     1545        checkbox PDDFUseGNOM, pos={270,180}, title="GNOM", size={80,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFUseGNOM, mode=1, help={"Run PDDF using ATSAS gnom"}
     1546        checkbox PDDFUseAutoGNOM, pos={340,180}, title="autoGNOM", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFUseAutoGNOM, mode=1, help={"Run PDDF using ATSAS datgnom"}
     1547        checkbox PDDFuseregularization, pos={430,180}, title="Irena Reg.", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFuseregularization,mode=1 , help={"Run PDDF using Irena regularization method"}
     1548        checkbox PDDFuseMoore, pos={530,180}, title="Moore", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:PDDFuseMoore,mode=1,  help={"Run PDDF using Irena Moore method"}
     1549
     1550        TitleBox PDDFInstructions8 title="\Zr100Optional PDDF input parameters : ",size={500,15},pos={270,210},frame=0,fColor=(0,0,65535),labelBack=0
     1551        checkbox GnomForceRmin0, pos={300,235}, title="Rmin==0?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:GnomForceRmin0, help={"Force Rmin=0 for Gnom"}
     1552        checkbox GnomForceRmax0, pos={440,235}, title="Rmax==0?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:GnomForceRmax0, help={"Force Dmax=0 for Gnom"}
     1553        SetVariable GnomAlfaValue,pos={270,260},size={140,15}, noproc,title="Alfa in = ",variable=root:Packages:Irena:PDDFInterface:GnomAlfaValue, limits={0,5,0.1}, help={"Alfa value estimate for Gnom, if you know. ) for automatic"}
    15521554        //common settings
    1553         SetVariable NumBinsInR,pos={450,380},size={140,15}, noproc,title="R pnts in =",variable=root:Packages:Irena:PDDFInterface:NumBinsInR, limits={0,1000,20}, help={"Set to specific number (100) or leave to 0 for automatic"}
     1555        SetVariable NumBinsInR,pos={440,260},size={140,15}, noproc,title="R pnts in =",variable=root:Packages:Irena:PDDFInterface:NumBinsInR, limits={0,1000,20}, help={"Set to specific number (100) or leave to 0 for automatic"}
    15541556        //Dmax
    1555         SetVariable DmaxEstimate,pos={260,405},size={160,15}, noproc,title="Dmax Est = ", variable=root:Packages:Irena:PDDFInterface:DmaxEstimate, limits={1,3000,5}, format="%1.4g", help={"Estimate, change as needed"}
     1557        SetVariable DmaxEstimate,pos={270,290},size={160,15}, noproc,title="Dmax Est = ", variable=root:Packages:Irena:PDDFInterface:DmaxEstimate, limits={1,3000,5}, format="%1.4g", help={"Estimate, change as needed"}
    15561558        //Moore settings
    1557         SetVariable MooreNumFunctions,pos={450,405},size={140,15}, noproc,title="Num Func =",variable=root:Packages:Irena:PDDFInterface:MooreNumFunctions, limits={10,300,10}
    1558         checkbox MooreDetNumFunctions, pos={265,430}, title="Det Num Functions?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:MooreDetNumFunctions, help={"Determine number of functions"}
    1559         checkbox MooreFitMaxSize, pos={445,430}, title="Fit max size?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:MooreFitMaxSize, help={"Fit max size"}
     1559        SetVariable MooreNumFunctions,pos={440,290},size={140,15}, noproc,title="Num Func =",variable=root:Packages:Irena:PDDFInterface:MooreNumFunctions, limits={10,300,10}
     1560        checkbox MooreDetNumFunctions, pos={265,320}, title="Det Num Functions?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:MooreDetNumFunctions, help={"Determine number of functions"}
     1561        checkbox MooreFitMaxSize, pos={445,320}, title="Fit max size?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:MooreFitMaxSize, help={"Fit max size"}
    15601562        //run the fit
    1561         Button RunPDDFonData,pos={280,450},size={200,20}, proc=IRB1_PDDFButtonProc,title="Run PDDF on current data", help={"Run PDDF method of yoru choice on these data"}
    1562         Button RunSequenceofPDDF,pos={280,475},size={200,20}, proc=IRB1_PDDFButtonProc,title="Run PDDF on all selected", help={"Run GNOM on these data"}
     1563        Button RunPDDFonData,pos={300,350},size={200,20}, proc=IRB1_PDDFButtonProc,title="Run PDDF on current data", help={"Run PDDF method of yoru choice on these data"}
     1564        Button RunSequenceofPDDF,pos={300,375},size={200,20}, proc=IRB1_PDDFButtonProc,title="Run PDDF on all selected", help={"Run GNOM on these data"}
    15631565        //here we need some output values from GNOM, need space at leats for Alfa
    1564         SetVariable GNOMAlfaResult,pos={270,500},size={160,15}, noproc,title="GNOM Alfa out =",variable=root:Packages:Irena:PDDFInterface:GNOMAlfaResult,disable=0, noedit=1,limits={0,inf,0},frame=0
     1566        SetVariable GNOMAlfaResult,pos={270,400},size={160,15}, noproc,title="GNOM Alfa out =",variable=root:Packages:Irena:PDDFInterface:GNOMAlfaResult,disable=0, noedit=1,limits={0,inf,0},frame=0
     1567        TitleBox PDDFInstructions2 title="\Zr120MW estimate requires Absolute Intensity!",size={330,15},pos={270,420},frame=0,fColor=(0,0,65535),labelBack=0
     1568        SetVariable ConcentrationForCals,pos={270,440},size={220,15}, proc=IRB1_PDDFSetVarProc,title="c [mg/ml] =              ",variable=root:Packages:Irena:PDDFInterface:ConcentrationForCals,limits={0,inf,0.1}, help={"Concentration for MW calculations"}
    15651569        //will fit another 3 numbers here...
     1570        //ConcentrationForCals;ScattLengthDensDifference;PDDFCalculatedMW
     1571
    15661572
    15671573        //GNOM calculated results
    1568         TitleBox PDDFInstructions2 title="\Zr120MW estimated from Absolute Intensity:",size={330,15},pos={270,543},frame=0,fColor=(0,0,65535),labelBack=0
    1569         SetVariable CalculatedRg,pos={430,567},size={200,15}, noproc,title="GNOM Rg [A] = ",variable=root:Packages:Irena:PDDFInterface:CalculatedRg, disable=0, noedit=1,limits={0,inf,0},frame=0,fstyle=1, fsize=13
    1570         SetVariable CalculatedI0,pos={270,567},size={200,15}, noproc,title="GNOM I0 =     ",variable=root:Packages:Irena:PDDFInterface:CalculatedI0,  disable=0, noedit=1,limits={0,inf,0},frame=0,fstyle=1, fsize=13
    1571         //ConcentrationForCals;ScattLengthDensDifference;CalculatedMW
    1572         SetVariable ConcentrationForCals,pos={270,593},size={220,15}, proc=IRB1_PDDFSetVarProc,title="c [mg/ml] =              ",variable=root:Packages:Irena:PDDFInterface:ConcentrationForCals,limits={0,inf,0.1}, help={"Concentration for MW calculations"}
    1573         //SetVariable ScattLengthDensDifference,pos={270,610},size={220,15}, proc=IRB1_PDDFSetVarProc,title="SLD [10^10 cm^-2]= ",variable=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference,  limits={0.01,100,0.1}, help={"Scattering length density (without 10^10)"}
    1574         SetVariable CalculatedMW,pos={270,625},size={200,15}, noproc,title="Calculated MW [kDa] = ",variable=root:Packages:Irena:PDDFInterface:CalculatedMW, disable=0, noedit=1,limits={0,inf,0},frame=0,fstyle=1, fsize=13
     1574        TitleBox PDDFInstructions21 title="\Zr120Results :",size={330,15},pos={270,475},frame=0,fColor=(0,0,65535),labelBack=0
     1575        SetVariable SAXSMoW2I0,pos={260,500},size={200,15}, noproc,title="SAXSMoW2 I0 =   ", variable=root:Packages:Irena:PDDFInterface:SAXSMoW2I0, noedit=1,limits={0,inf,0},frame=0,size={180,17}, bodyWidth=70, help={"Porod Invariant calcualtion result"}, format="%4.2f"
     1576        SetVariable SAXSMoW2Rg,pos={470,500},size={120,17},bodyWidth=70, noproc,title="Rg [A]  = ", variable=root:Packages:Irena:PDDFInterface:SAXSMoW2Rg, noedit=1,limits={0,inf,0},frame=0, help={"Density of protein, user changeable, in g/cm3"}, format="%4.2f"
     1577        SetVariable MWMolecularWeightkDa,pos={300,520},size={250,15},bodyWidth=70, noproc,title="SAXSMoW2 MW [kDa]  =  ", variable=root:Packages:Irena:PDDFInterface:MWMolecularWeightkDa, noedit=1,fstyle=1, fsize=13, limits={0,inf,0},frame=0, help={"Molecular weight calculated from SAXSMoW2 method in kDa"}, fColor=(52428,1,1), format="%8.2f"
     1578        SetVariable RamboTainerMW,pos={300,550},size={250,15},bodyWidth=70, noproc,title="Rambo-Tainer MW [kDa] = ",variable=root:Packages:Irena:PDDFInterface:RamboTainerMW, disable=0, noedit=1,limits={0,inf,0},frame=0,fstyle=1, fsize=13, fColor=(52428,1,1), help={"Molecular weight calculated from Rambo-Tainer method in kDa"}, format="%8.2f"
     1579       
     1580        SetVariable PDDFCalculatedI0,pos={260,590},size={200,15}, noproc,title="PDDF I0 =   ",variable=root:Packages:Irena:PDDFInterface:PDDFCalculatedI0, disable=0, noedit=1,limits={0,inf,0},frame=0, size={180,17}, bodyWidth=70, help={"Porod Invariant calcualtion result"}, format="%4.2f"
     1581        SetVariable PDDFCalculatedRg,pos={470,590},size={120,17},bodyWidth=70, noproc,title="Rg [A] =     ",variable=root:Packages:Irena:PDDFInterface:PDDFCalculatedRg,  disable=0, noedit=1,limits={0,inf,0},frame=0, format="%4.2f"
     1582        SetVariable PDDFCalculatedMW,pos={300,620},size={250,15},bodyWidth=70, noproc,title="PDDF MW [kDa] = ",variable=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW, disable=0, noedit=1,limits={0,inf,0},frame=0,fstyle=1, fsize=13, fColor=(52428,1,1), help={"Molecular weight calculated from PDDF method in kDa"}, format="%8.2f"
     1583
     1584
    15751585        //Controls for results 
    15761586        TitleBox PDDFInstructions3 title="\Zr110Save results controls : ",size={200,15},pos={270,655},frame=0,fColor=(0,0,65535),labelBack=0
     
    15801590        checkbox SaveToWavesAutomatically, pos={495,715}, title="Waves", size={76,14},noproc, variable=root:Packages:Irena:PDDFInterface:SaveToWavesAutomatically, mode=0, help={"Save to notebook when running sequence"}
    15811591
     1592//results presentation for all methods...
     1593
     1594
     1595
     1596
    15821597        Button SavePDDFresults,pos={300,680},size={180,20}, proc=IRB1_PDDFButtonProc,title="Save PDDF results", help={"Save PDDF results to folder"}
    15831598        Button OpenResultsAndTable,pos={300,710},size={180,15}, proc=IRB1_PDDFButtonProc,title="Open Table and Notebook", help={"Open Table and Notebook with results"}
     
    16091624
    16101625       
    1611         IRB1_PDDFSetControls()
    1612 end
    1613 //**********************************************************************************************************
    1614 //**********************************************************************************************************
    1615 Function IRB1_PDDFSetControls()
    1616        
    1617         NVAR PDDFUseGNOM                                        =root:Packages:Irena:PDDFInterface:PDDFUseGNOM
    1618         NVAR PDDFuseMoore                                       =root:Packages:Irena:PDDFInterface:PDDFuseMoore
    1619         NVAR PDDFuseregularization              =root:Packages:Irena:PDDFInterface:PDDFuseregularization
    1620         NVAR PDDFUseAutoGNOM                            =root:Packages:Irena:PDDFInterface:PDDFUseAutoGNOM
    1621 
    1622         checkbox GnomForceRmin0, win=IRB1_PDDFInterfacePanel, disable=!PDDFUseGNOM
    1623         checkbox GnomForceRmax0, win=IRB1_PDDFInterfacePanel, disable=!PDDFUseGNOM
    1624         SetVariable GnomAlfaValue, win=IRB1_PDDFInterfacePanel, disable=!PDDFUseGNOM
    1625         //common settings
    1626         SetVariable NumBinsInR, win=IRB1_PDDFInterfacePanel, disable=PDDFUseAutoGNOM
    1627         //Moore settings
    1628         SetVariable MooreNumFunctions, win=IRB1_PDDFInterfacePanel, disable=!PDDFuseMoore
    1629         checkbox MooreDetNumFunctions, win=IRB1_PDDFInterfacePanel, disable=!PDDFuseMoore
    1630         checkbox MooreFitMaxSize, win=IRB1_PDDFInterfacePanel, disable=!PDDFuseMoore
    1631 end
     1626        IRB1_PDDFFixTabControls(0)
     1627end
     1628//**********************************************************************************************************
     1629//**********************************************************************************************************
    16321630//**********************************************************************************************************
    16331631//**********************************************************************************************************
     
    16801678
    16811679//**************************************************************************************
    1682 
     1680//**************************************************************************************
     1681//**************************************************************************************
     1682//**************************************************************************************
     1683Function IRB1_PDDFTabProc(tca) : TabControl
     1684        STRUCT WMTabControlAction &tca
     1685
     1686        switch( tca.eventCode )
     1687                case 2: // mouse up
     1688                        Variable tab = tca.tab
     1689                        //do something here
     1690                        IRB1_PDDFFixTabControls(tab)
     1691                        break
     1692                case -1: // control being killed
     1693                        break
     1694        endswitch
     1695
     1696        return 0
     1697End
     1698//**************************************************************************************
     1699//**************************************************************************************
     1700//**************************************************************************************
     1701
     1702
     1703static Function IRB1_PDDFFixTabControls(whichTab)
     1704                variable whichTab
     1705                //whichTab=0 for PDDF, whichTab=1 for MW methods.
     1706               
     1707        NVAR PDDFUseGNOM                                        =root:Packages:Irena:PDDFInterface:PDDFUseGNOM
     1708        NVAR PDDFuseMoore                                       =root:Packages:Irena:PDDFInterface:PDDFuseMoore
     1709        NVAR PDDFuseregularization              =root:Packages:Irena:PDDFInterface:PDDFuseregularization
     1710        NVAR PDDFUseAutoGNOM                            =root:Packages:Irena:PDDFInterface:PDDFUseAutoGNOM
     1711
     1712        //MW controls
     1713        checkbox PDDFUseProtein, win=IRB1_PDDFInterfacePanel, disable = (whichTab!=1)
     1714        checkbox PDDFUseNucleicAcid, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=1)
     1715        TitleBox PDDFInstructions1, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=1)
     1716        Button CalculateMolecularWieght, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=1)
     1717        SetVariable MWTrueVolumeA3, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=1)
     1718        //PDDF Gnom specifics
     1719        TitleBox PDDFInstructions5, win=IRB1_PDDFInterfacePanel,   disable = (whichTab!=0)
     1720//      //PDDFUseGNOM;PDDFuseMoore;PDDFuseregularization
     1721        checkbox PDDFUseGNOM, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=0)
     1722        checkbox PDDFUseAutoGNOM, win=IRB1_PDDFInterfacePanel,   disable = (whichTab!=0)
     1723        checkbox PDDFuseregularization, win=IRB1_PDDFInterfacePanel,   disable = (whichTab!=0)
     1724        checkbox PDDFuseMoore, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=0)
     1725        TitleBox PDDFInstructions8, win=IRB1_PDDFInterfacePanel,   disable = (whichTab!=0)
     1726
     1727        checkbox GnomForceRmin0, win=IRB1_PDDFInterfacePanel, disable=(whichTab!=0 || !PDDFUseGNOM)
     1728        checkbox GnomForceRmax0, win=IRB1_PDDFInterfacePanel, disable=(whichTab!=0 ||!PDDFUseGNOM)
     1729        SetVariable GnomAlfaValue, win=IRB1_PDDFInterfacePanel, disable=(whichTab!=0 ||!PDDFUseGNOM)
     1730        //common settings
     1731        SetVariable NumBinsInR, win=IRB1_PDDFInterfacePanel, disable=(whichTab!=0 || PDDFUseAutoGNOM)
     1732        //Moore settings
     1733        SetVariable MooreNumFunctions, win=IRB1_PDDFInterfacePanel, disable=(whichTab!=0 ||!PDDFuseMoore)
     1734        checkbox MooreDetNumFunctions, win=IRB1_PDDFInterfacePanel, disable=(whichTab!=0 ||!PDDFuseMoore)
     1735        checkbox MooreFitMaxSize, win=IRB1_PDDFInterfacePanel, disable=(whichTab!=0 ||!PDDFuseMoore)
     1736        TitleBox PDDFInstructions2, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=0)
     1737        SetVariable DmaxEstimate, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=0)
     1738        Button RunPDDFonData, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=0)
     1739        Button RunSequenceofPDDF, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=0)
     1740        SetVariable GNOMAlfaResult, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=0)
     1741        SetVariable ConcentrationForCals, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=0)
     1742end
    16831743//**********************************************************************************************************
    16841744//**********************************************************************************************************
     
    17081768                                        PDDFUseAutoGNOM = 0
    17091769                                endif
    1710                                 IRB1_PDDFSetControls()
     1770                                IRB1_PDDFFixTabControls(0)
    17111771                        endif
    17121772                        if(stringmatch(cba.ctrlname,"PDDFUseAutoGNOM"))
     
    17171777                                        PDDFUseAutoGNOM = 1
    17181778                                endif
    1719                                 IRB1_PDDFSetControls()
     1779                                IRB1_PDDFFixTabControls(0)
    17201780                        endif
    17211781                        if(stringmatch(cba.ctrlname,"PDDFuseMoore"))
     
    17261786                                        PDDFUseAutoGNOM = 0
    17271787                                endif
    1728                                 IRB1_PDDFSetControls()
     1788                                IRB1_PDDFFixTabControls(0)
    17291789                        endif
    17301790                        if(stringmatch(cba.ctrlname,"PDDFuseregularization"))
     
    17351795                                        PDDFUseAutoGNOM = 0
    17361796                                endif
    1737                                 IRB1_PDDFSetControls()
     1797                                IRB1_PDDFFixTabControls(0)
    17381798                        endif
    17391799                        if(stringmatch(cba.ctrlname,"PDDFUseProtein"))
     
    18051865                                IN2G_OpenWebManual("Irena/ImportData.html")                             //fix me!!                     
    18061866                        endif
    1807                         if(stringMatch(ba.ctrlName,"CalculateDmaxOnData"))
    1808                                 IRB1_PDDFEstimateRgAndDmax()
     1867                        if(stringMatch(ba.ctrlName,"CalculateMolecularWieght"))
     1868                                IRB1_PDDFFitAndCalculateMW()
    18091869                        endif
    18101870                        if(stringMatch(ba.ctrlName,"OpenResultsAndTable"))
     
    18781938Function IRB1_PDDFCalculateRgI0()
    18791939
    1880         NVAR CalcRg=root:Packages:Irena:PDDFInterface:CalculatedRg
    1881         NVAR CalcI0=root:Packages:Irena:PDDFInterface:CalculatedI0
     1940        NVAR CalcRg=root:Packages:Irena:PDDFInterface:PDDFCalculatedRg
     1941        NVAR CalcI0=root:Packages:Irena:PDDFInterface:PDDFCalculatedI0
    18821942        Wave Radius = root:Packages:Irena:PDDFInterface:pddfRadius
    18831943        Wave Pr = root:Packages:Irena:PDDFInterface:pddfPr
    18841944        NVAR ConcentrationForCals=root:Packages:Irena:PDDFInterface:ConcentrationForCals
    18851945        NVAR ScattLengthDensDifference=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference
    1886         NVAR CalculatedMW=root:Packages:Irena:PDDFInterface:CalculatedMW
     1946        NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
    18871947       
    18881948        Duplicate/Free Pr, R2Pr
    18891949        R2Pr = Radius^2 * Pr
    18901950       
    1891         CalcI0 = 4*pi*areaXY(Radius, Pr )
    1892        
    1893         CalcRg = sqrt(areaXY(Radius, R2Pr )/areaXY(Radius, Pr ))
    1894        
    1895         CalculatedMW = 6.023e23*CalcI0/(ConcentrationForCals*(ScattLengthDensDifference*1e10)^2)
    1896 
    1897 end
    1898 //**********************************************************************************************************
    1899 //**********************************************************************************************************
    1900 
    1901 static Function IRB1_PDDFEstimateRgAndDmax()
     1951        //CalcI0 = 4*pi*areaXY(Radius, Pr )
     1952       
     1953        //CalcRg = sqrt(areaXY(Radius, R2Pr )/areaXY(Radius, Pr ))
     1954       
     1955        PDDFCalculatedMW = 6.023e23*CalcI0/(ConcentrationForCals*(ScattLengthDensDifference*1e10)^2)
     1956
     1957end
     1958//**********************************************************************************************************
     1959//**********************************************************************************************************
     1960
     1961static Function IRB1_PDDFFitAndCalculateMW()
    19021962        //copy of IR2Pr_EstimateDmax
    19031963
     
    19241984        Rg = 2/GetQAtRg
    19251985        B = OriginalIntensity[V_levelX]*OriginalQvector[V_levelX]^4
     1986        Make /N=4/O W_coef, LocalEwave
     1987        Make/N=4/T/O T_Constraints
     1988        T_Constraints[0] = {"K1 > 0"}
     1989        T_Constraints[1] = {"K0 > 0"}
     1990        T_Constraints[2] = {"K2 > 0"}
     1991        T_Constraints[3] = {"K3 > 2"}
     1992        //T_Constraints[4] = {"K4 >=0 "}
     1993        Variable V_FitError=0                   //This should prevent errors from being generated
     1994        W_coef[0]=G     //G
     1995        W_coef[1]=Rg    //Rg
     1996        W_coef[2]=B     //B
     1997        W_coef[3]=3.2   //Porod slope
     1998        //W_coef[4]=OriginalIntensity[numpnts(OriginalIntensity)-20]    //background
     1999        FuncFit/Q IRB1_PDDFIntensityFit W_coef OriginalIntensity[AcsrPnt,BcsrPnt]  /X=OriginalQvector /C=T_Constraints /W=OriginalError /I=1//E=LocalEwave
     2000        if (V_FitError!=0)      //there was error in fitting
     2001                beep
     2002                Abort "Fitting error, Cannot fit Rg"
     2003        endif
     2004        //Store Unified fit results.
     2005        G = w_coef[0]
     2006        Rg = w_coef[1]
     2007        B = w_coef[2]
     2008        variable PorodSLope=w_coef[3]
     2009        //variable Background = w_coef[4]
     2010        //these are globasl for them
     2011        NVAR SAXSMoW2I0=root:Packages:Irena:PDDFInterface:SAXSMoW2I0
     2012        NVAR SAXSMoW2Rg=root:Packages:Irena:PDDFInterface:SAXSMoW2Rg
     2013        SAXSMoW2I0 = G
     2014        SAXSMoW2Rg = Rg
     2015        //calculate Intensity to display
     2016        Duplicate/O OriginalIntensity, QstarVector, FitScattareingProfile
     2017        QstarVector = OriginalQvector / (erf(OriginalQvector*w_coef[1]/sqrt(6)))^3
     2018        FitScattareingProfile =  w_coef[0]*exp(-OriginalQvector^2*w_coef[1]^2/3)+(w_coef[2]/QstarVector^w_coef[3])// + w_coef[4]
     2019        CheckDisplayed /W=IRB1_PDDFInterfacePanel#DataDisplay  FitScattareingProfile 
     2020        if(!V_flag)
     2021                GetAxis /W=IRB1_PDDFInterfacePanel#DataDisplay /Q left
     2022                AppendToGraph  /W=IRB1_PDDFInterfacePanel#DataDisplay  FitScattareingProfile  vs OriginalQvector
     2023                ModifyGraph /W=IRB1_PDDFInterfacePanel#DataDisplay lstyle(FitScattareingProfile)=2,lsize(FitScattareingProfile)=1
     2024                ModifyGraph /W=IRB1_PDDFInterfacePanel#DataDisplay rgb(FitScattareingProfile)=(1,3,39321)
     2025        endif
     2026        SetAxis/W=IRB1_PDDFInterfacePanel#DataDisplay/A left
     2027        //set Dmax for the future...
     2028        //NVAR Dmax=root:Packages:Irena:PDDFInterface:DmaxEstimate
     2029        //Dmax=2.5*abs(W_coef[1])
     2030        //now method 1 how to calcualet MW:     
     2031        //calculate Molecular weight using SAXSMol2 method...
     2032        //now, calculate invariant.
     2033        //In this case we follow manuscript for SAXSMoW 2.0, DOI: 10.1002/pro.3528
     2034        //Vassili Piadov, Evandro Ares de Araújo, Mario Oliveira Neto,  Aldo Felix Craievich, and Igor Polikarpov
     2035        //PROTEIN SCIENCE 2019 | VOL 28:454–463
     2036        //use Model data below ~ 0.6*pi/Rg and real data above this as needed...
     2037        NVAR MWPorodInvariant=root:Packages:Irena:PDDFInterface:MWPorodInvariant
     2038        NVAR MWTrueVolumeA3=root:Packages:Irena:PDDFInterface:MWTrueVolumeA3
     2039        NVAR MWMassDensityProtein=root:Packages:Irena:PDDFInterface:MWMassDensityProtein                        //g/cm3, see line after formula 11
     2040        NVAR MWMolecularWeightkDa=root:Packages:Irena:PDDFInterface:MWMolecularWeightkDa
     2041        variable changeOverQmax = 8/Rg                                                                                                                                                  //formula 7
     2042        //alternative is to pick changeOverQmax based on Formula 8, so log(I(o)/I(gmax) ~ 2.25, formula 7 is easier, keep for now...
     2043        Make/Free/N=10000 InvariantIntWv, InvariantQWv, InvarQstar, InvarIntQ2
     2044        InvariantQWv            =       p*(changeOverQmax/(numpnts(InvariantQWv)-1))+0.00002                                    //this creates Q wave between 0.00002 and qmax
     2045        InvarQstar                      =       InvariantQWv / (erf(InvariantQWv*Rg/sqrt(6)))^3                                                 //Q* for Unified level
     2046        InvariantIntWv          =       G*exp(-InvariantQWv^2*Rg^2/3)+(B/InvarQstar^PorodSLope)                 //no background Unified intensity
     2047        //now we need to replace intensity from somethign around 0.6*pi/Rg with experimental intensity
     2048        variable QValueToChange         =       0.4*pi/Rg
     2049        variable ChangeToRealIntP       =       BinarySearch(InvariantQWv,QValueToChange )
     2050        InvariantIntWv[ChangeToRealIntP, ] = OriginalIntensity[BinarySearchInterp(OriginalQvector, InvariantQWv[p])]
     2051        //done, this shoudl now have attached tail of real data...
     2052        InvarIntQ2 = InvariantIntWv * InvariantQWv^2                                                                                    //I * Q^2
     2053        MWPorodInvariant = areaXY(InvariantQWv, InvarIntQ2)                                                                     //this is from Q=0 to Q=changeOverQmax
     2054        variable Vprime = 2*pi^2*G/MWPorodInvariant                                                                                             //this is formula 5
     2055        //setup the weird approximation of missing tail correction for invariant...
     2056        //this is formula 10
     2057        variable Aval = -2.114e6 * changeOverQmax^4 + 2.920e6 * changeOverQmax^3 - 1.472e6*changeOverQmax^2 + 3.349e5*changeOverQmax - 3.577e4
     2058        variable Bval = 12.09*changeOverQmax^3 - 9.39*changeOverQmax^2 + 3.03*changeOverQmax + 0.29
     2059        MWTrueVolumeA3  = Aval + Bval*Vprime                                                                                                            //this is in A^3
     2060        //formula 11
     2061        MWMolecularWeightkDa = MWMassDensityProtein*MWTrueVolumeA3* 1e-24       /1.662e-21                     
     2062        //this ends calculations for SAXSMoW2 ...
     2063        //***
     2064        //now method from Rambo-Tainer, doi:10.1038/nature12070, Nature 2013, vol. 496, pg 477
     2065        //Accurate assessment of mass, models and resolution by small-angle scattering
     2066        //here is what this does:
     2067        //1. Calculate Vc = I(0)/2*pi*Lc= I(0)/IntgQ*I(Q)dQ
     2068        //calculate Qr (really, do we really have to use Q in some many meanings???) Qr=Vc^2/Rg         [A^3]
     2069        //and now they plotted for Proteins and Nucelic acis separate dependnecies... Got approximately linar depency
     2070        // ln(Q) = a* ln(MW) + b
     2071        // protein MW= (Qr/0.1231)^1.0
     2072        //Nucelic acid MW= (Qr/0.00934)^0.808
     2073        //but first , we need to fit data with background also:
    19262074        Make /N=5/O W_coef, LocalEwave
    19272075        Make/N=5/T/O T_Constraints
     
    19302078        T_Constraints[2] = {"K2 > 0"}
    19312079        T_Constraints[3] = {"K3 > 2"}
    1932         T_Constraints[4] = {"K4 > 0"}
    1933         Variable V_FitError=0                   //This should prevent errors from being generated
     2080        T_Constraints[4] = {"K4 >=0 "}
     2081        V_FitError=0                    //This should prevent errors from being generated
    19342082        W_coef[0]=G     //G
    19352083        W_coef[1]=Rg    //Rg
     
    19372085        W_coef[3]=3.2   //Porod slope
    19382086        W_coef[4]=OriginalIntensity[numpnts(OriginalIntensity)-20]      //background
    1939         FuncFit IRB1_PDDFIntensityFit W_coef OriginalIntensity[AcsrPnt,]  /X=OriginalQvector /C=T_Constraints //W=OriginalError //I=1//E=LocalEwave
     2087        FuncFit/Q IRB1_PDDFIntensityFitBckg W_coef OriginalIntensity[AcsrPnt, ]  /X=OriginalQvector /C=T_Constraints /W=OriginalError /I=1//E=LocalEwave
    19402088        if (V_FitError!=0)      //there was error in fitting
    19412089                beep
     
    19432091        endif
    19442092        //Store Unified fit results.
    1945         G = w_coef[0]
    1946         Rg = w_coef[1]
    1947         B = w_coef[2]
    1948         variable PorodSLope=w_coef[3]
    1949         variable Background = w_coef[4]
    1950         //these are globasl for them
    1951         NVAR FittedI0=root:Packages:Irena:PDDFInterface:FittedI0
    1952         NVAR FittedRg=root:Packages:Irena:PDDFInterface:FittedRg
    1953         FittedI0 = G
    1954         FittedRg = Rg
    1955         //calculate Intensity to display
    1956         Duplicate/O OriginalIntensity, QstarVector, FitScattareingProfile
    1957         QstarVector = OriginalQvector / (erf(OriginalQvector*w_coef[1]/sqrt(6)))^3
    1958         FitScattareingProfile =  w_coef[0]*exp(-OriginalQvector^2*w_coef[1]^2/3)+(w_coef[2]/QstarVector^w_coef[3]) + w_coef[4]
    1959         CheckDisplayed /W=IRB1_PDDFInterfacePanel#DataDisplay  FitScattareingProfile 
    1960         if(!V_flag)
    1961                 GetAxis /W=IRB1_PDDFInterfacePanel#DataDisplay /Q left
    1962                 AppendToGraph  /W=IRB1_PDDFInterfacePanel#DataDisplay  FitScattareingProfile  vs OriginalQvector
    1963                 ModifyGraph /W=IRB1_PDDFInterfacePanel#DataDisplay lstyle(FitScattareingProfile)=2,lsize(FitScattareingProfile)=1
    1964                 ModifyGraph /W=IRB1_PDDFInterfacePanel#DataDisplay rgb(FitScattareingProfile)=(1,3,39321)
    1965         endif
    1966         SetAxis/W=IRB1_PDDFInterfacePanel#DataDisplay/A left
    1967         //set Dmax for the future...
    1968         NVAR Dmax=root:Packages:Irena:PDDFInterface:DmaxEstimate
    1969         Dmax=2.5*abs(W_coef[1])
    1970         //calculate Molecula weight using SAXSMol2 method...
    1971         //now, calculate invariant.
    1972         //In this case we follow manuscript for SAXSMoW 2.0, DOI: 10.1002/pro.3528
    1973         //Vassili Piadov, Evandro Ares de Araújo, Mario Oliveira Neto,  Aldo Felix Craievich, and Igor Polikarpov
    1974         //PROTEIN SCIENCE 2019 | VOL 28:454–463
    1975         NVAR MWPorodInvariant=root:Packages:Irena:PDDFInterface:MWPorodInvariant
    1976         NVAR MWTrueVolumeA3=root:Packages:Irena:PDDFInterface:MWTrueVolumeA3
    1977         NVAR MWMassDensityProtein=root:Packages:Irena:PDDFInterface:MWMassDensityProtein                        //g/cm3, seel line after formula 11
    1978         NVAR MWMolecularWeightkDa=root:Packages:Irena:PDDFInterface:MWMolecularWeightkDa
    1979         variable changeOverQmax = 8/Rg                                  //formula 7
    1980         //alternative is to pick changeOverQmax based on Formula 8, so log(I(o)/I(gmax) ~ 2.25, formula 7 is easier, keep for now...
    1981         Make/O/N=10000 InvariantIntWv, InvariantQWv, InvarQstar, InvarIntQ2
    1982         InvariantQWv = p*(changeOverQmax/(numpnts(InvariantQWv)-1))+0.00002                             //this creates Q wave between 0.00002 and qmax
    1983         InvarQstar = InvariantQWv / (erf(InvariantQWv*Rg/sqrt(6)))^3                                            //Q* for Unified level
    1984         InvariantIntWv = G*exp(-InvariantQWv^2*Rg^2/3)+(B/InvarQstar^PorodSLope)                //no background Unified intensity
    1985         InvarIntQ2 = InvariantIntWv * InvariantQWv^2                                                                                    //I * Q^2
    1986         MWPorodInvariant = areaXY(InvariantQWv, InvarIntQ2)                                                     //this is from Q=0 to Q=changeOverQmax
    1987         variable Vprime = 2*pi^2*G/MWPorodInvariant                                                                                             //this is formula 5
    1988         //setup the weird approximation of missing tail correction for invariant...
    1989         //this is formula 10
    1990         variable Aval = -2.114e6 * changeOverQmax^4 + 2.920e6 * changeOverQmax^3 - 1.472e6*changeOverQmax^2 + 3.349e5*changeOverQmax - 3.577e4
    1991         variable Bval = 12.09*changeOverQmax^3 - 9.39*changeOverQmax^2 + 3.03*changeOverQmax + 0.29
    1992         MWTrueVolumeA3  = Aval + Bval*Vprime                                                                            //this is in A^3
    1993         //formula 11
    1994         MWMolecularWeightkDa = MWMassDensityProtein*MWTrueVolumeA3* 1e-24       /1.662e-21                     
     2093        variable RTB, RTG, RTRg, RTP, RTBackground
     2094        RTG = w_coef[0]
     2095        RTRg = w_coef[1]
     2096        RTB = w_coef[2]
     2097        RTP =   w_coef[3]
     2098        RTBackground =  w_coef[4]
     2099        //QstarVector = OriginalQvector / (erf(OriginalQvector*w_coef[1]/sqrt(6)))^3
     2100        //FitScattareingProfile =  w_coef[0]*exp(-OriginalQvector^2*w_coef[1]^2/3)+(w_coef[2]/QstarVector^w_coef[3]) + w_coef[4]
     2101
     2102        //now, fron this excersize we really need only the background...
     2103        NVAR RamboTainerMW=root:Packages:Irena:PDDFInterface:RamboTainerMW
     2104        NVAR PDDFUseNucleicAcid=root:Packages:Irena:PDDFInterface:PDDFUseNucleicAcid
     2105        NVAR PDDFUseProtein=root:Packages:Irena:PDDFInterface:PDDFUseProtein
     2106        Make/Free/N=10000 RamboTainerIntQ, RamboTainerQ, RamboTainerInt, RamboTainerQstar
     2107        variable Qmaxmeasured=OriginalQvector[numpnts(OriginalQvector)-3]
     2108        RamboTainerQ = p*(Qmaxmeasured/(numpnts(InvariantQWv)-1))+0.00002                               //this creates Q wave between 0.00002 and qmax measured
     2109        RamboTainerQstar = RamboTainerQ / (erf(RamboTainerQ*Rg/sqrt(6)))^3     
     2110        RamboTainerInt = G*exp(-RamboTainerQ^2*Rg^2/3)+(B/RamboTainerQstar^PorodSLope)
     2111        ChangeToRealIntP=BinarySearch(RamboTainerQ,QValueToChange )
     2112        RamboTainerInt[ChangeToRealIntP, ] = OriginalIntensity[BinarySearchInterp(OriginalQvector, RamboTainerQ[p])]
     2113        RamboTainerInt -= RTBackground                                          //this subtract approximate background from the data.
     2114        RamboTainerIntQ = RamboTainerInt*RamboTainerQ
     2115        //***                   Qmax for integration of Q*I(Q) is challenge...
     2116        //Qmax of 0.3 seems to work for BSA test data, but is likely sampel independent, which seems wrong...
     2117        //FindLevel/P  RamboTainerInt, RTG/1000
     2118        //print RamboTainerQ[V_LevelX]                          this is similar to SAXSMoW2 paper, where they set log(I(0)/I(Qmax)) ~ 2 ... 2.5 in our case that is 3.
     2119        //print 8/RTRg                                                                  this is SAXSMoW2 paper standard qmax. They do have corrections to fix infinite integral, we do not...
     2120        //for now use 8/Rg
     2121        variable maxQforRamboTainer = 8/RTRg                                           
     2122        variable IntgQIQ=areaXY(RamboTainerQ, RamboTainerIntQ, 0, maxQforRamboTainer )
     2123        //variable i
     2124        //for(i=0.1;i<1;i+=0.1)
     2125        //      print " Qmax = "+num2str(i)+" Intg(QI(Q) = "+num2str(areaXY(RamboTainerQ, RamboTainerIntQ, 0, i ))
     2126        //endfor
     2127        variable RTVc           =       SAXSMoW2I0/IntgQIQ
     2128        variable RTQr           =       (RTVc)^2 / SAXSMoW2Rg
     2129        if(PDDFUseProtein)
     2130                RamboTainerMW   =       (RTQr/0.1231)^1.0
     2131                RamboTainerMW   /=      1000                                            //convert to kDA from DA               
     2132        elseif(PDDFUseNucleicAcid)
    19952133        //Update tag result...
    1996         string Tagtext="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"Fitted Rg [A] = "+num2str(Rg)+"\r"
    1997         Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"Fitted I0 = "+num2str(G)+"\r"
    1998         Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"Protein Vol [cm3] = "+num2str(MWTrueVolumeA3)+"\r"
    1999         Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"MW [kDa] = "+num2str(MWMolecularWeightkDa)
     2134                RamboTainerMW   =       (RTQr/0.00934)^0.808
     2135                RamboTainerMW   /=      1000                                            //convert to kDA from DA               
     2136        endif
     2137        string Tagtext="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"SAXSMoW2 Rg [A] = "+num2str(Rg)+"\r"
     2138        Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"I0 = "+num2str(G)
     2139        //Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"Protein Vol [cm3] = "+num2str(MWTrueVolumeA3)+"\r"
     2140        Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"     MW [kDa] = "+num2str(MWMolecularWeightkDa)
    20002141        Tag/C/N=GuessRg/A=LT/L=0/TL=0/W=IRB1_PDDFInterfacePanel#DataDisplay FitScattareingProfile, numpnts(FitScattareingProfile)/10,Tagtext
    20012142       
     
    20072148
    20082149Function IRB1_PDDFIntensityFit(w,q) : FitFunc
     2150        Wave w
     2151        Variable q
     2152
     2153        //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will
     2154        //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog.
     2155        //CurveFitDialog/ Equation:
     2156        //CurveFitDialog/ Prefactor=abs(Prefactor)
     2157        //CurveFitDialog/ Rg=abs(Rg)
     2158        //CurveFitDialog/ f(q) = Prefactor*exp(-q^2*Rg^2/3))
     2159        //CurveFitDialog/ End of Equation
     2160        //CurveFitDialog/ Independent Variables 1
     2161        //CurveFitDialog/ q
     2162        //CurveFitDialog/ Coefficients 2
     2163        //CurveFitDialog/ w[0] = Prefactor
     2164        //CurveFitDialog/ w[1] = Rg
     2165        //CurveFitDialog/ w[2] = Porod prefactor
     2166        //CurvefitDialog/ w[3] = PorodSlope
     2167
     2168        w[0]=abs(w[0])
     2169        w[1]=abs(w[1])
     2170        w[2]=abs(w[2])
     2171        w[3]=abs(W[3])
     2172        variable qstar=q/(erf(q*w[1]/sqrt(6)))^3
     2173        return w[0]*exp(-q^2*w[1]^2/3)+(w[2]/qstar^w[3])
     2174        //       QstarVector=QvectorWave/(erf(QvectorWave*Rg/sqrt(6)))^3
     2175        //  G*exp(-QvectorWave^2*Rg^2/3)+(B/QstarVector^P)
     2176
     2177End
     2178//*****************************************************************************************************************
     2179//*****************************************************************************************************************
     2180
     2181Function IRB1_PDDFIntensityFitBckg(w,q) : FitFunc
    20092182        Wave w
    20102183        Variable q
     
    20262199        //CurvefitDialog/ w[4] = Background
    20272200
     2201        //       QstarVector=QvectorWave/(erf(QvectorWave*Rg/sqrt(6)))^3
     2202        //  G*exp(-QvectorWave^2*Rg^2/3)+(B/QstarVector^P) + background
     2203
    20282204        w[0]=abs(w[0])
    20292205        w[1]=abs(w[1])
    20302206        w[2]=abs(w[2])
    20312207        w[3]=abs(W[3])
    2032         w[4]=abs(W[4])
    20332208        variable qstar=q/(erf(q*w[1]/sqrt(6)))^3
    20342209        return w[0]*exp(-q^2*w[1]^2/3)+(w[2]/qstar^w[3])+w[4]
    2035         //       QstarVector=QvectorWave/(erf(QvectorWave*Rg/sqrt(6)))^3
    2036         //  G*exp(-QvectorWave^2*Rg^2/3)+(B/QstarVector^P)
    2037 
    20382210End
     2211
     2212//*****************************************************************************************************************
     2213//*****************************************************************************************************************
    20392214
    20402215//*****************************************************************************************************************
     
    22412416        //import GNOM output file in Irena
    22422417        SetDataFolder root:Packages:Irena:PDDFInterface
    2243         make/O/N=60/T GNOMHeaderTextWave       
    2244         GNOMHeaderTextWave = ""
    2245         variable refNum, i
     2418        make/O/N=5000/T GNOMOutFileTextWave     
     2419        GNOMOutFileTextWave = ""
     2420        variable refNum, i=0
    22462421        string TmpStr
    22472422        Open /P=ATSASWorkPath/R refNum  as "DataOut.out"
    2248         For(i=0;i<60;i+=1)
     2423        Do
     2424                TmpStr = ""
    22492425                FReadLine /T="\n" refNum, TmpStr
    2250                 GNOMHeaderTextWave[i]=TmpStr
    2251                 TmpStr = ""
    2252         endfor
     2426                GNOMOutFileTextWave[i]=TmpStr
     2427                i+=1
     2428        while(strlen(TmpStr)>0)
    22532429        close refNum
     2430        redimension/N=(i) GNOMOutFileTextWave
    22542431        KillDataFolder/Z root:Packages:Irena:PDDFTemp
    22552432        NewDataFolder/O/S root:Packages:Irena:PDDFTemp 
     
    22982475        pddfModelIntExtrap[numpnts(pddfModelIntGunierSt), ] = pddfModelIntGunier[p-numpnts(pddfModelIntGunierSt)]
    22992476        //now parse this into a document and alfa
    2300         Wave/T GNOMHeaderTextWave = root:Packages:Irena:PDDFInterface:GNOMHeaderTextWave
     2477        Wave/T GNOMOutFileTextWave = root:Packages:Irena:PDDFInterface:GNOMOutFileTextWave
     2478        //read values from out file... 
    23012479        NVAR GNOMAlfaResult = root:Packages:Irena:PDDFInterface:GNOMAlfaResult
     2480        NVAR PDDFCalculatedRg = root:Packages:Irena:PDDFInterface:PDDFCalculatedRg
     2481        NVAR PDDFCalculatedI0 = root:Packages:Irena:PDDFInterface:PDDFCalculatedI0
    23022482        make/Free/T/N=0 TempStrWave
    2303         Grep /E="Current ALPHA:" GNOMHeaderTextWave as TempStrWave     
     2483        Grep /E="Current ALPHA:" GNOMOutFileTextWave as TempStrWave     
    23042484        GNOMAlfaResult = str2num(StringFromList(1, TempStrWave[0]+":", ":"))
     2485        Grep /E="Real space Rg:" GNOMOutFileTextWave as TempStrWave     
     2486        PDDFCalculatedRg = str2num(StringFromList(1, TempStrWave[0]+":", ":"))
     2487        Grep /E="Real space I" GNOMOutFileTextWave as TempStrWave       
     2488        PDDFCalculatedI0 = str2num(StringFromList(1, TempStrWave[0]+":", ":"))
    23052489        print "***************************************************************************"
    23062490        For(i=0;i<60;i+=1)
    2307                 if(strlen(GNOMHeaderTextWave[i])>5)
    2308                         print RemoveEnding(GNOMHeaderTextWave[i], "\n")
     2491                if(strlen(GNOMOutFileTextWave[i])>5)
     2492                        print RemoveEnding(GNOMOutFileTextWave[i], "\n")
    23092493                endif
    23102494        endfor
     
    24772661        NVAR MWMassDensityProtein = root:Packages:Irena:PDDFInterface:MWMassDensityProtein
    24782662        NVAR MWMolecularWeightkDa = root:Packages:Irena:PDDFInterface:MWMolecularWeightkDa
    2479         NVAR FittedI0 = root:Packages:Irena:PDDFInterface:FittedI0
    2480         NVAR FittedRg = root:Packages:Irena:PDDFInterface:FittedRg
     2663        NVAR SAXSMoW2I0 = root:Packages:Irena:PDDFInterface:SAXSMoW2I0
     2664        NVAR SAXSMoW2Rg = root:Packages:Irena:PDDFInterface:SAXSMoW2Rg
    24812665        MWPorodInvariant = 0
    24822666        MWTrueVolumeA3 = 0
    24832667        MWMolecularWeightkDa = 0
    2484         FittedI0 = 0
    2485         FittedRg = 0
    2486        
    2487         NVAR CalcRg=root:Packages:Irena:PDDFInterface:CalculatedRg
    2488         NVAR CalcI0=root:Packages:Irena:PDDFInterface:CalculatedI0
     2668        SAXSMoW2I0 = 0
     2669        SAXSMoW2Rg = 0
     2670       
     2671        NVAR CalcRg=root:Packages:Irena:PDDFInterface:PDDFCalculatedRg
     2672        NVAR CalcI0=root:Packages:Irena:PDDFInterface:PDDFCalculatedI0
    24892673        NVAR ConcentrationForCals=root:Packages:Irena:PDDFInterface:ConcentrationForCals
    24902674        NVAR ScattLengthDensDifference=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference
    2491         NVAR CalculatedMW=root:Packages:Irena:PDDFInterface:CalculatedMW
     2675        NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
    24922676        NVAR GNOMAlfaResult = root:Packages:Irena:PDDFInterface:GNOMAlfaResult
    24932677        CalcRg = 0
    24942678        CalcI0 = 0
    2495         CalculatedMW = 0
     2679        PDDFCalculatedMW = 0
    24962680        GNOMAlfaResult = 0
    24972681        //these are variables used by the control procedure
     
    25522736        NVAR CalcDmax = root:Packages:Irena:PDDFInterface:CalculateDmaxEstOnImport
    25532737        if(CalcDmax)
    2554                 IRB1_PDDFEstimateRgAndDmax()   
     2738                IRB1_PDDFFitAndCalculateMW()   
    25552739        endif
    25562740       
     
    26532837        ListOfVariables += "DmaxEstimate;CalculateDmaxEstOnImport;GnomForceRmin0;GnomForceRmax0;NumBinsInR;GnomAlfaValue;"     
    26542838        ListOfVariables += "MooreNumFunctions;MooreDetNumFunctions;MooreFitMaxSize;"   
    2655         ListOfVariables += "CalculatedRg;CalculatedI0;ConcentrationForCals;ScattLengthDensDifference;CalculatedMW;"     
     2839        ListOfVariables += "PDDFCalculatedRg;PDDFCalculatedI0;ConcentrationForCals;ScattLengthDensDifference;PDDFCalculatedMW;"
     2840        ListOfVariables += "RamboTainerMW;"
    26562841        ListOfVariables += "SaveToFolderAutomatically;SaveToNotebookAutomatically;SaveToWavesAutomatically;"   
    26572842        ListOfVariables += "MWPorodInvariant;MWTrueVolumeA3;MWMassDensityProtein;MWMolecularWeightkDa;"
    2658         ListOfVariables += "GNOMAlfaResult;FittedI0;FittedRg;PDDFUseProtein;PDDFUseNucleicAcid;"
     2843        ListOfVariables += "GNOMAlfaResult;SAXSMoW2I0;SAXSMoW2Rg;PDDFUseProtein;PDDFUseNucleicAcid;"
    26592844
    26602845                //and here we create them
     
    27282913                SaveToWavesAutomatically=1
    27292914        endif
    2730        
     2915        NVAR CalculateDmaxEstOnImport
     2916        CalculateDmaxEstOnImport= 0
    27312917end
    27322918//**********************************************************************************************************
     
    27372923        NVAR MWMassDensityProtein = root:Packages:Irena:PDDFInterface:MWMassDensityProtein
    27382924        NVAR MWMolecularWeightkDa = root:Packages:Irena:PDDFInterface:MWMolecularWeightkDa
    2739         NVAR FittedI0 = root:Packages:Irena:PDDFInterface:FittedI0
    2740         NVAR FittedRg = root:Packages:Irena:PDDFInterface:FittedRg
    2741         NVAR CalculatedRg = root:Packages:Irena:PDDFInterface:CalculatedRg
    2742         NVAR CalculatedI0 = root:Packages:Irena:PDDFInterface:CalculatedI0
    2743         NVAR CalculatedMW = root:Packages:Irena:PDDFInterface:CalculatedMW
     2925        NVAR SAXSMoW2I0 = root:Packages:Irena:PDDFInterface:SAXSMoW2I0
     2926        NVAR SAXSMoW2Rg = root:Packages:Irena:PDDFInterface:SAXSMoW2Rg
     2927        NVAR PDDFCalculatedRg = root:Packages:Irena:PDDFInterface:PDDFCalculatedRg
     2928        NVAR PDDFCalculatedI0 = root:Packages:Irena:PDDFInterface:PDDFCalculatedI0
     2929        NVAR PDDFCalculatedMW = root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
    27442930        NVAR GNOMAlfaResult=root:Packages:Irena:PDDFInterface:GNOMAlfaResult
     2931        NVAR RamboTainerMW = root:Packages:Irena:PDDFInterface:RamboTainerMW
     2932
     2933        RamboTainerMW = 0
    27452934        MWPorodInvariant = 0
    27462935        MWTrueVolumeA3 = 0
    27472936        MWMolecularWeightkDa = 0
    2748         FittedI0 = 0
    2749         FittedRg = 0
    2750         CalculatedRg=0
    2751         CalculatedI0=0
    2752         CalculatedMW=0
     2937        SAXSMoW2I0 = 0
     2938        SAXSMoW2Rg = 0
     2939        PDDFCalculatedRg=0
     2940        PDDFCalculatedI0=0
     2941        PDDFCalculatedMW=0
    27532942        GNOMAlfaResult = 0
    27542943end
     
    28072996        NVAR GNOMAlfaResult = root:Packages:Irena:PDDFInterface:GNOMAlfaResult
    28082997
    2809         NVAR CalcRg=root:Packages:Irena:PDDFInterface:CalculatedRg
    2810         NVAR CalcI0=root:Packages:Irena:PDDFInterface:CalculatedI0
     2998        NVAR CalcRg=root:Packages:Irena:PDDFInterface:PDDFCalculatedRg
     2999        NVAR CalcI0=root:Packages:Irena:PDDFInterface:PDDFCalculatedI0
    28113000        NVAR ConcentrationForCals=root:Packages:Irena:PDDFInterface:ConcentrationForCals
    28123001        NVAR ScattLengthDensDifference=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference
    2813         NVAR CalculatedMW=root:Packages:Irena:PDDFInterface:CalculatedMW
     3002        NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
    28143003
    28153004        string MethodRun
     
    28363025        IR1_AppendAnyText("Method used: \t"+MethodRun,0)       
    28373026
    2838         IR1_AppendAnyText("\rPDDF MW [kDa] = \t"+num2str(CalculatedMW),0)       
     3027        IR1_AppendAnyText("\rPDDF MW [kDa] = \t"+num2str(PDDFCalculatedMW),0)   
    28393028        IR1_AppendAnyText("PDDF Rg [A] = \t"+num2str(CalcRg),0)
    28403029        IR1_AppendAnyText("PDDF I0     = \t"+num2str(CalcI0),0)
     
    28823071        endif
    28833072
    2884         NVAR CalcRg=root:Packages:Irena:PDDFInterface:CalculatedRg
    2885         NVAR CalcI0=root:Packages:Irena:PDDFInterface:CalculatedI0
     3073        NVAR CalcRg=root:Packages:Irena:PDDFInterface:PDDFCalculatedRg
     3074        NVAR CalcI0=root:Packages:Irena:PDDFInterface:PDDFCalculatedI0
    28863075        NVAR ConcentrationForCals=root:Packages:Irena:PDDFInterface:ConcentrationForCals
    28873076        NVAR ScattLengthDensDifference=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference
    2888         NVAR CalculatedMW=root:Packages:Irena:PDDFInterface:CalculatedMW
     3077        NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
    28893078        SVAR DataFolderName = root:Packages:Irena:PDDFInterface:DataFolderName
    28903079
     
    29123101        Wave/Z PDDF_Rg
    29133102        if(!WaveExists(PDDF_Rg))
    2914                 make/O/N=0 PDDF_Rg, PDDF_I0, PDDF_MW, PDDF_Conc, PDDF_SLD, PorodInvariant, PorodTrueVolume, MassDensityProtein, InvariantCalculatedMW, GnomAlfaFinal
     3103                make/O/N=0 PDDF_Rg, PDDF_I0, PDDF_MW, PDDF_Conc, PDDF_SLD, PorodInvariant, PorodTrueVolume, MassDensityProtein, InvariantPDDFCalculatedMW, GnomAlfaFinal
    29153104                make/O/N=0/T SampleName, MethodName
    29163105                SetScale/P x 0,1,"A", PDDF_Rg
     
    29223111                SetScale/P x 0,1,"cm3", PorodTrueVolume
    29233112                SetScale/P x 0,1,"g/cm3", MassDensityProtein
    2924                 SetScale/P x 0,1,"kDa", InvariantCalculatedMW
     3113                SetScale/P x 0,1,"kDa", InvariantPDDFCalculatedMW
    29253114        endif
    29263115        variable curlength = numpnts(PDDF_Rg)
    2927         redimension/N=(curlength+1) SampleName,MethodName, PDDF_Rg, PDDF_I0, PDDF_MW, PDDF_Conc, PDDF_SLD, PorodInvariant, PorodTrueVolume, MassDensityProtein, InvariantCalculatedMW, GnomAlfaFinal
     3116        redimension/N=(curlength+1) SampleName,MethodName, PDDF_Rg, PDDF_I0, PDDF_MW, PDDF_Conc, PDDF_SLD, PorodInvariant, PorodTrueVolume, MassDensityProtein, InvariantPDDFCalculatedMW, GnomAlfaFinal
    29283117        SampleName[curlength] = stringFromList(ItemsInList(DataFolderName, ":")-1, DataFolderName,":")
    29293118        MethodName[curlength] = Methodused
    29303119        PDDF_Rg[curlength] = CalcRg
    29313120        PDDF_I0[curlength] = CalcI0
    2932         PDDF_MW[curlength] = CalculatedMW
     3121        PDDF_MW[curlength] = PDDFCalculatedMW
    29333122        PDDF_Conc[curlength] = ConcentrationForCals
    29343123        PDDF_SLD[curlength] = ScattLengthDensDifference
     
    29363125        PorodTrueVolume[curlength] = MWTrueVolumeA3
    29373126        MassDensityProtein[curlength] = MWMassDensityProtein
    2938         InvariantCalculatedMW[curlength] = MWMolecularWeightkDa
     3127        InvariantPDDFCalculatedMW[curlength] = MWMolecularWeightkDa
    29393128        GnomAlfaFinal[curlength] = GNOMAlfaResult
    29403129        DoWindow IRB1_PDDFFitResultsTable
     
    29583147        SetDataFolder root:PDDFFitResults:
    29593148        Wave/T SampleName, MethodName
    2960         Wave PDDF_Rg, PDDF_I0, PDDF_MW, PDDF_Conc, PDDF_SLD,PorodInvariant, PorodTrueVolume, MassDensityProtein, InvariantCalculatedMW, GnomAlfaFinal
     3149        Wave PDDF_Rg, PDDF_I0, PDDF_MW, PDDF_Conc, PDDF_SLD,PorodInvariant, PorodTrueVolume, MassDensityProtein, InvariantPDDFCalculatedMW, GnomAlfaFinal
    29613150        Edit/K=1/W=(860,772,1831,1334)/N=IRB1_PDDFFitResultsTable SampleName,PDDF_Rg, PDDF_I0, PDDF_MW, MethodName as "PDDF fitting results Table"
    2962         AppendToTable InvariantCalculatedMW, PorodInvariant, PorodTrueVolume, MassDensityProtein, PDDF_Conc, PDDF_SLD, GnomAlfaFinal
     3151        AppendToTable InvariantPDDFCalculatedMW, PorodInvariant, PorodTrueVolume, MassDensityProtein, PDDF_Conc, PDDF_SLD, GnomAlfaFinal
    29633152        ModifyTable format(Point)=1,width(SampleName)=150,title(SampleName)="Sample Folder"
    29643153        ModifyTable width(MethodName)=100,title(MethodName)="Method"
     
    29703159        ModifyTable width(PDDF_Conc)=92,title(PDDF_Conc)="Conc [mg/ml]",alignment(PDDF_SLD)=1
    29713160        ModifyTable sigDigits(PDDF_SLD)=4,width(PDDF_SLD)=110,title(PDDF_SLD)="SLD [10^10 cm^2]"
    2972         ModifyTable alignment(InvariantCalculatedMW)=1,sigDigits(InvariantCalculatedMW)=4,width(InvariantCalculatedMW)=104
    2973         ModifyTable title(InvariantCalculatedMW)="MW (Porod)"
     3161        ModifyTable alignment(InvariantPDDFCalculatedMW)=1,sigDigits(InvariantPDDFCalculatedMW)=4,width(InvariantPDDFCalculatedMW)=104
     3162        ModifyTable title(InvariantPDDFCalculatedMW)="MW (Porod)"
    29743163        ModifyTable alignment(PorodInvariant)=1,sigDigits(PorodInvariant)=4,width(PorodInvariant)=104
    29753164        ModifyTable title(PorodInvariant)="Porod Invariant"
     
    30203209        NVAR GNOMAlfaResult = root:Packages:Irena:PDDFInterface:GNOMAlfaResult
    30213210
    3022         NVAR CalcRg=root:Packages:Irena:PDDFInterface:CalculatedRg
    3023         NVAR CalcI0=root:Packages:Irena:PDDFInterface:CalculatedI0
     3211        NVAR CalcRg=root:Packages:Irena:PDDFInterface:PDDFCalculatedRg
     3212        NVAR CalcI0=root:Packages:Irena:PDDFInterface:PDDFCalculatedI0
    30243213        NVAR ConcentrationForCals=root:Packages:Irena:PDDFInterface:ConcentrationForCals
    30253214        NVAR ScattLengthDensDifference=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference
    3026         NVAR CalculatedMW=root:Packages:Irena:PDDFInterface:CalculatedMW
     3215        NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
    30273216        string MethodRun
    30283217        NVAR PDDFUseGNOM = root:Packages:Irena:PDDFInterface:PDDFUseGNOM
     
    30443233        //SVAR FittingResults=root:Packages:Irena:PDDFInterface:FittingResults
    30453234        string ResultsComment="PDDFMetod="+MethodRun+";"+"PDDFQmin="+num2str(DataQstart)+";"
    3046         ResultsComment="PDDFMW="+num2str(CalculatedMW)+";"
     3235        ResultsComment="PDDFMW="+num2str(PDDFCalculatedMW)+";"
    30473236        ResultsComment="PDDFRg="+num2str(CalcRg)+";"
    30483237        ResultsComment="PDDFI0="+num2str(CalcI0)+";"
Note: See TracChangeset for help on using the changeset viewer.