No announcement yet.

How do I export my data in ASCII format?


  • How do I export my data in ASCII format?

    Force plots to ascii format.
    In versions 16.02.180 and above there is a function you can run from the command line (Ctrl + J to bring forward) to export ARDFs as ascii

    Function AsciiExportARDF(FMapName)
        String FMapName
    FMapName is the name of the file, without the extension ex: "Image0010"

    In the 101010 software there is a function you can run from the command line (Ctrl + J to bring forward) to export the listed force plots as ascii.
    Function AsciiExportForce(FPMask,DataFolderMask,PName,[SaveForce])
        String FPMask, DataFolderMask, PName
        Variable SaveForce
        //Command line function to export force plots as ascii force plots
        //FPMask is a mask of force plots Names
        //If FPMask is "*", it will save all the force plots that are listed.
        //DataFolderMask is the mask of folders to allow to be saved.
        //PName is the Name of the symbolic path you want to save ascii to.
        //if empty string, it will be AsciiExportPath
        //if the path is invalid, it will ask you to specify the path.
        //if you cancel from that dialog, this function will return, doing no export.
        //    AsciiExportForce("*","*","")
        //to save all the force plots listed, it will ask you where you want to save them.
        //to only save the Force plots in ForceMap01
        //14.13.132, changed this syntax to load the force plots from forceMap01 and export them
        //to only save the BigCell force plots
        //NOTE, this function will automatically overwrite force plots.
        //so if you want to save 2 force maps, you need to do so 1 at a time
        //to separate folders, otherwise the second force map will overwrite the first one, since the force
        //plots have the same names [line0000point0000]
    Images to ascii format.
    Most programs looking for ascii images want just a single image at a time. Our images are really multi layered images, each layer being a different channel. So the first step is to pull out the layer you care about.
    1. Open up the image in our review software.
    2. Display the layer you care about.
    3. Go to the commands popup menu above the tabs on the offline image graph.
    4. select Extract layer.
    5. This brings up the command window and prints out some information.
    6. Now you can save this data using the data -> Save Waves -> Save Save delimited Text menu.
    7. Select LayerData in the upper left corner. That is the data you just pulled out with the extract layer command
    8. Most ascii import programs want raw data, so turn off the add wave name that is turned on by default.
    9. Click Do it, and it will ask you where to save.
    10. Give it a better name than LayerData so you can remember where is came from

    These instructions are very general, if you are looking for a wave that is not an image or a force plot, try these.
    90% of the battle is finding the wave.
    For any wave displayed on a graph:

    New Quick and dirty way in Igor 6

    This way makes a table of the trace, and you can copy and paste that into your spread sheet or notepad. It is a fairly good way to get force plot data exported, since it grabs the X data with it. But it depends, in the offline, it will only grab 1 section at a time, extend, retract, or a dwell. In the realtime force, it will grab the entire force plot, so there are options.

    1. Right click on the trace you want to export.
    2. Select Edit
    3. Right click on the Table.
    4. Select Digits, then select the highest number there (16 at the moment).
    5. Hit Ctrl + A, to select the entire table
    6. Hit Ctrl + C to copy the contents of the table to the clipboard.
    7. Paste your ascii data into your preferred format.

    Older-slower-more-general-way for more precision

    1. Double click on the wave. You get a modify trace dialog.
    2. Hold Down the left mouse button on the name of the wave that looks like the correct wave. The box below then shows the data folder that is holding that wave.
    3. A different way to find the folder (which I just learned myself) is to hit Shift + F1, then click on the trace. This brings up a tooltip type box with the names of the waves, and the data folders.
    4. Go to the Data -> Data Browser menu.
    5. Locate the data folder that was shown by the dialog.
    6. Alt + left click to the left of that data folder. There should now be a red arrow pointing at that folder and letting you know that you are sitting in that folder.
    7. Go to the Data -> Save Waves -> Save Delimited Text menu.
    8. Select the wave from the list of waves in that data folder.
    9. Click Do it. Then select where you want to save that .dat file.
    [*]Note images are layered waves, 3 dimensional. Ascii can only handle 2D waves, so the layers are stacked in the rows.

    EX: (type into the igor command line)

    • Make/N=(3,4,2) LayeredImageWave

    • LayeredImageWave = P+Q*10+R*100
    [P is row index, Q is column Index and R is layer Index, all indexes start at zero]

    • Save/J/M="\r\n" LayeredImageWave as "LayeredImageWave.txt"
    saves the dat file with this in it:

    0 10 20 30
    1 11 21 31
    2 12 22 32
    100 110 120 130
    101 111 121 131
    102 112 122 132

    As you can see the 4th row and above are > 100, they came from the second layer of the igor wave.

    So you can either deal with all the data in 1 wave, pulling the layers out that you want.
    Or you can save only the layer you care about by first extracting the layer (with the command popup, extract layer) and then saving the wave LayerData as the ascii.

    • ted
      ted commented
      Editing a comment
      This question was answered by Bemis via email. Here is the answer for future reference:

      This is the code it takes to load the ARDF note from the disk:

      Function/S GetARDFNote([FileRef])
          Variable FileRef
          if (ParamIsDefault(FileRef))
              FileRef = GV("ARDFOfflineFileRef")
          Struct ARFMapData File
          String output = File.Header
      End //
      If you call
      String NoteStr = GetARDFNote()
      it will load the note from the "active" offline ARDF file, which is going to be the last one that needed to load data. So if you click on a pixel of the ARDF you care about, that will make it active. You can test the name of the active file with this command:
      print ARDF_GetFileName(GV("ARDFOfflineFileRef"))

    • Bemis
      Bemis commented
      Editing a comment
      As of 14.13.132 AsciiExportForce("*","MyForceMap00","") will load up the force plots that have not been already loaded, export them, and then dump them from memory. The FPMask must be "*" and the DataFolderMask must not contain a "*" in it, otherwise it will use the older method of working with what is in memory.

    • chris0917
      chris0917 commented
      Editing a comment
      Questions about exporting force curves

      I tried AsciiExportForce command and it works fine for me (120804+2019). However, I noticed two things. Firstly, it exported EVERY channel and each as a separate file. I failed to figure out how to export specific channels (e.g. just export separation and force channels). Also I have to go through each individual force curve in the ForceMap manually in the software before I may extract force and separation information, otherwise the command only export raw data and voltage channels.

      Added 11/12/2015: anyone has an idea how to specify the export path in AsciiExportForce command? I tried something like asciiexportforce("*","SET1_FM00","D:temp:20151022: SET1_FM00:") but it still pop up the path selection window.
      Last edited by chris0917; 2015-12-11, 06:56 AM.
    Posting comments is disabled.



