Wednesday, March 7, 2012

Saving data and figure of SSS

Okay. 
To add a title or change axes, labels in the figure, click [configure] then type in the box, then press [Enter] on your keyboard.

To save a figure: 
1.    When the graph has popped up, click [copy graph] in the top right. This opens a new window with the plot.
2.    Click [save postscript...] then in the new window type the name you wish in the Selection box with '.ps' at the end, e.g. T100K.ps . Then click [OK] or press [Enter] on your keyboard.
This saves my plot in the current window as a postscript in the sss/bin folder where all the drude.exe files are. These images can be opened in GSview, Inkscape, GIMP, PowePoint  and handled in the usual manner.

To save the data in the plot: 
1.    When the graph has popped up, click [copy graph] in the top right. This opens a new window with the plot.
2.    Click  [save data...] then in the new window, type the name in the Selection box followed by '.csv' at the end, eg. T10K.csv . Then click [OK] or press [Enter] on your keyboard.
This saves two or four columns of data of current window as a postscript in the sss/bin folder where all the drude.exe files are. 
For 2-column data, guess is that second column is the deviation, first column is unknown. For 4-column data, guess is that last three columns is deviation (or maybe just column 2 and 4), no idea for what first column is.


For those who were at tute, it is just what we were doing (at one stage), but with .ps or .csv at the end of the name!

4 comments:

  1. Thanks for posting this. It is a great help.

    ReplyDelete
  2. Hey Ann,
    Colours are fun! I think that yellow is a bit hard to see on a white background, but the other colours are okay. The best ones are orange, red, dark blue, (black :) ), and magenta, so maybe a darker green would be good too.

    On the data saving:
    The default file saved by the simulator is a tab-delimited data file (easy to copy into Excel, for example), which can be opened with your friendly neighbourhood text-editor (Windows = Notepad, Andy = EMACS? :) ). I just tried csv format, and it looks like it delimits with a full stop (.), but if it works, it works....

    Each set of data is represented in two columns, the first being time (in ps or whatever units are used by the simulator), the second being the actual data (so deviation or average, whatever you have set; units, again, whatever the simulator uses). By default, the simulator plots two sets of data, the x-directional data and the y-directional data. These data sets are separated in the data file by an ampersand (&) (for ease of processing, presumably; makes it easier in Excel!). So a standard plot, with default options, will have three two-column sets of data: x(or y)-deviation, electric field and y(or x)-deviation. By default on setting Drude01 the field is zero, so you would see the second block of data as just a lovely bunch of zeros next to the time information.

    Also, if you haven't discovered this, it's quite handy: if you want time to start at zero again after you've done a simulation, just click initialise.

    Josh H.

    PS: Can you colour comments, too?

    ReplyDelete
  3. Yeah, it's not comma separated -> tab delimited, but saving it as csv works-> isn't that all that matters? Perhaps save as '.txt'?

    Opening in excel is still messy - it's just one long column with the &'s a fair way down the page.

    Opening in notepad and matlab, there were different numbers of columns - writing a code to neaten it seemed like it would be too much - I'd also have to figure out which column was which!

    Seems to make sense to have the different sets separated. The first column as time seems to fit, but it only takes the last 1000 points?


    I got an error message trying to colour the comment:
    Your HTML cannot be accepted: Tag is not allowed: DIV

    ReplyDelete
  4. You don't need to save it as anything, the 'file' is just a non-titled bit of data. Although .txt is good too (basically, .txt tells Windows/operating system that this was intended to be a text file; for most stuff, you can just save a file as whatever .??? you want. Harder with notepad, but a command prompt does it usually).

    Different numbers of columns? Could be different with different presets/data/variables, but that is strange sounding based on what I've observed. I didn't try to open directly with MATLAB, I copied from the non-csv file (i.e. the one you save without an extension) and then did stuff there (e.g. averaging) which you could do in MATLAB, and then copied the values into MATLAB via command line (and brackets...).

    ReplyDelete