All posts by jobe (4)

topic: "Exception Caught" error for sequential refinement ("Run_Number" limited by 10 bits?)  in the forum: Forums topas
jobe #1
Member for 2 months · 4 posts · Location: Aarhus, Denmark
Group memberships: Members
Show profile · Link to this post
Thank you for all the help, Alan!

To run an .inp file without the GUI using tc.exe, simply
- open the Windows Command Prompt
- find your way to the Topas folder (e.g. C:\Topas-6) using the "cd" command to change directory
- type "tc some_input_file.inp" into the command line
- let Topas do its magic on your .inp file!


Best,
Jonas
topic: "Exception Caught" error for sequential refinement ("Run_Number" limited by 10 bits?)  in the forum: Forums topas
jobe #2
Member for 2 months · 4 posts · Location: Aarhus, Denmark
Group memberships: Members
Show profile · Link to this post
In reply to post ID 2062
Hello Alan,
 
I've stripped down the INP file as much as possible:

'------------------------------------------------------------------------------------------------------------------------
'GENERAL REFINEMENT INFORMATION
iters 100
chi2_convergence_criteria 0.00001                                                
do_errors
no_LIMIT_warnings
continue_after_convergence     'Used to try and find the global minimum. ´
conserve_memory                     'Makes it run slightly faster in GUI mode, can be commented out.

r_wp  10.0765324 r_exp  2.03919031 r_p  5.18542518 r_wp_dash  13.1924485 r_p_dash  7.42458153 r_exp_dash  2.669759 weighted_Durbin_Watson  0.024812141 gof  4.94143797

macro jiggle {0.20}
macro wiggle { val_on_continue = Val + Rand(-jiggle*Val, jiggle*Val) }


'-------------------------------------------------------------------------------------------------------------------------
'SETTING UP THE SEQUENTIAL REFINEMENT
'Link: http://topas.dur.ac.uk/topaswiki/doku.…?id=sequential_re…

