-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
outlines for functions to reverse unpack_to_array and unpack_to_dict()
def pack_from_dict(flag_dict, product, num_bits):
"""
Where keys are flag names, values are arrays all the same shape.
product is a custom product spec. num_bits should be 8,16, or 32
"""
qa_array = np.empty(shaped like input, dtyp = product[numbits])
for flag in products:
if 1 bit:
qa_array[flag_bit] = qa_dict[flag]
if > 1 bit:
# ie. take an array of possible values 0,1,2,3 and convert to two bits.
temp_qa_array = unpackbits(qa_dict(flag))
for ii in bits:
qa_array[flag_bit] = temp_qa_array[flag_bit] # or something like that
Reactions are currently unavailable