Crystal Impact Home  
  About version 5 New functions Feature tour Download  

Diamond Version 5 User Manual: Structure files

Saving and exporting structure data

In this article:
Saving Structure and Picture Data
Saving Structure Data in Foreign Formats
"Save Structure As" command
"Export" command
Auto Save function
Temporary files

Previous article: Database with inorganic structure types
Next article: Entering a new structure


Overview

There are several commands available to store different kinds of data in several formats at certain places:

File menu with several commands to save and export data

Save
to store an existing entire document with the same name in the same folder where it has been opened from or where it has been saved with Save Document As before.

Save Document As
to store the entire document with a different name or at a different place or in a different format.

Save All Documents
behaves like Save but saves all open documents (if you have opened multiple documents in multiple windows in a Diamond session) that are not "clean", that means have been changed but not yet been saved.

Save Structure As
offers to save just one structure data set and one picture or selected or all associated pictures.

Save Graphics As
offers to save graphics in 2D bitmap format or a 3D format or as Windows metafile.

Export
offers to save structure/picture or image or textual data into a special ("export") target folder. 

 


Saving Structure and Picture Data

All data of the structure document (structural parameters as well as picture data) will normally be saved in a file with the Diamond Document File format ("diamdoc" file extension). Only this format stores all data to reproduce a structure picture exactly when it is opened later.

To save the structure document with the existing name (which is given in the structure window title)

·       choose the Save command from the File menu,

·       or use the "hotkey" Ctrl+S,

·       or push the corresponding button in the standard toolbar: File Save button from default toolbar

To save the structure document with another name (or in another directory or on another drive), choose the Save Document As command from the File menu. This will open the Save As dialog. The existing name of the structure document is displayed in the File name input field. Do not change the setting in the File type combo box (which is "Diamond 3/4/5 document (*.diamdoc)" whenever the Save As dialog is called), unless you want to export the structure in another format (see "Exporting Structural Data to Foreign Formats"). When the structure document is saved with a new name, this new name becomes the new title of the structure window.

Default folder to save a Diamond document in

The folder used in the Save As dialog window where to store the Diamond document can be the same folder where the document has been opened from. Or it can be the folder where you saved the latest Diamond document. This behaviour can be changed in the Tools/Options dialog on the File page.

The default behaviour of Diamond version 5 is to come up with the folder where the document has been opened from. This behaviour is different from the default behaviour of Diamond version 4 and earlier, where the latest used folder was used when opening the "Save As" dialog - independent from the source folder of the document. The reason for this (previous) behaviour was that more likely the document was opened from a foreign format file, typically a CIF or Shelx file or so, and the final structure pictures were deposited or collected at a different place on the computer.

The default behaviour of Diamond version 5 is corresponds with the behaviour of most Windows applications. If you prefer the behaviour of Diamond version 4 and earlier, go to the File page of the Tools/Options dialog and set the checkmark at Persistent folder for Save Document As command.

If you regularly want to deposit Diamond structure picture files at a special target folder, you should have a look to the Export command (File menu), introduced in Diamond version 5, see below.

Saving all structures

If multiple structure documents (in multiple structure windows) have been opened, you can easily save them all with the existing names by choosing the Save All command from the File menu.

 


Saving Structure Data in Foreign Formats

To save structural data in a non-diamdoc format, choose the Save Document As command from the File menu. This will open the Save As dialog. Since the default file format is the diamdoc format, you should first select the desired foreign file format.

Diamond offers two kinds of formats:

(1) Formats to save structural parameters (with or without structure picture data).

(2) Formats to save graphical data.

The saving of graphical data (2D bitmap data, metafile, or 3D graphics file) is treated in the articles "Saving the Structure Picture as 2D Image File" and "Exporting 3D structure picture data".

Structural parameters can be saved in the following formats:

File format

Default extension

Description

Diamond 1.x

DS1

Binary file format used by Diamond version 1.x (compare the article "File formats").

Diamond 2.x DSF Binary file format used by Diamond version 2.x ("Diamond Structure File").

CIF

CIF