macro Sequential_Refinement(numruns, ident)         { Sequential_Refinement(numruns, ident, , INP_File, Run_Number) }
macro Sequential_Refinement(numruns, ident, output) { Sequential_Refinement(numruns, ident, output, INP_File, Run_Number) }
macro Sequential_Refinement(numruns, ident, output, INPFILE, RUNNUMBER) 'This one would almost never be called directly'
{
    num_runs numruns
 
    'saves a backup of the original input file'
    #if Run_Number == 0;
        system_before_save_OUT { copy INPFILE##.inp INPFILE##.backup }
    #endif  
 
    'Save each input file with the run number and some other identifier'
    system_before_save_OUT { copy INPFILE##.inp INPFILE##_##RUNNUMBER##_##ident##.inp }
 
    'copy the output of the nth file and use it as the input for the (n+1)th file'
    out_file = Concat(String(INPFILE), ".INP");
 
    'copies the backup back over the final input file at the end of the run so you can restart from where you started'
    #if Run_Number == numruns-1;
        system_after_save_OUT { copy INPFILE##.backup INPFILE##.inp }
    #endif  
 
    'output every refined parameter with the in-built TOPAS keyword'
    'This currently doesn't work for multi-file refinement
    #m_ifarg output "" #m_else
        out_prm_vals_on_convergence output
    #m_endif
}

'-------------------------------------------------------------------------------------------------------------------------
'LIST OF FILES TO BE REFINED

    #list File_Name 'Identifier
        {
        Data\BGG_MS_600cvac_-00001.xy
        Data\BGG_MS_600cvac_-00002.xy
            '...... all of the data files
        }
       
    macro data_file { File_Name(Run_Number) }
    macro ident { Run_Number }
    Sequential_Refinement(1022, Run_Number)
    macro ResFileName { RefinementResults.txt }

'-------------------------------------------------------------------------------------------------------------------------
'SETTING UP THE OUTPUT FILES
'Link: http://topas.dur.ac.uk/topaswiki/doku.…?id=sequential_re…

macro FileNameGenerator(folder, file_name_prefix, suffix, extension)
{
    folder##\##file_name_prefix##suffix##extension
}

macro FitFileName { FileNameGenerator(Results, Fit_, Run_Number, .xy) }
macro DifFileName { FileNameGenerator(Results, Dif_, Run_Number, .xy) }


macro Out_Results(ResFileName)              { Out_Results(ResFileName, file, seqno, Get(phase_name)) }
macro Out_Results(ResFileName, phasename)   { Out_Results(ResFileName, file, seqno, phasename)       }
macro Out_Results(ResFileName, file, seqno) { Out_Results(ResFileName, file, seqno, Get(phase_name)) }
macro Out_Results(ResFileName, file, seqno, phasename) {
    out ResFileName append
        Out_String("\n")   
        Out_String(data_file)
        Out_String("\t")
        Out_String(ident)
        Out_String("\t")
        load out_record out_fmt out_eqn
        {
             "%s"  = phasename;
        }
        load out_record out_fmt out_fmt_err out_eqn
}

macro O_R(& value) {
    "\t%10.9f" "\t%10.9f"
    #m_ifarg value #m_code
        = If(Prm_There(value),value,-1);
    #m_else 'it must be a numeral, an eqn, or a Get(), and therefore, should exist'
        =value;
    #m_endif
}

macro Out_Header(ResFileName) {
    out ResFileName append
        Out_String("@file\t")
        Out_String("ident\t")
        Out_String("phase")
}
 
macro O_H(head) {
    Out_String("\t")    Out_String(head)           
    Out_String("\t")    Out_String(head##_err)   
}

#define OUTPUT
'This single output macro encapsulate all of the desired outputs, allowing it '
'  to be easily turned on and off with the above #define'
' The Output macro is referred to at the end of the input file '
    macro Output {
        'Only write the header the first time the file is run'
        #if Run_Number == 0;
            Out_Header(ResFileName)
                O_H(Rwp)
                '.... header for reported parameters
        #endif
 
        'output the following parameters for each str    '
        for strs 1 to 1 {
            Out_Results(ResFileName) {
                O_R(Get (r_wp))
                '.... values for the reported parameters
            }
        }
    }
   
'-------------------------------------------------------------------------------------------------------------------------
'DATA FILE AND INSTRUMENTAL PARAMETRES

xdd data_file
   
    continue_after_convergence
    x_calculation_step = Yobs_dx_at(Xo); convolution_step 8
   
    start_X 2.0
    finish_X 6.8

    lam ymin_on_ymax 0.001 la 1.0 lo 0.1261 lh 0.1
    LP_Factor(0)
       
    Specimen_Displacement(disp,-0.00262`_0.00010)
   
    bkg bg  723.111301`_5.23849217  269.741011`_8.16461682 -9.50724438`_6.43772228 -40.1591874`_6.41377331 -34.3449549`_5.77645379 -30.53635`_5.98240559

'------------------------------------------------------------------------------------------------------------------------
'PHASE INFORMATION

    str   
        phase_name Ba8Ga16Ge30
        scale scale_bgg  5.10341209e-008`_2.87e-010
        weight_percent w_bgg  100.000`_0.000
       
        a a_bgg  10.805720`_0.000209
        b a_bgg  10.805720`_0.000209
        c a_bgg  10.805720`_0.000209
        al 90.     
        be 90.     
        ga 90.     

       
        space_group "Pm-3n"
        site Ba1    x 0             y 0           z 0                          occ Ba 1.000      beq B_Ba1  1.19854`_0.09019 wiggle;
        site Ba2    x 0.25          y 0.5000        z 0                       occ Ba 1.000      ADPs { u_11  0.01974`_0.00194 = Get(u33); u_33  0.06232`_0.00154 = 0; = 0; = 0; }
        site Ge1    x 0.25          y 0           z 0.5                      occ Ge 1.000      beq B_Ge1  1.22365`_0.04069
        site Ge2    x 0.18473       y 0.18473     z 0.18473                  occ Ge 1.000      beq B_Ge1  1.22365`_0.04069
        site Ge3    x 0             y 0.30833     z 0.11829                  occ Ge 1.000      beq B_Ge1  1.22365`_0.04069
       
        r_bragg  100
       
        TCHZ_Peak_Type(pku,-0.04707`_0.00693, pkv, 0.01000`_0.00027,!pkw, 0.00000,!pkz, 0.0000,!pky, 0.0000,pkx, 0.00492`_0.00009)

'-------------------------------------------------------------------------------------------------------------------------

#ifdef OUTPUT
    Output
    Out_X_Ycalc(FitFileName)
    Out_X_Difference(DifFileName)
#endif



Thanks for the help!

- Jonas
topic: "Exception Caught" error for sequential refinement ("Run_Number" limited by 10 bits?)  in the forum: Forums topas
jobe #3
Member for 2 months · 4 posts · Location: Aarhus, Denmark
Group memberships: Members
Show profile · Link to this post
Subject: "Exception Caught" error for sequential refinement
Hello everyone,

I'm doing sequential refinements of variable temperature PXRD data sets. I've set up my refinement according to http://topas.dur.ac.uk/topaswiki/doku.…?id=sequential_re…, where I essentially use the "num_runs" keyword to define a macro that takes a list of data files.

The problem is that I get the "Exception Caugt" error message in TOPAS at data set no. 1024. (This happens for several data sets across different experiments). I think the value of 1024 is quite suspicious as it is the maximum value that can be represented by 10 bits. I'm thinking that maybe the value of "Run_Number" is somehow restricted by this?

Have anyone had similar problems, and if I'm right, is it then possible to change the limits on "Run_Number"?


Cheers,
Jonas
topic: How to Use remove_phase Keyword in TOPAS 6  in the forum: Forums topas
jobe #4
Member for 2 months · 4 posts · Location: Aarhus, Denmark
Group memberships: Members
Show profile · Link to this post
In reply to post ID 1955
Hi everyone,

So as I understand it, the "continue_after_convergence" keyword have to be included for Remove_Phase to work, right?

I'm asking since I have some problems with the Remove_Phase macro. I want to do a sequential refinement on temperature variable PXRD data. At some point, I see the development of a new phase in the data but not before some 100s of data sets.

What I'm looking for is a way to include the "new" phase in all my refinements but remove the phase if it is not present. This would also be useful for data sets where secondary phases come and go.

The problem is that the remove_phase keyword terminates the entire sequential refinement (and not only the "present" refinement) whenever a phase is removed. Is it possible to circumvent this termination somehow?

I've set up my sequential refinement according to http://topas.dur.ac.uk/topaswiki/doku.…?id=sequential_re…, where I essentially use the "num_runs" keyword to define a macro that receives a list of data files.

Thanks for your help,
Jonas
Close Smaller – Larger + Reply to this post:
Special characters:
Special queries
Go to forum
Not logged in. · Lost password · Register
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Current time: 2019-11-22, 08:39:06 (UTC +00:00)