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]]]

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)