next up previous contents
Next: Implementation details Up: class-associated-arrays Previous: Nomenclature reminder   Contents

Specifications

The concept of ASSOCIATED ARRAYS is introduced in CLASS. They are specified as follows:

  1. The ASSOCIATED ARRAYS section is added to store 1 or more arrays of data directly related to RY.

  2. The ASSOCIATED ARRAYS must be of size Nchan (1st dimension). A second dimension can be used. Their X axis associated to the 1st dimension is exactly described by RX. In other words, there is a one-to-one channel relationship between the flux array RY and any of the ASSOCIATED ARRAYS. This also means that any modification on the spectroscopic section has a similar and consistent impact on RY and on the ASSOCIATED ARRAYS. This includes resizing the axis (EXTRACT) and shift/stretch of the axis (MODIFY VELO|FREQ).

  3. The type and kind of data stored as an ASSOCIATED ARRAY is flexible, in the limit of what the Gildas internal engines are used to (i.e. numeric data types). Expected types are integer or real (floating point) types. See details in Table [*].

  4. An ASSOCIATED ARRAY is identified by its name (12 characters maximum). It must be unique in one observation. The name may contain only characters valid for Sic variable names (typically the alphanumeric character set), so that the arrays can also be used as Sic variables. The ASSOCIATED ARRAY may also provide a unit string (12 characters maximum), left blank if not used. And it must provide a bad (blanking) value, valid in the supported range of values corresponding to the data format.

  5. There is no predefined/limited list of supported ASSOCIATED ARRAYS. Some may be built and saved by the CLASS internal engines with a precise definition (so-called RESERVED ASSOCIATED ARRAYS, see section [*]), others may be created and saved by the user on his own choice. Examples could be: One typical counter example which does not satisfy the rule in item #2 is:

  6. Resampling and its other flavors (RESAMPLE, AVERAGE, ...) is a particular problem since CLASS has to know how the values can be mixed (e.g. what is the meaning of resampling a flag array?). There is no straightforward answer. Basic ideas are: As of today, CLASS uses the first proposition as a generic solution.




Table: Type and kind of data supported for ASSOCIATED ARRAYS. Note that 4-bits and 2-bits integers are provided for storage on disk with low space comsuption. In particular, 2-bits integers provide 4 possible values: they are well suited for storing a boolean (0 and 1) and a bad value (e.g. -1). Note also that in practice, integers smaller than 32 bits are always loaded as INTEGER*4 in memory, so that Sic variables can be mapped on them and the GILDAS tools can be used.
Internal code Equivalent Fortran Nbits Range of values Type and kind
  type and kind (disk)   in memory
fmt_r8 REAL*8 64   REAL*8
fmt_r4 REAL*4 32   REAL*4
fmt_i8 INTEGER*8 64 $-2^{63}$ to $+2^{63}-1$ INTEGER*8
fmt_i4 INTEGER*4 32 $-2^{31}$ to $+2^{31}-1$ INTEGER*4
fmt_i2 INTEGER*2 16 $-2^{15}$ to $+2^{15}-1$ INTEGER*4
fmt_by INTEGER*1 8 $-2^{7}$ to $+2^{7}-1$ INTEGER*4
fmt_b4 N/A 4 $-2^{3}$ to $+2^{3}-1$ INTEGER*4
fmt_b2 N/A 2 $-2^{1}$ to $+2^{1}-1$ INTEGER*4


next up previous contents
Next: Implementation details Up: class-associated-arrays Previous: Nomenclature reminder   Contents
Gildas manager 2023-06-01