Ignore:
Timestamp:
Jul 15, 2008 11:19:38 AM (14 years ago)
Author:
srkline
Message:

DoSaveFileDialog? now takes two optional parameters, fname and suffix that can speed file save/rename, especially when used with the subtract1D operation.

Invariant now has a new macro to solve for the volume fraction.

PNGs are used wherever possible for reports. Gizmo window are still the oddball, and are limited to native platform formats.

Location:
sans/Dev/trunk/NCNR_User_Procedures/SANS
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/Packages/GlobalFit/GlobalFit2_NCNR_v40.ipf

    r309 r393  
    48504850         
    48514851        //the graph 
    4852         Notebook $nb picture={$topGraph(0, 0, 400, 300), 0, 1}, text="\r" 
     4852        Notebook $nb picture={$topGraph(0, 0, 400, 300), -5, 1}, text="\r" 
    48534853         
    48544854        // show the top of the report 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/Packages/Invariant/Invariant_v40.ipf

    r379 r393  
    5050         
    5151        Printf "The model invariant is %g A^-3 cm^-1\r\r",inv 
     52End 
     53 
     54// for testing - compare to the "perfect" value. This macro 
     55// calculates the invariant based on the contrast and volume fraction 
     56// - the extrapolated/integrated value should match this... 
     57Macro SolveForVolumeFraction(invariant,delta_rho) 
     58        Variable invariant,delta_rho=6e-6 
     59        // delta_rho [=] 1/A^2 
     60        Variable phi1,phi2,arg 
     61         
     62        arg = 1 - 4*invariant*(1e-8)/2/pi/pi/delta_rho/delta_rho 
     63        phi1 = (1 - sqrt(arg))/2 
     64        phi2 = (1 + sqrt(arg))/2 
     65         
     66        Printf "The two solutions for phi are: %8.6f\t and %8.6f\r\r",phi1,phi2 
    5267End 
    5368 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/Packages/Wrapper_v40.ipf

    r392 r393  
    10691069        // insert graphs 
    10701070        if(WaveExists(dataXw)) 
    1071                 Notebook $nb picture={$topGraph(0, 0, 400, 300), 0, 1}, text="\r" 
     1071                Notebook $nb picture={$topGraph(0, 0, 400, 300), -5, 1}, text="\r" 
    10721072        // 
    10731073        else            //must be 2D Gizmo 
    1074                 Execute "ExportGizmo Clip" 
     1074                Execute "ExportGizmo Clip"                      //this ALWAYS is a PICT or BMP. Gizmo windows are different... 
    10751075                LoadPict/Q/O "Clipboard",tmp_Gizmo 
    10761076                Notebook $nb picture={tmp_Gizmo(0, 0, 400, 300), 0, 1}, text="\r" 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Reduction/Subtract_1D.ipf

    r328 r393  
    526526        endif 
    527527         
    528         fileName = DoSaveFileDialog("Save Data as") 
     528        SVAR loadedFile=root:myGlobals:Subtract1D:gName1 
     529        fileName = DoSaveFileDialog("Save Data as",fname=loadedFile,suffix="b") 
    529530        if(cmpstr(fileName,"")==0) 
    530531                return(1) 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Reduction/WriteQIS.ipf

    r328 r393  
    811811 
    812812// returns the path to the file, or null if the user cancelled 
    813 Function/S DoSaveFileDialog(msg) 
    814         String msg 
     813// fancy use of optional parameters 
     814Function/S DoSaveFileDialog(msg,[fname,suffix]) 
     815        String msg,fname,suffix 
    815816        Variable refNum 
    816817//      String message = "Save the file as" 
    817         String outputPath 
    818          
    819         Open/D/M=msg/T="????" refNum 
     818 
     819        if(ParamIsDefault(fname)) 
     820//              Print "fname not supplied" 
     821                fname = "" 
     822        endif 
     823        if(ParamIsDefault(suffix)) 
     824//              Print "suffix not supplied" 
     825                suffix = "" 
     826        endif 
     827         
     828        String outputPath,tmpName 
     829        tmpName = fname + suffix 
     830         
     831        Open/D/M=msg/T="????" refNum as tmpName 
    820832        outputPath = S_fileName 
    821833         
Note: See TracChangeset for help on using the changeset viewer.