8.2. プロジェクトファイル¶
出力ファイルのうちで最も重要なのはプロジェクトファイルです.プロジェクトファイルは,読み込んだデータ全て,それぞれのデータに関連づけられた全てのパラメータ,ジャーナルの内容,そしていくつかのその他の重要なデータを含みます.これらすべては単一の簡単に受け渡しできるファイルに書き込まれます.
プロジェクトファイルの第一の目的は作業中のデータを保存することです.保存されたプロジェクトファイルを開くと,すべてのデータとそのパラメータが ATHENA に読み込まれ,ATHENA はそのデータが保存された際の状態に戻ります.ARTEMIS (EXAFS データ解析を行うための ATHENA の姉妹プログラム) はこれらのプロジェクトファイルを読み込むことができます.よって,プロジェクトファイルは,データを2つのプログラム間で受け渡すためのベストな方法と言えます.
さらにすばらしいことに,プロジェクトファイルは共同作業のための形式でもあります.ファイル形式はプラットフォームから独立しています.あるコンピュータ上で書き出されたプロジェクトファイルは他のコンピュータでも読むことでき,例え,これらのコンピュータが別の OS を利用していても問題はありません.プロジェクトファイルは CD に書き込んだり,web サイトに置いたり,共同研究者にメールで送ることもできます.
プロジェクトファイルを保存するには,以下に示すように File メニューの選択肢の1つを選択すればよいだけです.
最初の2つの選択肢は,ATHENA の現在の状態を保存するものです.プロジェクトがすでに保存されていれば,Save project は現在の状態で以前のファイルを上書きします.Ctrl-s と打つと同じ効果があります.もう1つは,Save project as... を選択すると,プロジェクトファイルの新しい保存名を入力するように促されます.
最後の選択肢はマークをつけたグループだけをプロジェクトファイルに保存します.これは,ある種の “sub-project” ファイルと考えることができます.これも ATHENA でマークが利用される場合の1つです.
スクリーンの上部の Save ボタンは現在のプロジェクトを保存し,必要であればファイル名を入れるように促されます.ATHENA を使っていると,このボタンは赤色に変わり,保存が必要なことを伝えます.
ご用心
どんなソフトウェアであっても,できるだけ頻繁に保存することが重要です.ATHENA と IFEFFIT にも弱点(バグ?)があります.多くの保存されていない作業を終えた後で,バグの1つを踏んでしまうことは残念なことです.
8.2.1. さらなるボタン¶
メインウィンドウの上部には,Save ボタンがあり, を選択するのと同じ効果があります.ATHENA を使っていて,このボタンの色が変われば,保存した方がよいという目安です.プロジェクトを一度保存すると,ボタンは元の色に戻ります.
Save ボタンの色が変わる頻度は,環境設定 の ♦Athena→save_alert で変更することができます.これを小さな値に変えると,ボタンの色が早く変わり,大きくすると,ゆっくり変わります.0 にすると,このオプションはオフになります.
8.2.2. プロジェクトファイル形式と古いバージョンとの互換性¶
The ATHENA project file is designed to be quick and easy for ATHENA to read. Unfortunately, the file format is not particularly human-friendly. Most of the lines of the project file are in the form written out by perl's Data::Dumper module. This freezes ATHENA's internal data structures into perl code. When the project file is imported, these lines of perl code are evaluated. (This evaluation is performed in a Safe compartment, i.e. a memory space with restricted access to perl's system functionality. This provides a certain level of protection against project files constructed with malicious intent.)
プロジェクトファイルはポピュラーな gzip を使って最高レベルの圧縮率で圧縮されています.但し,一般的な .gz という拡張子は使っていません.ATHENA と ARTEMIS ともにこれらのファイルを使います.
8.2.3. Saving state of analysis tools¶
バージョン 0.9.25 で追加: The states of the LCF, PCA, and peak fitting tools are now saved in the project file. These states will be restored from a project file if (and only if) the entire project file is imported. Importing only a subset of the groups in the project file will fail to trigger the import of the analysis states.
In the original format, these are additional Data::Dumper strings written to the project file. These lines should be silently ignored by earlier versions of DEMETER.
In the JSON format (see below), they are written just prior to the
_____journal line and have these descriptive keys in the JSON
dictionary: _____lcf, _____pca, and _____peakfit. The
lineshape objects used by the peak fitting tool have keys like
_____lineshape0, _____lineshape1, and so on.
8.2.4. The new JSON-style project file¶
バージョン 0.9.21 で追加: A new feature in ATHENA allows one to write project files in the form of a compressed JSON file. That is, the data that are compressed can be interpreted by any JSON parser. Thus, if you want to use some other language to handle data processed by ATHENA and you want a good pipeline from ATHENA into your code, you could save your project file in the new, JSON format. See the ♦Athena→project_format configuration parameter.
Note, however, that this project file format is entirely incompatible with earlier versions of ATHENA. Versions since 0.9.21 will recognize and read the JSON-style project file regardless of the value of ♦Athena→project_format.
8.2.4.1. Summary¶
- JSON-style project file is valid JSON, possibly gzipped
- File contains a single dictionary
- An entry with the key
_____header1contains the string and is in the first four lines of the file. This is used by DEMETER to recognize the project file. - An entry with the key
_____ordertakes a list of strings as its value. This is used to presevre the order of presentation of the data regardless of how a JSON parser orders the keys in the dictionary. - Data groups use a group name as the key and take a dictionary as
the value. This dictionary contains a key called
argswhich takes a dictionary of attributes and values, a keyxcalled with a vlue of a list containing the abscissa array, and a keyycalled with a value of a list containing the abscissa array. Other optional arrays are possible. - Every data group has a unique group name used as its dictionary key.
- The
argsdictionary has several required attributes, includingdatatype, which is used to interpret the content ofxandy. - Other data processing attributes can be specified in
argsor ATHENA can be relied upon to set sensible defaults. - A project journal is optionally specified with the key
_____journaland a list of strings containing the jounral text. - State of the LCF, PCA, and Peak Fit analysis tools are optionally
saved with keys
_____lcf,_____pca, and_____peakfitwith the lineshape objects used in peak fitting saved as_____lineshape0,_____lineshape1, and so on.
8.2.4.2. Fields in the JSON file¶
The JSON-style project file is typically saved as a gzipped file with
a .prj extension. ATHENA/ARTEMIS are able to
read the file gzipped or as plain text. That is, an external
application can save an ATHENA project file with or without
compression.
The project file is a single serialized dictionary. (I'll use pythonic language in this document. By dictionary, I mean what another language might call a hash or an associative array.) Each entry has a key and a value. The value is typically a dictionary or a list.
There are several special fields that the JSON-style project file must contain so that ATHENA can properly process the file and preserve the order of display of the data contained in the file.
Special fields all begin with 5
