Skip to content

Conversation

@drroe
Copy link
Contributor

@drroe drroe commented Aug 28, 2018

This PR focuses on extending the functionality of the calcstate command, and adds functionality related to data set handling and data file writing to allow calcstate results to be more easily parsed.

The calcstate command

  • Allow states to have multiple criteria. Previously a state could only be defined by a single data set bounded by a minimum and maximum value. Now multiple data sets can be used to define a state, each with their own min/max value. These are simply added to the comma-separated list. For example, to define a state as having a distance named dist between 0.0 and 5.0 Ang. and an angle named ang between 30 and 60 degrees:
calcstate state State1,dist,0.0,5.0,ang,30,60 ...
  • Allow states to be define more than once. This has the effect of allowing a state to match 1 or more sets of different criteria. For example, to define State1 as having a distance between 0.0 and 5.0 Ang. and an angle between 30 and 60 degrees or an angle between 0 and 10 degrees:
calcstate state State1,dist,0.0,5.0,ang,30,60 \
                        State1,dist,0.0,5.0,ang,0,10 ...
  • Add output of individual state counts and fraction present.
  • States now have priority. Subsequent states can override previously defined states.
  • State and state lifetime data are now stored as data sets. Aspects are as follows:
[Count] - Number of times each state was present.
[Frac] - Fraction each state was present.
[Nlifetimes] - Number of state lifetimes.
[Avglife] - Average length of lifetime in state.
[Maxlife] - Longest lifetime in state.
[Name] - State names.
  • Now correctly count final frame when transition does not occur on final frame.

In addition, some new features were added that help support formatting calcstate output (and will likely be useful for other kinds of output.

Invert 1D data sets

Add invert mode to the dataset command. This will take a group of M 1D data sets of size N and create N new "inverted" data sets of size M. This is similar to the invert keyword already available for standard and Grace data writes, but operates directly on data sets. For example, given the following two data sets:

D0 D1
 1  4
 2  5
 3  6

The new data sets will be laid out like so:

N0 N1 N2
 1  2  3
 4  5  6

The command has the following format:

dataset invert <set arg0> ... name <new name> [legendset <set>]

legendset can be used to specify a STRING data set containing legends for the new data sets.

The dataset invert command can be useful if you want to easily view output from multiple analysis commands in a single graph. For example, to view state counts from two different simulations side by side:

calcstate name Sim1 state bound1,dist1,0.0,2.0
calcstate name Sim2 state bound1,dist1,0.0,2.0
runanalysis
dataset invert Sim*[Count] name Inverted legendset Sim1[Name]
dataset dim xdim label Simulation min 1 step 1 Inverted*
writedata statecount.agr Inverted*

Miscellaneous

  • When writing Grace files, if a single data set containing names is present assume they contain data point labels and write them as such.

Daniel R. Roe added 20 commits August 23, 2018 12:25
…ively acts as an 'OR' operator in addition to the implicit 'AND'
… changed slightly and certain parts are not automatically written to stdout anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant