-
TAnewINP(v)
{
String w_ext = jEdit.getProperty("ta.last_xdd_type");
if (w_ext == null) w_ext = "*.raw";
jEdit.setProperty("vfs.browser.last-filter", w_ext);
String w_path = jEdit.getProperty("ta.last_new_inp_dir");
if (w_path == null) {
w_path = jEdit.getProperty("ta.main.dir") +"test_examples\\";
}
jEdit.setProperty("vfs.browser.last-path", w_path);
VFSFileChooserDialog chooser = new VFSFileChooserDialog(v, w_path, VFSBrowser.OPEN_DIALOG, true);
String[] files = chooser.getSelectedFiles();
if (files != null) {
String w_dir = MiscUtilities.getParentOfPath(files[0]);
String w_fn_no_ext = MiscUtilities.getFileNameNoExtension(files[0]);
jEdit.setProperty("ta.last_new_inp_dir", w_dir);
String w_path_inp = w_dir + w_fn_no_ext + "_pawley_01.inp";
b = jEdit.openFile(v, w_path_inp);
if (b != null) {
if (b.isNewFile()) {
t = v.getTextArea();
int i = 0;
while(true) {
t.goToEndOfLine(false);
String w_path = MiscUtilities.getFileName(files[i]);
if (w_path.indexOf(' ') != -1) {
w_path = "\"" + w_path + "\"";
}
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Input File for simple Rietveld Refinement");
b.insert(t.getCaretPosition(), "\n'Use save/set current button then run with F6 in topas");
b.insert(t.getCaretPosition(), "\n'Replace $ and # symbols with text/numbers as needed");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n\nr_wp 0 r_exp 0 r_p 0 r_wp_dash 0 r_p_dash 0 r_exp_dash 0 weighted_Durbin_Watson 0 gof 0");
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'General information about refinement here\n'Remove comments as required");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n\niters 100000");
b.insert(t.getCaretPosition(), "\nchi2_convergence_criteria 0.001");
b.insert(t.getCaretPosition(), "\n'do_errors");
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Information on datafile etc here");
b.insert(t.getCaretPosition(), "\n'Check that default weighting is appropriate for your data");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\nxdd " + w_path);
b.insert(t.getCaretPosition(), "\n\tx_calculation_step = Yobs_dx_at(Xo); convolution_step 4");
b.insert(t.getCaretPosition(), "\n\tbkg @ 0 0 0 0 0 0");
i++;
if (i == files.length) break;
}
jEdit.setProperty("ta.last_xdd_type", "*" + MiscUtilities.getFileExtension(files[0]));
} else {
String wmes = "INP file " + w_path_inp + " already exists";
Macros.message(v, wmes);
}
}
}
}
TAnewINP(view);
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 26.6)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa2(0.0001)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 0)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa2(0.0001)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 27.26)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa1(0.0001)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 27.26)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa1(0.0001)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 0)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa2(0.0001)");
- {%wavelength "Enter Wavelength:"}{@
textArea.goToEndOfLine(false);
}\n\tlam ymin_on_ymax 0.0001 la 1.0 lo {$$wavelength} lh 0.5\n\tLP_Factor( 0) 'change the mono angle as required
- {%wavelength "Enter Wavelength:"}{@
textArea.goToEndOfLine(false);
}\n\tlam ymin_on_ymax 0.0001 la 1.0 lo {$$wavelength} lh 0.5
\tneutron_data
\tLP_Factor( 90)
- {%mono "Enter Monochromator angle (e.g. 26.6 graphite/Cu; 27.26 Ge/Cu; 0 for energy dispersive): "}{@
textArea.goToEndOfLine(false);
}\n\tLP_Factor(!th2_monochromator, {$$mono})
-
Macros.getMacro("TAInsertLAM").invoke(view);
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tVariable_Divergence_Intensity");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tZero_Error(zero,0)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tSpecimen_Displacement(height,0)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\n\thkl_Is");
buffer.insert(textArea.getCaretPosition(), "\n\t\tTCHZ_Peak_Type(pku, 0.00039,pkv, -0.00221,pkw, -0.00146,!pkx, 0.0000,pky, 0.00957,!pkz, 0.0000)");
buffer.insert(textArea.getCaretPosition(), "\n\t\tSimple_Axial_Model(axial,10)");
- {%phname "Enter Phase Name:"}{@
textArea.goToEndOfLine(false)
}\n\t\t\phase_name {$$phname}
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tCubic(@ #)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tTetragonal(@ #, @ #)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tHexagonal(@ #, @ #)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tRhombohedral(@ #, @ #)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\ta @ #\n\t\tb @ #\n\t\tc @ #\n\t\tal @ #\n\t\tbe @ #\n\t\tga @ #");
- {%sgrp "Enter Space Group:"}{@
textArea.goToEndOfLine(false)
}\n\t\tspace_group {$$sgrp}
-
TAnewINP(v)
{
String w_ext = jEdit.getProperty("ta.last_xdd_type");
if (w_ext == null) w_ext = "*.raw";
jEdit.setProperty("vfs.browser.last-filter", w_ext);
String w_path = jEdit.getProperty("ta.last_new_inp_dir");
if (w_path == null) {
w_path = jEdit.getProperty("ta.main.dir") +"test_examples\\";
}
jEdit.setProperty("vfs.browser.last-path", w_path);
VFSFileChooserDialog chooser = new VFSFileChooserDialog(v, w_path, VFSBrowser.OPEN_DIALOG, true);
String[] files = chooser.getSelectedFiles();
if (files != null) {
String w_dir = MiscUtilities.getParentOfPath(files[0]);
String w_fn_no_ext = MiscUtilities.getFileNameNoExtension(files[0]);
jEdit.setProperty("ta.last_new_inp_dir", w_dir);
String w_path_inp = w_dir + w_fn_no_ext + "_riet_01.inp";
b = jEdit.openFile(v, w_path_inp);
if (b != null) {
if (b.isNewFile()) {
t = v.getTextArea();
int i = 0;
while(true) {
t.goToEndOfLine(false);
String w_path = MiscUtilities.getFileName(files[i]);
if (w_path.indexOf(' ') != -1) {
w_path = "\"" + w_path + "\"";
}
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Input File for simple tof Rietveld Refinement");
b.insert(t.getCaretPosition(), "\n'Use save/set current button then run with F6 in topas");
b.insert(t.getCaretPosition(), "\n'Replace $ and # symbols with text/numbers as needed");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n\nr_wp 0 r_exp 0 r_p 0 r_wp_dash 0 r_p_dash 0 r_exp_dash 0 weighted_Durbin_Watson 0 gof 0");
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'General information about refinement here\n'Remove comments as required");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n\niters 100000");
b.insert(t.getCaretPosition(), "\nchi2_convergence_criteria 0.001");
b.insert(t.getCaretPosition(), "\n'do_errors");
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Information on datafile etc here");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\nTOF_XYE( " + w_path + ", 3)");
b.insert(t.getCaretPosition(), "\n\tx_calculation_step = Yobs_dx_at(Xo); convolution_step 4");
b.insert(t.getCaretPosition(), "\n\tTOF_LAM(0.001)");
b.insert(t.getCaretPosition(), "\n\tscale_pks = D_spacing^4;");
b.insert(t.getCaretPosition(), "\n\tbkg @ 0 0 0 0 0 0");
b.insert(t.getCaretPosition(), "\n\tstart_X #");
b.insert(t.getCaretPosition(), "\n\tfinish_X #");
b.insert(t.getCaretPosition(), "\n");
b.insert(t.getCaretPosition(), "\n\tbkg @ 0 0 0 0 0 0");
i++;
if (i == files.length) break;
}
jEdit.setProperty("ta.last_xdd_type", "*" + MiscUtilities.getFileExtension(files[0]));
} else {
String wmes = "INP file " + w_path_inp + " already exists";
Macros.message(v, wmes);
}
}
}
}
TAnewINP(view);
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\n'--------------------------------------------------------------");
buffer.insert(textArea.getCaretPosition(), "\n'Change instrument/peak shape constants from a recent silicon calibration");
buffer.insert(textArea.getCaretPosition(), "\n'Only refine these parameters if you're sure what you're doing");
buffer.insert(textArea.getCaretPosition(), "\n'--------------------------------------------------------------");
buffer.insert(textArea.getCaretPosition(), "\n\tTOF_LAM(0.001)");
buffer.insert(textArea.getCaretPosition(), "\n\tTOF_x_axis_calibration(!t0_hrpd_bs,-16,!difc_hrpd_bs,48262,!difa_hrpd_bs,-8.35)");
buffer.insert(textArea.getCaretPosition(), "\n\tTOF_Exponential(!a1_bs, 230.98670,!a2_bs, 27.018, 4, difc_hrpd_bs, +)");
-
do_cif(v) {
t = v.getTextArea();
b = t.getBuffer();
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Information on structure");
b.insert(t.getCaretPosition(), "\n'Type in phase/space group/cell etc");
b.insert(t.getCaretPosition(), "\n'Comment in/out sections as needed");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
jEdit.setProperty("vfs.browser.last-filter", "*.cif");
w_path = jEdit.getProperty("ta.last_cif_path");
if (w_path == null) {
w_path = jEdit.getProperty("ta.main.dir") +"cif\\";
}
jEdit.setProperty("vfs.browser.last-path", w_path);
VFSFileChooserDialog chooser = new VFSFileChooserDialog(v, w_path, VFSBrowser.OPEN_DIALOG, true);
String[] files = chooser.getSelectedFiles();
if (files != null) {
int i = 0;
b.beginCompoundEdit();
while(true) {
runInSystemShell(v, jEdit.getProperty("ta.main.dir"));
waitForConsole(v);
runInSystemShell(v, "cif1 " + "\"" + files[i] + "\" cif1.tmp");
waitForConsole(v);
t.goToEndOfLine(false);
b.insert(t.getCaretPosition(), "\n");
b.insertFile(v, jEdit.getProperty("ta.main.dir") + "cif1.tmp");
VFSManager.waitForRequests();
i++;
if (i == files.length) break;
b.insert(t.getCaretPosition(), "\n");
}
b.endCompoundEdit();
jEdit.setProperty("ta.last_cif_path", files[0]);
}
t.goToEndOfLine(false);
b.insert(t.getCaretPosition(), "\n\t\tscale @ 0.0001");
b.insert(t.getCaretPosition(), "\n\t\tr_bragg 0");
b.insert(t.getCaretPosition(), "\n\t\ttof_sample_peakshape(lor,0.2,dsp,30,dspsq,1)");
b.insert(t.getCaretPosition(), "\n\t\tPhase_Density_g_on_cm3(0)");
}
do_cif(view);
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tview_structure");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tPreferred_Orientation(@, 1,, #h #k #l)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tPO_Two_Directions(@, 1,, 1 1 1,@, 1,, ,@, 0.5)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tPO_Spherical_Harmonics(sh, 4)");
-
TAnewINP(v)
{
String w_ext = jEdit.getProperty("ta.last_xdd_type");
if (w_ext == null) w_ext = "*.raw";
jEdit.setProperty("vfs.browser.last-filter", w_ext);
String w_path = jEdit.getProperty("ta.last_new_inp_dir");
if (w_path == null) {
w_path = jEdit.getProperty("ta.main.dir") +"test_examples\\";
}
jEdit.setProperty("vfs.browser.last-path", w_path);
VFSFileChooserDialog chooser = new VFSFileChooserDialog(v, w_path, VFSBrowser.OPEN_DIALOG, true);
String[] files = chooser.getSelectedFiles();
if (files != null) {
String w_dir = MiscUtilities.getParentOfPath(files[0]);
String w_fn_no_ext = MiscUtilities.getFileNameNoExtension(files[0]);
jEdit.setProperty("ta.last_new_inp_dir", w_dir);
String w_path_inp = w_dir + w_fn_no_ext + "_pkfit_01.inp";
b = jEdit.openFile(v, w_path_inp);
if (b != null) {
if (b.isNewFile()) {
t = v.getTextArea();
int i = 0;
while(true) {
t.goToEndOfLine(false);
String w_path = MiscUtilities.getFileName(files[i]);
if (w_path.indexOf(' ') != -1) {
w_path = "\"" + w_path + "\"";
}
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Input File for Peak Fitting with overall TCHz peak shape");
b.insert(t.getCaretPosition(), "\n'To find peaks load experimental data into topas");
b.insert(t.getCaretPosition(), "\n'Use View/search peaks then insert peaks");
b.insert(t.getCaretPosition(), "\n'Click on plus sign by file name");
b.insert(t.getCaretPosition(), "\n'Click on peaks phase");
b.insert(t.getCaretPosition(), "\n'Highlight Position and Area columns, right click to copy then paste below");
b.insert(t.getCaretPosition(), "\n'Use save/set current button then run with F6 in topas");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n\nr_wp 0 r_exp 0 r_p 0 r_wp_dash 0 r_p_dash 0 r_exp_dash 0 weighted_Durbin_Watson 0 gof 0");
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'General information about refinement here\n'Remove comments as required");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\niters 100000");
b.insert(t.getCaretPosition(), "\nchi2_convergence_criteria 0.001");
b.insert(t.getCaretPosition(), "\n'do_errors");
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Information on datafile etc here");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\nxdd " + w_path);
b.insert(t.getCaretPosition(), "\n\tx_calculation_step = Yobs_dx_at(Xo); convolution_step 4");
i++;
if (i == files.length) break;
}
jEdit.setProperty("ta.last_xdd_type", "*" + MiscUtilities.getFileExtension(files[0]));
} else {
String wmes = "INP file " + w_path_inp + " already exists";
Macros.message(v, wmes);
}
}
}
}
TAnewINP(view);
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 26.6)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa2(0.0001)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 0)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa2(0.0001)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 27.26)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa1(0.0001)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 27.26)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa1(0.0001)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tLP_Factor(!th2_monochromator, 0)");
buffer.insert(textArea.getCaretPosition(), "\n\tCuKa2(0.0001)");
- {%wavelength "Enter Wavelength:"}{@
textArea.goToEndOfLine(false);
}\n\tlam ymin_on_ymax 0.0001 la 1.0 lo {$$wavelength} lh 0.5\n\tLP_Factor( 0) 'change the mono angle as required
- {%wavelength "Enter Wavelength:"}{@
textArea.goToEndOfLine(false);
}\n\tlam ymin_on_ymax 0.0001 la 1.0 lo {$$wavelength} lh 0.5
- {%mono "Enter Monochromator angle (e.g. 26.6 graphite/Cu; 27.26 Ge/Cu; 0 for energy dispersive): "}{@
textArea.goToEndOfLine(false);
}\n\tLP_Factor(!th2_monochromator, {$$mono})
-
Macros.getMacro("TAInsertLAM").invoke(view);
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tSimple_Axial_Model(axial,10)");
buffer.insert(textArea.getCaretPosition(), "\n\tbkg @ 0 0 0 0 0 0");
buffer.insert(textArea.getCaretPosition(), "\n\n\txo_Is");
buffer.insert(textArea.getCaretPosition(), "\n\tTCHZ_Peak_Type(pku, 0.00039,pkv, -0.00221,pkw, -0.00146,!pkx, 0.0000,pky, 0.00957,!pkz, 0.0000)");
buffer.insert(textArea.getCaretPosition(), "\n\tload xo I {");
buffer.insert(textArea.getCaretPosition(), "\n'copy peak position and intensity here");
buffer.insert(textArea.getCaretPosition(), "\n'insert @'s before 2th and area to refine");
buffer.insert(textArea.getCaretPosition(), "\n");
buffer.insert(textArea.getCaretPosition(), "\n\t}");
buffer.insert(textArea.getCaretPosition(), "\n");
-
textArea.goToBufferStart(false);
buffer.insert(textArea.getCaretPosition(), "'--------------------------------------------------------------");
buffer.insert(textArea.getCaretPosition(), "\n'Input File for Indexing powder data");
buffer.insert(textArea.getCaretPosition(), "\n\n'Paste 2theta/Area values from peak fitting");
buffer.insert(textArea.getCaretPosition(), "\n'Comment out header line and any peaks you don't want to include");
buffer.insert(textArea.getCaretPosition(), "\n'e.g. exclude high angle and weak/broad peaks");
buffer.insert(textArea.getCaretPosition(), "\n'Change wavelength as needed");
buffer.insert(textArea.getCaretPosition(), "\n'Comment out any crystal systems not to be checked");
buffer.insert(textArea.getCaretPosition(), "\n'Load filename.ndx after running");
buffer.insert(textArea.getCaretPosition(), "\n\n'Use save/set current button then run with F6 in TOPAS-Academic");
buffer.insert(textArea.getCaretPosition(), "\n'--------------------------------------------------------------");
buffer.insert(textArea.getCaretPosition(), "\nseed ");
buffer.insert(textArea.getCaretPosition(), "\nindex_zero_error ");
buffer.insert(textArea.getCaretPosition(), "\nindex_lam 1.5406");
buffer.insert(textArea.getCaretPosition(), "\nindex_min_lp 1 ");
buffer.insert(textArea.getCaretPosition(), "\nindex_max_lp 40 ");
buffer.insert(textArea.getCaretPosition(), "\n");
buffer.insert(textArea.getCaretPosition(), "\nBravais_Cubic_sgs ");
buffer.insert(textArea.getCaretPosition(), "\nBravais_Trigonal_Hexagonal_sgs ");
buffer.insert(textArea.getCaretPosition(), "\nBravais_Tetragonal_sgs ");
buffer.insert(textArea.getCaretPosition(), "\nBravais_Orthorhombic_sgs ");
buffer.insert(textArea.getCaretPosition(), "\nBravais_Monoclinic_sgs ");
buffer.insert(textArea.getCaretPosition(), "\nBravais_Triclinic_sgs ");
buffer.insert(textArea.getCaretPosition(), "\n");
buffer.insert(textArea.getCaretPosition(), "\nload index_th2 index_I {");
buffer.insert(textArea.getCaretPosition(), "\n'Paste position and area values below here");
buffer.insert(textArea.getCaretPosition(), "\n");
buffer.insert(textArea.getCaretPosition(), "\n");
buffer.insert(textArea.getCaretPosition(), "\n}");
-
TAnewINP(v)
{
String w_ext = jEdit.getProperty("ta.last_xdd_type");
if (w_ext == null) w_ext = "*.raw";
jEdit.setProperty("vfs.browser.last-filter", w_ext);
String w_path = jEdit.getProperty("ta.last_new_inp_dir");
if (w_path == null) {
w_path = jEdit.getProperty("ta.main.dir") +"test_examples\\";
}
jEdit.setProperty("vfs.browser.last-path", w_path);
VFSFileChooserDialog chooser = new VFSFileChooserDialog(v, w_path, VFSBrowser.OPEN_DIALOG, true);
String[] files = chooser.getSelectedFiles();
if (files != null) {
String w_dir = MiscUtilities.getParentOfPath(files[0]);
String w_fn_no_ext = MiscUtilities.getFileNameNoExtension(files[0]);
jEdit.setProperty("ta.last_new_inp_dir", w_dir);
String w_path_inp = w_dir + w_fn_no_ext + "_xtal_01.inp";
b = jEdit.openFile(v, w_path_inp);
if (b != null) {
if (b.isNewFile()) {
t = v.getTextArea();
int i = 0;
while(true) {
t.goToEndOfLine(false);
String w_path = MiscUtilities.getFileName(files[i]);
if (w_path.indexOf(' ') != -1) {
w_path = "\"" + w_path + "\"";
}
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Input File for simple single crystal refinement");
b.insert(t.getCaretPosition(), "\n'Use save/set current button then run with F6 in topas");
b.insert(t.getCaretPosition(), "\n'Replace $ and # symbols with text/numbers as needed");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n\nr_wp 0 ");
b.insert(t.getCaretPosition(), "\nr_p 0 ");
b.insert(t.getCaretPosition(), "\ngof 0 ");
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'General information about refinement here\n'Remove comments as required");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n\niters 100000");
b.insert(t.getCaretPosition(), "\nchi2_convergence_criteria 0.001");
b.insert(t.getCaretPosition(), "\n'do_errors");
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Information on datafile etc here");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\nxdd_scr " + w_path );
b.insert(t.getCaretPosition(), "\n\tweighting = If(Yobs<1,1,(1/Yobs));"); b.insert(t.getCaretPosition(), "\n\tfinish_X 180");
b.insert(t.getCaretPosition(), "\n\tfinish_X 180");
b.insert(t.getCaretPosition(), "\n");
i++;
if (i == files.length) break;
}
jEdit.setProperty("ta.last_xdd_type", "*" + MiscUtilities.getFileExtension(files[0]));
} else {
String wmes = "INP file " + w_path_inp + " already exists";
Macros.message(v, wmes);
}
}
}
}
TAnewINP(view);
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\tlam la 1 lo 0.71073 lh 0.5 ymin_on_ymax 0.0001");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\tlam la 1 lo 1.5406 lh 0.5 ymin_on_ymax 0.0001");
-
do_cif(v) {
t = v.getTextArea();
b = t.getBuffer();
b.insert(t.getCaretPosition(), "\n\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Information on structure");
b.insert(t.getCaretPosition(), "\n'Type in phase/space group/cell etc");
b.insert(t.getCaretPosition(), "\n'Comment in/out sections as needed");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
jEdit.setProperty("vfs.browser.last-filter", "*.cif");
w_path = jEdit.getProperty("ta.last_cif_path");
if (w_path == null) {
w_path = jEdit.getProperty("ta.main.dir") +"cif\\";
}
jEdit.setProperty("vfs.browser.last-path", w_path);
VFSFileChooserDialog chooser = new VFSFileChooserDialog(v, w_path, VFSBrowser.OPEN_DIALOG, true);
String[] files = chooser.getSelectedFiles();
if (files != null) {
int i = 0;
b.beginCompoundEdit();
while(true) {
runInSystemShell(v, jEdit.getProperty("ta.main.dir"));
waitForConsole(v);
runInSystemShell(v, "cif1 " + "\"" + files[i] + "\" cif1.tmp");
waitForConsole(v);
t.goToEndOfLine(false);
b.insert(t.getCaretPosition(), "\n");
b.insertFile(v, jEdit.getProperty("ta.main.dir") + "cif1.tmp");
VFSManager.waitForRequests();
i++;
if (i == files.length) break;
b.insert(t.getCaretPosition(), "\n");
}
b.endCompoundEdit();
jEdit.setProperty("ta.last_cif_path", files[0]);
}
t.goToEndOfLine(false);
b.insert(t.getCaretPosition(), "\n\t\tscale @ 0.0001");
b.insert(t.getCaretPosition(), "\n\t\tr_bragg 0");
b.insert(t.getCaretPosition(), "\n\t\tPhase_Density_g_on_cm3(0)");
}
do_cif(view);
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\n'--------------------------------------------------------------");
buffer.insert(textArea.getCaretPosition(), "\n'Information on structure");
buffer.insert(textArea.getCaretPosition(), "\n'Type in phase/space group/cell etc");
buffer.insert(textArea.getCaretPosition(), "\n'Comment in/out sections as needed");
buffer.insert(textArea.getCaretPosition(), "\n'--------------------------------------------------------------");
buffer.insert(textArea.getCaretPosition(), "\n\n\tstr");
buffer.insert(textArea.getCaretPosition(), "\n\t\tscale @ 0.0001");
buffer.insert(textArea.getCaretPosition(), "\n\t\tPhase_Density_g_on_cm3(0)");
buffer.insert(textArea.getCaretPosition(), "\n\t\t'append_bond_lengths");
buffer.insert(textArea.getCaretPosition(), "\n\t\t'Out_FCF(" + buffer.getPath() + ".cif)");
- {%sgrp "Enter Space Group:"}{@
textArea.goToEndOfLine(false)
}\n\t\tspace_group {$$sgrp}
- {%phname "Enter Phase Name:"}{@
textArea.goToEndOfLine(false)
}\n\t\t\phase_name {$$phname}
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tCubic(@ #)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tTetragonal(@ #, @ #)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tHexagonal(@ #, @ #)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tRhombohedral(@ #, @ #)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\ta @ #\n\t\tb @ #\n\t\tc @ #\n\t\tal @ #\n\t\tbe @ #\n\t\tga @ #");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tsite $site x # y # z # occ $atom # beq #");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\ttweightingsite $site x # y # z # occ $atom # adps");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\t\tview_structure");
- {%wavelength "Enter Wavelength:"}{@
textArea.goToEndOfLine(false)
}\n\tlam ymin_on_ymax 0.0001 la 1.0 lo {$$wavelength} lh 0.5
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tstart_X #");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tfinish_X #");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n'Approximate method - better to add second phase");
buffer.insert(textArea.getCaretPosition(), "\n\tla @ 0.0010 lo 1.39222 lh 0.5 'CU KB");
buffer.insert(textArea.getCaretPosition(), "\n\tla @ 0.0010 lo 1.47639 lh 0.5 'W LA");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tappend_bond_lengths");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tDistance_Restrain($site1 $site2, #ideal_dist, 0.000, #tolerance, #weight)");
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tdo_errors");
- {%phname "Enter Phase Name:"}{@
textArea.goToEndOfLine(false)
}\n\t\t\phase_name {$$phname}
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\n\tcalc_pattern(10,90,0.02,calc.xy)");
-
do_cif(v) {
t = v.getTextArea();
b = t.getBuffer();
t.goToEndOfLine(false);
b.insert(t.getCaretPosition(), "'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Calculated Pattern");
b.insert(t.getCaretPosition(), "\n'Assumes Cu Ka2, no monochromator");
b.insert(t.getCaretPosition(), "\n'Change as appropriate");
b.insert(t.getCaretPosition(), "\n'Youll need Durham calc_pattern macro:");
b.insert(t.getCaretPosition(), "\n'macro calc_pattern(start,stop,step,filename) {yobs_eqn !aac.xy = 1; min start max stop del step xdd_out filename load out_record out_fmt out_eqn { \" %11.5f \" = X; \" %11.5f\\n\" = Ycalc;}}");
b.insert(t.getCaretPosition(), "\n'is similar");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\niters 0");
b.insert(t.getCaretPosition(), "\ncalc_pattern(10,90,0.02,calc.xy)");
b.insert(t.getCaretPosition(), "\nLP_Factor(!th2_monochromator, 0)");
b.insert(t.getCaretPosition(), "\nCuKa2(0.0001)");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
b.insert(t.getCaretPosition(), "\n'Information on structure - add beq values as needed");
b.insert(t.getCaretPosition(), "\n'--------------------------------------------------------------");
jEdit.setProperty("vfs.browser.last-filter", "*.cif");
w_path = jEdit.getProperty("ta.last_cif_path");
if (w_path == null) {
w_path = jEdit.getProperty("ta.main.dir") +"cif\\";
}
jEdit.setProperty("vfs.browser.last-path", w_path);
waitForConsole(v);
VFSFileChooserDialog chooser = new VFSFileChooserDialog(v, w_path, VFSBrowser.OPEN_DIALOG, true);
String[] files = chooser.getSelectedFiles();
if (files != null) {
int i = 0;
b.beginCompoundEdit();
while(true) {
runInSystemShell(v, jEdit.getProperty("ta.main.dir"));
waitForConsole(v);
runInSystemShell(v, "cif1 " + "\"" + files[i] + "\" cif1.tmp");
waitForConsole(v);
t.goToEndOfLine(false);
b.insert(t.getCaretPosition(), "\n");
b.insertFile(v, jEdit.getProperty("ta.main.dir") + "cif1.tmp");
VFSManager.waitForRequests();
i++;
if (i == files.length) break;
b.insert(t.getCaretPosition(), "\n");
}
b.endCompoundEdit();
jEdit.setProperty("ta.last_cif_path", files[0]);
}
t.goToEndOfLine(false);
b.insert(t.getCaretPosition(), "\n\t\tscale 0.001");
b.insert(t.getCaretPosition(), "\n\t\tr_bragg 0");
b.insert(t.getCaretPosition(), "\n\t\tTCHZ_Peak_Type(!pku, 0.00039,!pkv, -0.00221,!pkw, -0.00146,!pkx, 0.0000,!pky, 0.00957,!pkz, 0.0000)");
b.insert(t.getCaretPosition(), "\n\t\tSimple_Axial_Model(!axial,0)");
b.insert(t.getCaretPosition(), "\n\t\tPhase_Density_g_on_cm3(0)");
}
do_cif(view);
-
textArea.goToEndOfLine(false);
buffer.insert(textArea.getCaretPosition(), "\nno_LIMIT_warnings");
-
Macros.getMacro("TAInsertSTR").invoke(view);
- {%alphaval "Enter Incident Beam Angle in degrees:"}{@
textArea.goToEndOfLine(false)
}\n\tFIXEDTHETA(alpha, {$$alphaval})\n\tSDINEL(!delta,0,!alpha,{$$alphaval})