vidf v3_CPXP1H {
    float version = 3.0;                                          /* version      */
    string mission = "ClusterII";                                 /* project      */
    string spacecraft = "CLUSTER-1";                              /* mission      */
    string experiment = "Plasma Electron And Current Experiment"; /* experiment   */
    string instrument = "PEACE 3DX HEEA Data (CPXP1H)";           /* v_inst       */
    string contact = "Andrew Fazakerley";
    string contact = "Mullard Space Science Laboratory";
    string contact = "Holmbury St. Mary";
    string contact = "Dorking, Surrey, RH5 6NT, UK";
    string contact = "email: anf@mssl.ucl.ac.uk";
/*
 *                    DATA SOURCE: CLUSTER-1
 *              CLUSTERII:CLUSTER-1:PEACE:3DX1:CPXP1H
 *
 *  VIDF Generation Date : 2007-03-07  
 * 
 *  Calibration Version 5. For more information, please visit
 *  http://www.mssl.ucl.ac.uk/missions/cluster
 * 
 *  The MCP gain for this VIDF is  1.1859 *10^6 electrons
 *
 *  This virtual holds PEACE 3DX data from the HEEA detector.  Because
 *  of the enormous versatility which is built into the 3DX mode, the
 *  data returned in a 3DX data set for HEEA can be placed into any one
 *  of 12 different IDFS data files designed to hold 3DX data.  Which
 *  file is chosen to hold a particular 3DX definition depends on what
 *  summing is being done.  The three types are full resolution (CPX),
 *  all energies summed over polar sector (CPXP) and all polar sectors
 *  summed over energy (CPXE).  The three types are repeated with a
 *  1 or 2 so that two variations can be recorded simultaneously if
 *  necessary.  Each of these 6 is further separated into a sweeping
 *  and non-sweeping version.  The non-sweeping is indicated by an F
 *  at the end of the name.
 *
 *  The following is a list of tables which are in this vidf
 *    TABLE  0: Lookup table taking telemetry to cnts/acc
 *    TABLE  1: Table of center energies (eV)
 *    TABLE  2: Table of energy efficiencies
 *    TABLE  3: Table of geometry factors (cm**2-sr)
 *    TABLE  4: Table of energy resolution (dE/E)
 *    TABLE  5: Conversion factors from eV to ergs
 *    TABLE  6: Conversion factors to distribution func (s**3/km**6)
 *    TABLE  7: Conversion of dis fn from (s**3/km**6) to (s**3/cm**6)
 *    TABLE  8: Conversion of dis fn from (s**3/km**6) to (s**3/m**6)
 *    TABLE  9: Energy bin lower edge (eV)
 *    TABLE 10: Energy bin upper edge (eV)
 *    TABLE 11: Table of value 2/m (gm-1) used in E->V conversion
 *    TABLE 12: Conversion of cm to m
 *    TABLE 13: Conversion of cm to km
 *    TABLE 14: Electron charge in Coulombs
 *    TABLE 15: Ascii definitions of instrument mode
 *
 *  The following is a list of constants defined in this vidf
 *    CONST 0:  Polar elevation angles
 *    CONST 1:  Azimuthal offset angles (from 0 degree marker)
 *    CONST 2:  Detector azimuthal FWHM values
 *    CONST 3:  Beginning elevation (polar) angles
 *    CONST 4:  Ending elevation (polar) angles
 *    CONST 5:  Aperature Normal X coordinates
 *    CONST 6:  Aperature Normal Y coordinates
 *    CONST 7:  Aperature Normal Z coordinates
 *    CONST 8:  Dectector elevation FWHM values
 *
 *  The following are some of the units which can be derived from the
 *  included tables. The format is to give the tables applied followed
 *  by the operations and unit definition.  Note that for brevity we
 *  represent the table sequence 0,2,3,4 by T_S1 and the operation
 *  sequence 0,154,4,4 by O_S1.0
 *
 *  DATA  SEN  TABLES           OPERS             UNITS
 *  Scan  all  1                0                 eV
 *  Scan  all  1,5,11           0,3,63            cm/sec
 *  Scan  all  1,5,11,12        0,3,63,3          m/sec
 *  Scan  all  1,5,11,13        0,3,63,3          km/sec
 *  Scan  all  9                0                 eV (lower edge)
 *  Scan  all  10               0                 eV (upper edge)
 *  Sen   all  0                0                 cnts/accum
 *  Sen   all  0,2              0,4               cnts/accum (eff. cor)
 *  Sen   all  0,2              0,154             cnts/sec
 *  Sen   all  T_S1             O_S1              cnts/(cm**2-str-s)
 *  Sen   all  T_S1,1           O_S1,4            cnts/(cm**2-str-s-eV)
 *  Sen   all  T_S1,5           O_S1,3            ergs/(cm**2-str-s-eV)
 *  Sen   all  T_S1,6,5,1,5,1   O_S1,3,4,4,4,4    sec**3/km**6
 *  Sen   all  T_S1,6,5,1,5,1,8 O_S1,3,4,4,4,4,3  sec**3/m**6
 *  Sen   all  T_S1,6,5,1,5,1,7 O_S1,3,4,4,4,4,3  sec**3/cm**6
 *
 *  NOTE 1:  The satellite body mounted axis are defined such that X
 *  lies parallel to the satellite spin axis, +X being in the direction
 *  of the angular momentum vector.  The Y and Z axes like in a plane
 *  perpendicualr to the spin axis and are such that with positive
 *  rotation, Y rotates into Z.  HEEA is located 30 degrees
 *  antispinward of the Y axis and LEEA is located 150 degrees spinward
 *  of the Y axis.  The sun sensor is located 26.2 degrees spinward
 *  of the Y axis.
 *
 *  NOTE 2: The PEACE sweeps are spin synchronized, using the spacecraft
 *  sun sensor pulse. The instrument starts collecting data for a new
 *  spin when the sensors receive a reset pulse from the DPU, which occurs
 *  a preselected delay time after the reception of the sun pulse sent by
 *  the spacecraft to the PEACE DPU. The delay time is controlled by the
 *  SPOS parameter (available in IDFS in CPCDM).
 *
 *  At launch the SPOS was 176, corresponding to a spacecraft rotation of
 *  3.9 degrees between the sun sensor signal and the start of a PEACE
 *  spin (i.e. DPU HV reset pulse). A SPOS of 1200 has also been used
 *  during the mission, corresponding to a rotation of 26.4 degrees. A
 *  SPOS of 1440 may also be used at some stage.
 *
 *  The start of the PEACE spin is the time at which the azimuth angle
 *  reference frame is aligned with the direction of the sun. This time
 *  is set as the zero degree position. The reference angle is measured
 *  in a right-handed sense with respect to the spin axis.
 *
 *  For a SPOS of 176 and hence a delay angle of 3.9 degrees, HEEA is offset
 *  307.7 degrees from the sun direction and LEEA is offset 127.7 degrees
 *  from the sun direction.
 *
 *  For a SPOS of 1200 and hence a delay angle of 26.4 degrees, HEEA is offset
 *  330.2 degrees from the sun direction and LEEA is offset 150.2 degrees
 *  from the sun direction.
 * 
 *  For a SPOS of 1440 and hence a delay angle of 31.6 degrees, HEEA is offset
 *  155.4 degrees from the sun direction and LEEA is offset 335.4 degrees
 *  from the sun direction.
 */
    int s_year = 2002;                                     /* ds_year      */
    int s_day = 126;                                       /* ds_day       */
    int s_msec = 0;                                        /* ds_msec      */
    int s_usec = 0;                                        /* ds_usec      */
    int e_year = 2002;                                     /* de_year      */
    int e_day = 126;                                       /* de_day       */
    int e_msec = 86399999;                                 /* de_msec      */
    int e_usec = 0;                                        /* de_usec      */
    int smp_id = 1;                                        /* smp_id       */
    int sen_mode = 2;                                      /* sen_mode     */
    int n_qual = 3;                                        /* n_qual       */
    int n_cal_sets = 0;                                    /* cal_sets     */
    int n_tbls = 16;                                       /* num_tbls     */
    int n_consts = 9;                                      /* num_consts   */
    int n_status = 4;                                      /* status       */
    int n_sensors = 6;                                     /* sen          */
    int swp_len = 93;                                      /* swp_len      */
    int max_nss = 1;                                       /* max_nss      */
    int data_len = 5780;                                   /* data_len     */
    int fill_flag = 0;                                     /* fill_flg     */
    int da_method = 0;                                     /* da_method    */
    struct Status0 {
        string name = "PEACE Mode";                       /* name      */
        int state = 4;                                    /* state     */
    };
    struct Status1 {
        string name = "Window In Energy";                 /* name      */
        int state = 2;                                    /* state     */
    };
    struct Status2 {
        string name = "Summations";                       /* name      */
        int state = 3;                                    /* state     */
    };
    struct Status3 {
        string name = "Mode-Energy Averaging Combination"; /* name      */
        int state = 8;                                    /* state     */
    };
    string qual_names = "Good";                            /* name */
    string qual_names = "Questionable";                    /* name */
    string qual_names = "Bad";                             /* name */
    struct PitchAngle {
        int format = 1;                                   /* pa_format    */
        string project = "CLUSTERII";                     /* pa_project   */
        string mission = "CLUSTER-1";                     /* pa_mission   */
        string experiment = "FGM";                        /* pa_exper     */
        string instrument = "VEC";                        /* pa_inst      */
        string vinstrument = "CFUNIT";                    /* pa_vinst     */
        int bx = 1;                                       /* bx           */
        int by = 2;                                       /* by           */
        int bz = 0;                                       /* bz           */
        int num_tbls = 1;                                 /* num_tbls     */
        int tbls = 0;                                     /* tbl 0        */
        int opers = 4;                                    /* oper 0       */
    };
    struct Sensor0 {
        string name = "HEEA: Coarse Zones 0-1";           /* name          */
        int d_type = 0;                                   /* d_type        */
        int status = 1;                                   /* status        */
        int tdw_len = 8;                                  /* tdw_len       */
        int time_offset = 0;                              /* time_offset   */
    };
    struct Sensor1 {
        string name = "HEEA: Coarse Zones 2-3";           /* name          */
        int d_type = 0;                                   /* d_type        */
        int status = 1;                                   /* status        */
        int tdw_len = 8;                                  /* tdw_len       */
        int time_offset = 0;                              /* time_offset   */
    };
    struct Sensor2 {
        string name = "HEEA: Coarse Zones 4-5";           /* name          */
        int d_type = 0;                                   /* d_type        */
        int status = 1;                                   /* status        */
        int tdw_len = 8;                                  /* tdw_len       */
        int time_offset = 0;                              /* time_offset   */
    };
    struct Sensor3 {
        string name = "HEEA: Coarse Zones 6-7";           /* name          */
        int d_type = 0;                                   /* d_type        */
        int status = 1;                                   /* status        */
        int tdw_len = 8;                                  /* tdw_len       */
        int time_offset = 0;                              /* time_offset   */
    };
    struct Sensor4 {
        string name = "HEEA: Coarse Zones 8-9";           /* name          */
        int d_type = 0;                                   /* d_type        */
        int status = 1;                                   /* status        */
        int tdw_len = 8;                                  /* tdw_len       */
        int time_offset = 0;                              /* time_offset   */
    };
    struct Sensor5 {
        string name = "HEEA: Coarse Zones 10-11";         /* name          */
        int d_type = 0;                                   /* d_type        */
        int status = 1;                                   /* status        */
        int tdw_len = 8;                                  /* tdw_len       */
        int time_offset = 0;                              /* time_offset   */
    };
    struct Table0 {
        int tbl_sca_sz = -6;                              /* tbl_sca_sz   */
        int tbl_ele_sz = 256;                             /* tbl_ele_sz   */
        int tbl_type = 0;                                 /* tbl_type     */
/*
 *                          TABLE 00
 *  Look up tables converting telemetry to counts/accum.  There is
 *  only a single table since the data is assumed to have been
 *  compressed in elevation resolution - that's how we got to 6 polar
 *  zones.
 */
        int tbl_var = 0;                                  /* tbl_var      */
        int tbl_expand = 1;                               /* tbl_expand   */
        int crit_act_sz = 0;                              /* crit_act_ele */
        int format [6] = {                          /* format       */
          0, 0, 0, 0, 0, 0                                /*  000 - 005  */
        };
        int offset [6] = {                          /* offsets      */
          0, 0, 0, 0, 0, 0                                /*  000 - 005  */
        };
        int scale [6] = {                           /* scale factor */
          0, 0, 0, 0, 0, 0                                /*  000 - 005  */
        };
        int values [256] = {                          /* values       */
          0, 16, 48, 112, 240, 496,                       /*  000 - 005  */
          1008, 2032, 4080, 8176, 16368, 32752,           /*  006 - 011  */
          65520, 131056, 262128, 524272, 1, 18,           /*  012 - 017  */
          52, 120, 256, 528, 1072, 2160,                  /*  018 - 023  */
          4336, 8688, 17392, 34800, 69616, 139248,        /*  024 - 029  */
          278512, 557040, 2, 20, 56, 128,                 /*  030 - 035  */
          272, 560, 1136, 2288, 4592, 9200,               /*  036 - 041  */
          18416, 36848, 73712, 147440, 294896, 589808,        /*  042 - 047  */
          3, 22, 60, 136, 288, 592,                       /*  048 - 053  */
          1200, 2416, 4848, 9712, 19440, 38896,           /*  054 - 059  */
          77808, 155632, 311280, 622576, 4, 24,           /*  060 - 065  */
          64, 144, 304, 624, 1264, 2544,                  /*  066 - 071  */
          5104, 10224, 20464, 40944, 81904, 163824,        /*  072 - 077  */
          327664, 655344, 5, 26, 68, 152,                 /*  078 - 083  */
          320, 656, 1328, 2672, 5360, 10736,              /*  084 - 089  */
          21488, 42992, 86000, 172016, 344048, 688112,        /*  090 - 095  */
          6, 28, 72, 160, 336, 688,                       /*  096 - 101  */
          1392, 2800, 5616, 11248, 22512, 45040,          /*  102 - 107  */
          90096, 180208, 360432, 720880, 7, 30,           /*  108 - 113  */
          76, 168, 352, 720, 1456, 2928,                  /*  114 - 119  */
          5872, 11760, 23536, 47088, 94192, 188400,        /*  120 - 125  */
          376816, 753648, 8, 32, 80, 176,                 /*  126 - 131  */
          368, 752, 1520, 3056, 6128, 12272,              /*  132 - 137  */
          24560, 49136, 98288, 196592, 393200, 786416,        /*  138 - 143  */
          9, 34, 84, 184, 384, 784,                       /*  144 - 149  */
          1584, 3184, 6384, 12784, 25584, 51184,          /*  150 - 155  */
          102384, 204784, 409584, 819184, 10, 36,         /*  156 - 161  */
          88, 192, 400, 816, 1648, 3312,                  /*  162 - 167  */
          6640, 13296, 26608, 53232, 106480, 212976,        /*  168 - 173  */
          425968, 851952, 11, 38, 92, 200,                /*  174 - 179  */
          416, 848, 1712, 3440, 6896, 13808,              /*  180 - 185  */
          27632, 55280, 110576, 221168, 442352, 884720,        /*  186 - 191  */
          12, 40, 96, 208, 432, 880,                      /*  192 - 197  */
          1776, 3568, 7152, 14320, 28656, 57328,          /*  198 - 203  */
          114672, 229360, 458736, 917488, 13, 42,         /*  204 - 209  */
          100, 216, 448, 912, 1840, 3696,                 /*  210 - 215  */
          7408, 14832, 29680, 59376, 118768, 237552,        /*  216 - 221  */
          475120, 950256, 14, 44, 104, 224,               /*  222 - 227  */
          464, 944, 1904, 3824, 7664, 15344,              /*  228 - 233  */
          30704, 61424, 122864, 245744, 491504, 983024,        /*  234 - 239  */
          15, 46, 108, 232, 480, 976,                     /*  240 - 245  */
          1968, 3952, 7920, 15856, 31728, 63472,          /*  246 - 251  */
          126960, 253936, 507888, 1015792                 /*  252 - 255  */
        };
    };
    struct Table1 {
        int tbl_sca_sz = -6;                              /* tbl_sca_sz   */
        int tbl_ele_sz = 279;                             /* tbl_ele_sz   */
        int tbl_type = 0;                                 /* tbl_type     */
/*
 *                           TABLE 01
 *  Look up table of center energies (eV). There are 3 tables because
 *  of the different PEACE modes coupled.  Mode byte values of 4-7
 *  should not occur here.  If they do they are defaulted to energy
 *  table A1
 */
        int tbl_var = 2;                                  /* tbl_var      */
        int tbl_expand = 0;                               /* tbl_expand   */
        int crit_act_sz = 8;                              /* crit_act_ele */
        struct CriticalAction {
            int status [6] = {                          /* status */
          0, 0, 0, 0, 0, 0                           /*  000 - 005  */
            };
            int offset [6] = {                          /* offset */
          0, 0, 0, 0, 0, 0                           /*  000 - 005  */
            };
            int table [8] = {                          /* table */
          0, 0, 93, 186, 0, 0,                       /*  000 - 005  */
          0, 0                                       /*  006 - 007  */
            };
        };
        int format [6] = {                          /* format       */
          0, 0, 0, 0, 0, 0                                /*  000 - 005  */
        };
        int offset [6] = {                          /* offsets      */
          0, 0, 0, 0, 0, 0                                /*  000 - 005  */
        };
        int scale [6] = {                           /* scale factor */
          -3, -3, -3, -3, -3, -3                          /*  000 - 005  */
        };
        int values [279] = {                          /* values       */
          429, 744, 769, 1114, 1511, 2139,                /*  000 - 005  */
          2913, 3263, 3707, 4381, 4744, 5383,             /*  006 - 011  */
          6152, 6609, 6882, 7791, 8192, 9203,             /*  012 - 017  */
          10074, 11586, 13025, 14907, 16571, 18697,        /*  018 - 023  */
          21096, 23742, 26273, 29522, 33402, 37357,        /*  024 - 029  */
          41469, 46491, 51974, 58241, 65299, 73130,        /*  030 - 035  */
          82638, 92524, 103184, 115329, 128890, 144141,        /*  036 - 041  */
          161297, 180566, 202082, 225740, 252786, 282334,        /*  042 - 047  */
          315548, 351640, 394226, 441569, 492651, 549271,        /*  048 - 053  */
          615047, 688294, 767769, 856157, 958515, 1071269,        /*  054 - 059  */
          1195329, 1334884, 1493450, 1670165, 1865559, 2085252,        /*  060 - 065  */
          2329417, 2605199, 2911419, 3247544, 3627850, 4057326,        /*  066 - 071  */
          4535269, 5062562, 5650543, 6315611, 7052259, 7896566,        /*  072 - 077  */
          8821788, 9852453, 11004766, 12279517, 13724568, 15341673,        /*  078 - 083  */
          17110248, 19108985, 21333292, 23834833, 23834843, 23834853,        /*  084 - 089  */
          23834863, 23834873, 23834883, 100, 997, 1157,        /*  090 - 095  */
          1345, 1603, 1935, 2183, 2487, 2968,             /*  096 - 101  */
          3514, 3973, 4454, 5042, 5664, 6228,             /*  102 - 107  */
          6520, 6910, 7764, 8749, 9905, 11446,            /*  108 - 113  */
          13280, 15082, 16863, 18974, 21474, 24134,        /*  114 - 119  */
          27018, 30471, 34218, 40360, 45143, 50634,        /*  120 - 125  */
          56685, 63513, 71090, 80271, 90233, 100959,        /*  126 - 131  */
          112913, 126145, 140975, 157553, 1758