Latest Articles


  • Software version compatability
    by Bemis
    There is an issue with the XYZ gains and older versions of the software.
    If you go to version 12 or above, then your system will be using the new gain system. Once you go to the new gains, your instrument should not use versions < 101010.

    If you want to continue using 101010, you need to make sure it is >= 101010+4706 If you want to continue using 111111, you need to make sure it is > 1126 ...
    2015-05-08, 01:14 PM
  • Building a New real time computer
    by Bemis
    Current recommended system:

    Dell Precision T3500 Workstations
    Intel QuadCore Xeon 3500 series (2.80GHz)
    6GB DDR3 RAM
    2 320GB SATA Hard Drives (RAID1 mirror)
    2012-05-24, 11:14 AM
  • How to install Asylum USB Drivers
    by Bemis
    There are currently 2 versions of the USB drivers, we will refer to them as old and new. The version of the MFP3D software you want will determine if you need old or new drivers.

    MFP3D Version Old Drivers New Drivers
    2011-06-28, 10:02 AM
  • How to write code to click on buttons
    by Bemis
    One of the easiest ways to get started writing Igor code is to write something that simply clicks on Asylum buttons in a certain order. Here is how to get started with that. 1) Bring up the panel that has the button you want to click on. 2) Hit Ctrl + T to bring up the tools for the panel. 3) Click on the second button on the left that now shows. 4) Double Click on the button you want to use. 5) For buttons there are 2 things you need to get from this dialog. The Control name (First ...
    2011-02-02, 08:39 AM
  • Running Copies of the Igor Pro / AR Software
    by Bemis
    There are typically two main reasons to make a copy of the Igor Pro / AR Software, and they are slightly different.
    1. You want to try out some new MFP3D code. There is a new feature that is in the unstable code that you want to try out, but it is the new code. There are going to be bugs, and so you want to be able to go back quickly, and you don't want other people in the lab to have to deal with the new bugs. This is by far the most common reason, and the easier way to make a Igor
    2010-03-17, 03:11 AM
  • Reporting Bugs
    by ARadmin
    Send bug reports to [email protected], but to help us resolve it quickly, please read on and learn how to compose a useful report for us to work from.

    Composing your Bug Report

    Effective bug reports are the most likely to be fixed. These guidelines explain how to write such reports.

    • Be precise
    • Be clear - explain it so others can reproduce the bug
    • One bug per report
    • No bug is too trivial to report - small bugs may hide big
    2010-03-17, 01:51 AM