четверг, 8 октября 2009 г.

well, I use some Fullprof tricks (Notepad++)

[geeks to scientists]

This blog was supposed to contain different tutorial on Fityk. However, being lazy, I decided to post here practical tips and tricks I know.

This fine evening I would like to share some skills on editing Fullprof .PCR files .
As many of Fullprof users already know, this package, thanks to enormous contribution of its authors allow us, simple users to work with x-ray and neutron powder diffraction, fairly easy. And this amazing piece of software is one of the best if you want to calculate magnetic contributions. Of course, I am a fan GSAS, as many other people do, for its intuitive interface. But current way of calculating magnetic structure in it, the command line way to enter parameters of the magnetic structure and constrains depresses me a lot. In this sense, I like Fullprof more - if you know how to write .PCR file, you get result faster.
Yes, one must really know what to write and how to write into .PCR file of Fullprof. The EdPcr program helps sometimes, but I think most people still stick to Notepad editing. Today, I would like to introduce Notepad++ and explain how, this software eases my life.
The magic work is highlighting! Yes it does highlighting. And there are other beautiful features. What I like most is the automatic check for changes made to open file from outside. With Fullprof creating .NEW files or overwriting .PCR files, the help of this feature is hard to overestimate. It is just brilliant!:)
But back to highlighting. Take a look at this picture.
You don't have to worry know about the parameter you changed, where it was, green highlighting also helps a lot in navigating.
The questing now is how to make it. First I will tell you about the highlighting, because I simply love it!
  1. Download Notepad++
  2. Install Notepad++.
  3. Open any Fullprof file, but clicking with right mouse button on a file and selecting 'Open with Notepad++'
  4. From Notepad++ program Menu select View->User Define Dialog... and start to change things.
  1. First - let us save 'New Language' - new setting - please press button Save As.. as 'User', for example.
  2. After that select our new settings in the combobox shown.
  3. Go to the tab Comment & Number
  4. Change background color
  5. Select the checkbox Treat keyword as symbol and add '!' - the exclamation mark to the field below.
  6. Just close the dialog, go to Notepad++ Menu Language->User and Here and Now you have your highlighting which make it easier for me to navigate through the file.
Of course, you can play in View->User Define Dialog... with other funny things, like keywords, and so on, but for this post it is enough. Remember - the main point of highlighting is that it simplifies navigation. So here comes the last part of this post - if you are tired and completely lost in your .PCR file. You forget, for example - the parameters you refine and how many of them, this last part will be of great help to you. How do we find parameters which are refined now? According to CODEWORDS - which are numbers like 11.00, 21.00, 31.00 and so on. If you want to refine two parameters simultaneously, so that they have the same value and change by the same step, this is the case for the lattice parameters, then you assign same CODEWORDS for a, b and c lattice parameters, for example. How to find these CODEWORDS? I will show it for the simple case, for the numbers like X1.00, where X is integer. Call Find dialog by pressing CTRL+F or by calling menu item Search->Find...
  1. Put pattern \s*[1-2-]*[0-9][1]\.[0]+[^1-9][\s]*  into the edit box. This pattern will show you first 29 simple CODEWORDS.If CODEWORDS are not simple, then \s[1-2]*[0-9][0]\.[1-9][0-9]+\s should do the trick.
  2. Select the check boxes Mark Line and Style found token
  3. Select the radio button Regular Expression
  4. And finally press Find all button
If you want, you can also use pattern \s[0\.]+[^1-9][\s]*, but please do not forget to use Search->Unmark all and Search->Clear all bookmarks in Notepad++ Menu or Clear button in Find dialog. Enjoy! You should obtain highlighted text and markers as shown on the picture. And sorry for my poor English.:) Some Notes: It is better to make a shortcut to Search->Clear all bookmarks. This you can do in Settings->Shortcut Mapper.... I use CTRL+ALT+SHIFT+C.
To find all the patterns above it is better to start searching as close to the beginning of file as possible, or starting from 'Number of refined parameters' Fullprof setting.