Products 33 & 34: Pitch angle distributions
DESC: Pitch angles snapshots data: 16 energies P33, 31 energies P34 . The functions are parameterized for #Energies so that both products can be generated from a single, smaller piece of software.
HIST: 11-12-93 JLC 1st cut (from p-2d.asm) 01-18-93 JLC Added products P33 and P34 (had to add hook [01-18-94?] for function which determines whether to process ctr data). 95-01-30 CAI Fix bug which stopped prod after 1 spin. v1.53 95-02-08 CAI Fix shift count for slr instruction. v1.61 95-02-13 CAI Fix PRKILL error in INIT_PITCH. v1.62 95-02-13 CAI Borrowed init code from P-2D. v1.62 Need to add FGM sync. 95-07-25 CAI Start to add magnetic field sync. v1.82 95-09-13 CAI Change UPD_PITCH to sum over sweeps, not over anodes; use 11.25 deg ctr data for both P33 & P34; fix EMPTY_Q init; change sum buf queue size from 2 to 4. v1.88 95-11-13 CAI Update memory use comments. 95-11-28 CAI Add magnetic field sync; use one packet per sweep (2 per spin); add FGM vector and sweep number to packet; revise mem vars; move constants to .GROUP TABLE. v1.92 95-12-21 CAI Delete unused mem vars. v1.92 96-01-09 CAI Convert to new fgm_stat format in IEL.ASM. v1.93 96-01-13 CAI Implement 16-level prioritized tlm queues. v1.94 96-01-18 CAI Put range bits in MS-nibble of Bx in product; fix FGM correction matrix shift error for By and Bz; add FGM -6.5 degree mounting offset; subtract rather than add phase offset. v1.96 96-01-19 CAI Double precision of tangent lookup table from 8 to 16 entries. v1.96 96-03-21 CAI Add tlm pkt timeout error post. v2.05
07-06-96 AMD Ported the code to ESIC. Renamed P23 with P33 and P24 with P34. Changed the collecting event from evt_ctr11 to evt_ctr22. Redefined instument mounting constants 02-09-97 AMD Fix skipping of 32nd e-step counts -according to CAI CIS v2.16 961206
NOTE: PRODUCT GENERATION
Mass counters are processed during the two sweeps per spin (180 degrees apart) when the instrument is pointed in the direction of the magnetic field. A synchronizing function determines when this occurs by consulting the most recent FGM data collected from the Inter-Experiment Link (IEL).
The counters are summed during the first such sweep of the spin. The FGM vector and sweep number are added to the product buffer. Then the buffer of data is sent to the product telemetry sub-task which compresses the 16-bit sums to 8 bits, and puts the packet in the telemetry packet queue. This is repeated 180 degrees later during the second mag- field-aligned sweep of the spin.
The sub-tasks are similar, so generic sub-task routines are used by both products' tasks.
Sum 1-buf 2-buf Product # # Mass Buffer Pkt # Mem Mem Number Anode Energy Numbers Size Size Pkts Use Use ------- ----- ------ ------- ------ ---- ---- ---- ---- P33 8 16 1-4 512 262 1 616 1136 P34 8 31 1-4 992 502 1 1096 2096
Sizes are in words. Pkt size is sum buffer size compressed to 8-bits, plus 4 words, divided into valid pkt sizes + 2-word pkt hdr.
The tasks will double-buffer the data if enough memory is available. Otherwise, only one buffer will be allocated. If there isn't enough memory for at least one buffer, then an error is posted and the product task is deleted.
SUMMATION BUFFER
The size of each product summation buffer is provided in a table above and is determined by the number of polar angles (anodes), energies, and masses in the product.
Product P33 Sum Buffer: Product P34 Sum Buffer: 4 M, 8 PA, 16 E 4 M, 8 PA, 31 E
Offset Offset dec hex M PA E dec hex M PA E --- --- --- --- --- --- --- --- --- --- 0 0 1 0 0 0 0 1 0 0 1 1 1 0 1 1 1 1 0 1 2 2 1 0 2 2 2 1 0 2 ... ... ... ... ... ... ... ... ... ... 15 F 1 0 15 30 1E 1 0 30 16 10 1 1 0 31 1F 1 1 0 17 11 1 1 1 32 20 1 1 1 ... ... ... ... ... ... ... ... ... ... 127 7F 1 7 15 247 F7 1 7 30 128 80 2 0 0 248 F8 2 0 0 129 81 2 0 1 249 F9 2 0 1 130 82 2 0 2 250 FA 2 0 2 ... ... ... ... ... ... ... ... ... ... 255 FF 2 7 15 495 1EF 2 7 30 256 100 3 0 0 496 1F0 3 0 0 ... ... ... ... ... ... ... ... ... ... 383 17F 3 7 15 743 2E7 3 7 30 384 180 4 0 0 744 2E8 4 0 0 ... ... ... ... ... ... ... ... ... ... 511 1FF 4 7 15 991 3DF 4 7 30
PACKET BUFFERS
The summation buffer is log compressed from 16-bits down to 8-bits. This results in a product size of half the summation buffer size (see list above). The telemetry packet buffer data are in the same order as in the summation buffer. MEMORY USE
The summation buffer memory is reused for the telemetry packet buffer. In addition eight words are allocated just before the summation buffer for a 2-word telemetry packet handling structure, a 2-word product header, a 3-word FGM vector, and a 1-word sweep number. Memory use is:
Length (words) Description ------ --------------- 2 packet handling structure 2 packet header 4 FGM Range/Bx, By, Bz; sweep number n summation buffer ------ n+8 total per product buffer 42 product variables 27 sub-task tss ------ n+77 allocation for 1st buffer 27 task tss (at prod task creation) ------ n+104 Total allocation for 1-buffer product n+8 allocation for 2nd buffer ------ 2n+112 Total allocation for 2-buffer product
DATA COLLECTION
Products P33 and P34 read the 22.5 degree anode counters by pending on the evt_ctr22 event word.
Pitch angle computation is made assuming 11.25 deg resolution and then scaling the result by 2 to be compliant with the standard 22.5 deg resolution. The HS section is looking at the dirction of the -Z axis of the spacecraft reference frame (-90 deg) such position is coded in a on-board constant equal to: 4*(-90 deg)/11.25 deg = -32 (11.25 deg/swp assumption) The FGM reference frame is like the spacecraft reference frame but rotated by -45 deg. Therefore the coded FGM constant offset is: 4*(-45 deg)/11.25 deg = -16 (11.25 deg/swp assumption) FGM calibration coefficients are assumed to be updated periodically during flight by commands; they applied as follows
Bxc (corrected) = Bxx*(Bx-Bco) + Bxy*(By-Bco) + Bxz*(Bz-Bco) + Kx Byc (corrected) = Byx*(Bx-Bco) + Byy*(By-Bco) + Byz*(Bz-Bco) + Ky Bzc (corrected) = Bzx*(Bx-Bco) + Bzy*(By-Bco) + Bzz*(Bz-Bco) + Kz