Crystallographic Information File.

CRYSTIN

CRY

The download format which is created by the retrieval system of the Inorganic Crystal Structure Database (ICSD).

CSD-FDAT

CSD

The FDAT format which is created by the "SAVE 3" command from the retrieval system of the Cambridge Structural Database.

Protein Data Bank

PDB

The Brookhaven Protein Data Bank format.

SHELX

DAT

The Shelx-93 format.

XYZ

XYZ

The XYZ format.

Schakal

DAT

The Schakal format.

 


"Save Structure As" command

The command File -> Save As -> Save Structure As saves the current structure data set together with its associated pictures in a file of Diamond document file type or into a foreign format. This differs from the Save Document As command, which saves the entire document.

 


"Export" command

The command Export has been introduced in the File menu in version 5 of Diamond to store structual and picture as well as diffraction data, graphics (2D or 3D) or textual data into a certain folder.

The "export" of data works similar to what the several Save [...] As commands (which are also available from the File menu or some context menus, e.g. for tables) do - but with the main difference that the exported data are deposited in a special folder (which can be changed via the common Windows Save dialog used after the Export dialog), while the Save [...] As commands use an individual latest folder each.

Export is especially useful, if you frequently import structure data from a special folder and deposit structure picture documents (or may be diffraction data or distance data generated from your imported structures) into a different folder. Alternatively you can restore the behaviour where Diamond stores document data when you run the Save Document As command by setting the checkmark at Persistent folder for Save Document As command on the File page of the Tools/Options dialog as described above.

The Export dialog offers (amongst others) two options to store structural and picture data:

Entire document
This writes the complete content of the active Diamond document to a file. This may be in Diamond format ("diamdoc", DSF2) or a foreign format, e.g. CIF.

Current structure (and picture/s)
This writes the content of the current structure to a file, along with the picture data or data of all pictures (if there are multiple pictures for a structure data set), provided the output format supports picture data.

Screenshot of Export dialog
Example of Export dialog when called from thumbnails view with 3 of 10 pictures marked as selected. The option "Current structure [...]" saves only the data set "Na3 P S4" along with the three selected pictures but not the residual seven other pictures.

Note:
When you export the entire document (first option) in Diamond format (diamdoc), your document will not be marked as "clean". That means, unlike with File -> Save Document As, you will be prompted to save the document yet when you close it or close the Diamond application.

 


Auto Save function

Diamond saves the structure documents of all structure windows in defined time intervals in temporary files. These files can be used to restore structure documents, which have been left due to a system crash or caused by an improper exit of Diamond. When a new session of Diamond is started after such a crash, these documents will automatically be restored to the condition when the structure document has been auto-saved the last time. The document cannot be restored, if the document has not been auto-saved because a new document was younger than the auto-save time interval.

To change the settings of the Auto Save function, choose the Options command from the Tools menu. From the Options dialog, choose the Desktop page. To enable the Auto Save function, check the Auto-Save checkbox. Enter the time interval (in minutes) in the Interval (min.) input field to change the auto-save interval.

 


Temporary files

Diamond uses temporary files in the following cases:

(1) If the opened file has no "diamdoc" or DSF 2 format, the foreign format file is converted into a temporary file in DSF 2 format.

(2) If the file contains multiple structure descriptions, a temporary file is created for every single structure document that is loaded from the Load dialog.

(3) If the Auto Save function has been activated, the contents of all open structure documents will be saved in temporary files from time to time.

The temporary files will be deleted after the corresponding structure windows are closed. A temporary file that has been created from a foreign file containing multiple structure descriptions, will be deleted, when the last structure window is closed that works with data from that file.

Diamond stores temporary files in the "Temp" subdirectory of the Windows directory, or in the directory that is specified with the environment variable "TEMP=xxx" or "TMP=xxx".

If a Diamond session is closed irregularly, these temporary files will stay in the temporary files directory, and you can delete them later manually, for example from the Windows Explorer.

Never delete temporary Diamond files when Diamond is running!

 


Previous article: Database with inorganic structure types
Next article: Entering a new structure