professa has asked for the wisdom of the Perl Monks concerning the following question:

Hi dear fellow monks,

I'm searching for a module which allows me to write a dataset (currently stored as a one-dimensional Perl array) in xmgrace/Grace format to a file. On CPAN I found some modules (Chart::Graph::Xmgrace / Chart::GRACE), but they seem to be meant to interact with Grace, not to be used for writing Grace-formatted files.
Did I miss anything? Any hints where I should point my nose at?

Cheers, Michael
  • Comment on Plotting (writing!) data XMGRACE/GRACE-formatted

Replies are listed 'Best First'.
Re: Plotting (writing!) data XMGRACE/GRACE-formatted
by Anonymous Monk on Aug 12, 2003 at 09:31 UTC
    http://www.itc.virginia.edu/research/xmgrace/FAQ.html

    6. Basic Concepts

    6.1 What is a project?

    A project is a file which contains all information necessary to restore a plot created by Grace.

    6.2 What is a parameter file?

    A parameter file contains informations about settings. Every batch command of Grace is a valid line in a parameter file. A parameter file is essentially a project file without sets in a slightly different format (i.e. without leading @s).

    6.3 Which data formats does Grace recognize?

    You can read in several kinds of files where data is arranged in columns separated by spaces or tabs.

    Files which are not in simple x y format must have a line @TYPE xytype before the actual data, where xytype stands for the set type. Refer to the User's Guide (question User's Guide) for details. Alternatively, the file format can be set with a command line switch.

    6.4 What is block data?

    The option Read Block Data can be used to read in files where the values are organized in columns. You can interactively select the type of set to be created and which columns should be used. Refer to the User's Guide (question User's Guide) for details.

    6.5 What is the NXY data type?

    Strictly speaking, it's not a data format. Rather, you may want to use the relevant command line switch to read in a block data file and automatically assign the data columns to sets of the XY type so that the first column of the block data is used as X for all the sets and the rest of the data columns are assigned to Y's. Refer to the User's Guide (question User's Guide) for details.

    6.6 What is the Julian Date?

    The Julian Date, not to be confused with the Julian calendar, is a format to represent the time in a single number. Julian Date 0 is a day way in the past, namely the 1st January 4713 before Christ (don't ask me why). The following days are numbered sequentially, each day starting at noon. This numbering scheme is in wide use, especially in astronomy, and is used for the internal representation of dates in Grace. Some further explanations are given on this page.

    The convcal utility in $GRACE_HOME/auxiliary/ can be used for about any to Julian date convertion.