Differences between revisions 2 and 3
Revision 2 as of 2008-09-17 09:09:17
Size: 3662
Editor: UlrikeHeiter
Comment: link added
Revision 3 as of 2009-11-30 12:52:22
Size: 3678
Comment:
Deletions are marked like this. Additions are marked like this.
Line 38: Line 38:
 * /DEBUG a switch to perform text output. In this binary file is not created  * /DEBUG a switch to perform text output. In this case the output binary file is not created

VALD3_ascii2bin

A tool to convert a line list in text format to VALD3 binary format. This operation can be performed on a platform with any byte order.

VALD3 binary record format (190 byte long)

see Vald3Format

  wl             (real*8) wavelength in vacuum
  species        (int*4)  VALD species code
  loggf          (real*4) oscillator strength
  e_low          (real*8) energy of the lower level in cm^-1
  j_low          (real*4)  orbital quantum number for the lower level
  e_upp          (real*8) energy of the upper level in cm^-1
  j_upp          (real*4)  orbital quantum number for the upper level
  lande_low      (real*4) Lander factor for the lower level
  lande_upp      (real*4) Lander factor for the upper level
  gamrad         (real*4) Radiative damping constant
  gamst          (real*4) Quadratic Stark damping constant
  gamvw          (real*4) van der Waals damping constant
  term_flag_low  (char*2) level coupling type (e.g. LS)
  term_low       (char*46) lower level term designation
  term_flag_upp  (char*2) level coupling type (e.g. LS)
  term_upp       (char*46) upper level term designation
  source         (char*7) reference to the oscillator strength source
  accuracy_flag  (char*1) type of the accuracy designation (class, code, number)
  accuracy       (char*10) accuracy of the oscillator strength
  comment        (char*16) additional comments (e.g. wavelength accuracy)

Usage

 vald3_ascii2bin,file_in[, file_out[, /DEBUG[, FORMAT=format]]]
  • file_in is the name of the input ASCII file,
  • file_out is an optional name of the output binary file (by default its name is constructed from file_in by replacing/appending the extension with .bin)
  • /DEBUG a switch to perform text output. In this case the output binary file is not created
  • format is either a string of FORTRAN-like formats, e.g. '(F12.4,I6,F6.3,2(F12.4,I4),2F6.3,3F7.4,1X,2(A2,1X,A46,1X),A7,1X,A1,1X,A10,1X,A16)'. If format is not specified, free format is assumed. In this case character variables must be enclosed in single quotes. For free and for FORTRAN-type format the sequence of values must follow the VALD3 standard as given above. Alternatively format could a be a file containing more flexible formatting options.

Format file syntax

In the format file each line describes a single variable and how it can be obtained from the ASCII file. The parameters are location/operation pairs. Location consists of starting column, the field length and the variable type enclosed in square brakets. Allowed variable types are i(nteger), f(loat), d(ouble) or s(tring). Operation is any operation allowed for a given variable type. Formal syntax for each line: <variable>: (<location>)[<operation>[(<location>)... [; <comment>] In addition one can use if statements:

 if({<location>,<type>} <logical_operation> {<location>,type}) then
   <variable definitions>
 else if(...) then
   <variable definitions>
 else
   <variable definitions>
 endif

Example

 ; just a comment line
 wl: {0, 14,d}
 if({32,8,f} gt {42,8,f} and {32,8,f} lt 100.) then
   e_low: {32,8,d}*8065.46d0 ; converting eV to cm^-1
   e_upp: {42,8,d}*8065.46d0 ; converting eV to cm^-1
   term_upp: {140,15,s}+{157,3,s}; concatenation of strings
   term_low: {120,15,s}+{137,3,s}; concatenation of strings
 else
   e_low: {42,8,f}*8065.46d0 ; converting eV to cm^-1
   e_upp: {32,8,f}*8065.46d0 ; converting eV to cm^-1
   term_low: {140,15,s}+{157,3,s}; concatenation of strings
   term_upp: {120,15,s}+{137,3,s}; concatenation of strings
 endif

ValdWiki: VALDconversion_idl (last edited 2009-11-30 12:52:22 by NikolaiPiskunov)