imap_processing.swapi.l1.swapi_l1.process_sweep_data#
- imap_processing.swapi.l1.swapi_l1.process_sweep_data(full_sweep_sci: Dataset, cem_prefix: str) Dataset#
Group full sweep data into correct sequence order.
Data from each packet comes like this:
SEQ_NUMBER.PCEM_RNG_ST0SCEM_RNG_ST0COIN_RNG_ST0PCEM_RNG_ST1SCEM_RNG_ST1COIN_RNG_ST1PCEM_RNG_ST2SCEM_RNG_ST2COIN_RNG_ST2PCEM_RNG_ST3SCEM_RNG_ST3COIN_RNG_ST3PCEM_RNG_ST4SCEM_RNG_ST4COIN_RNG_ST4PCEM_RNG_ST5SCEM_RNG_ST5COIN_RNG_ST5PCEM_CNT0SCEM_CNT0COIN_CNT0PCEM_CNT1SCEM_CNT1COIN_CNT1PCEM_CNT2SCEM_CNT2COIN_CNT2PCEM_CNT3SCEM_CNT3COIN_CNT3PCEM_CNT4SCEM_CNT4COIN_CNT4PCEM_CNT5SCEM_CNT5COIN_CNT5When we read all packets and store data for above fields, it looks like this:
SEQ_NUMBER -> [0, 1, 2, 3, 4,…, 11, 1, 2, ……, 9, 10, 11]PCEM_RNG_ST0 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]SCEM_RNG_ST0 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]COIN_RNG_ST0 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]PCEM_RNG_ST1 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]SCEM_RNG_ST1 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]COIN_RNG_ST1 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]….PCEM_RNG_ST5 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]SCEM_RNG_ST5 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]PCEM_CNT_0 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]SCEM_CNT_0 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]COIN_CNT_0 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]….PCEM_CNT_5 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]SCEM_CNT_5 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]COIN_CNT_5 -> [x, x, x, x, x,…, x, x, x, …, x, x, x]This function reads each sweep data in this order:
PCEM_CNT0 –> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11PCEM_CNT1 –> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11PCEM_CNT2 –> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11PCEM_CNT3 –> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11PCEM_CNT4 –> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11PCEM_CNT5 –> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11This example show for PCEM_CNT but same logic applies to SCEM_CNT, COIN_CNT, PCEM_RNG, SCEM_RNG, and COIN_RNG.
In the final L1A product of (total_number_of_sweep x 72) array where we store final PCEM, SCEM, COIN counts or compression indicator such as PCEM_RNG, SCEM_RNG, COIN_RNG, we want data in this order. Transpose of above layout
0, 0, 0, 0, 0, 0,1, 1, 1, 1, 1, 1,2, 2, 2, 2, 2, 2,3, 3, 3, 3, 3, 3,….,11, 11, 11, 11, 11, 11.Reordering in this order is reordering all data of sequence 0 first, then sequence 1, then sequence 2, and so on until sequence 11.
- Parameters:
full_sweep_sci (xarray.Dataset) – Full dataset.
cem_prefix (str) –
Indicate which CEM or its flag we are processing. Options are:
PCEM_CNTSCEM_CNTCOIN_CNTPCEM_RNG_STSCEM_RNG_STCOIN_RNG_ST.
- Returns:
all_cem_data – Correctly order dataset.
- Return type: