Changeset 133


Ignore:
Timestamp:
Jul 26, 2007 2:29:51 PM (15 years ago)
Author:
srkline
Message:

Linearized fits package is now (I think) data folder aware, and hides its bits inside myGlobals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/LinearizedFits/LinearizedFits.ipf

    r42 r133  
    143143                //selection not null 
    144144                partialName = S_value 
    145                 //Print partialName 
    146145        Endif 
    147146        //get a valid file based on this partialName and catPathName 
     
    154153         
    155154        //load in the data (into the root directory) 
    156         A_LoadOneDDataWithName(tempName) 
     155        A_LoadOneDDataWithName(tempName,0)              //let A_Rescale_Data() do the plotting 
    157156        //Print S_fileName 
    158157        //Print tempName 
    159158         
    160         String cleanLastFileName = "root:"+CleanupName(root:myGlobals:gLastFileName,0) 
    161  
    162         tempName=cleanLastFileName+"_q" 
     159        String cleanLastFileName = CleanupName(partialName,0) 
     160        String dataStr = "root:"+cleanLastFileName+":" 
     161        tempName=dataStr + cleanLastFileName+"_q" 
    163162        Duplicate/O $tempName xAxisWave 
    164         tempName=cleanLastFileName+"_i" 
     163        tempName=dataStr + cleanLastFileName+"_i" 
    165164        Duplicate/O $tempName yAxisWave 
    166         tempName=cleanLastFileName+"_s" 
     165        tempName=dataStr + cleanLastFileName+"_s" 
    167166        Duplicate/O $tempName yErrWave 
    168167 
    169168        //Plot, and adjust the scaling to match the axis scaling set by the popups 
    170         A_Rescale_Data() 
     169        A_Rescale_Data(dataStr) 
    171170         
    172171End 
     
    209208// (does not fit the data) 
    210209// 
    211 Function A_Rescale_Data() 
     210// dataStr is the root:folder: of the data that was loaded 
     211Function A_Rescale_Data(dataStr) 
     212        String dataStr 
    212213         
    213214        //Scaling exponents and background value 
     
    250251        //do the rescaling of the data 
    251252        // get the current experimental q, I, and std dev. waves (as they would be loaded ) 
    252  
    253         //ControlInfo/W=A_FitPanel ywave 
    254         //get the filename from the global as it's loaded, rather from the popup - as version numbers 
    255         // do cause problems here. This global is also used later in this function 
    256         SVAR gLastFileName = root:myGlobals:gLastFileName 
    257          
    258         Wave xw = $( CleanupName((gLastFileName + "_q"),0) ) 
    259         Wave yw = $( CleanupName((gLastFileName + "_i"),0) ) 
    260         Wave ew = $( CleanupName((gLastFileName + "_s"),0) ) 
     253        String baseStr = ParseFilePath(0,dataStr,":",1,0)               //give me the last part of the path 
     254         
     255        Wave xw = $(dataStr+baseStr+"_q") 
     256        Wave yw = $(dataStr+baseStr+"_i") 
     257        Wave ew = $(dataStr+baseStr+"_s") 
    261258         
    262259        //variables set for each model to control look of graph 
     
    420417        //plot the data 
    421418         
    422         String cleanLastFileName = "root:"+CleanupName(gLastFileName,0) 
     419//      String cleanLastFileName = "root:"+CleanupName(gLastFileName,0) 
    423420        If(WinType("A_FitWindow") == 0) 
    424421                Display /W=(5,42,480,400)/K=1 yAxisWave vs xAxisWave 
     
    436433        SetAxis/A 
    437434        ModifyGraph tickUnit=1          //suppress tick units in labels 
    438         TextBox/C/N=textLabel/A=RB "File = "+cleanLastFileName 
     435        TextBox/C/N=textLabel/A=RB "File = "+baseStr 
    439436        //clear the old fit from the window, if it exists 
    440437        RemoveFromGraph/W=A_FitWindow/Z fit_yAxisWave 
     
    495492                Abort "You must Load and Plot a File before fitting the data" 
    496493        endif 
     494         
    497495        // rescale the data, to make sure it's as selected on the panel 
    498         A_Rescale_Data() 
     496        ControlInfo/W=A_FitPanel $"ywave" 
     497        String partialName = CleanupName(S_value,0) 
     498        A_Rescale_Data("root:"+partialName+":") 
    499499         
    500500        // now go do the fit 
     
    524524        //ystr and xstr are the axis strings - filter with a do-loop 
    525525        String ystr="",xstr="" 
    526         SVAR gLastFileName = root:myGlobals:gLastFileName 
    527526        //ControlInfo/W=A_FitPanel ywave 
    528         Wave xw = $( CleanupName((gLastFileName + "_q"),0) ) 
     527        Wave xw = $("root:"+partialName+":"+partialName + "_q") 
    529528        ControlInfo/W=A_FitPanel yModel 
    530529        ystr = S_Value 
     
    735734                DoWindow/K $"A_FitWindow" 
    736735        endif 
     736        SetDataFolder root: 
     737        Killwaves/Z xAxisWave,yAxisWave,yErrWave,residWave,yWtWave,fit_yAxisWave 
    737738        Execute/P "DELETEINCLUDE \"LinearizedFits\"" 
    738739        Execute/P "COMPILEPROCEDURES " 
Note: See TracChangeset for help on using the changeset viewer.