Commit 8fbb8da7 authored by Duncan Macleod's avatar Duncan Macleod
Browse files

Merge branch 'lalframe-exotic-types' into 'master'

Add nbits handling for exotic types in lalframe

Closes #415

See merge request lscsoft/lalsuite!1534
parents 0946e90b 4ce9b9e2
......@@ -896,21 +896,28 @@ static FrAdcData *XLALFrameUFrAdcDataNew(const char *name, int type)
XLAL_ERROR_NULL(XLAL_ENOMEM);
}
switch (type) {
case FR_VECT_4S:
adcData->nBits = 32;
case FR_VECT_C:
case FR_VECT_1U:
adcData->nBits = 8;
break;
case FR_VECT_2S:
case FR_VECT_2U:
adcData->nBits = 16;
break;
case FR_VECT_C:
adcData->nBits = 8;
break;
case FR_VECT_4R:
case FR_VECT_4S:
case FR_VECT_4U:
adcData->nBits = 32;
break;
case FR_VECT_8C:
case FR_VECT_8R:
case FR_VECT_8S:
case FR_VECT_8U:
adcData->nBits = 64;
break;
case FR_VECT_16C:
adcData->nBits = 128;
break;
default: /* invalid type */
FrAdcDataFree(adcData);
XLAL_ERROR_NULL(XLAL_ETYPE);
......@@ -1125,21 +1132,28 @@ int XLALFrameUFrChanVectorAlloc_FrameL_(LALFrameUFrChan * channel, int dtype, si
case XLAL_FRAMEU_FR_CHAN_TYPE_ADC:
/* determine bits */
switch (dtype) {
case FR_VECT_4S:
channel->handle.adc->nBits = 32;
case FR_VECT_C:
case FR_VECT_1U:
channel->handle.adc->nBits = 8;
break;
case FR_VECT_2S:
case FR_VECT_2U:
channel->handle.adc->nBits = 16;
break;
case FR_VECT_C:
channel->handle.adc->nBits = 8;
break;
case FR_VECT_4R:
case FR_VECT_4S:
case FR_VECT_4U:
channel->handle.adc->nBits = 32;
break;
case FR_VECT_8C:
case FR_VECT_8R:
case FR_VECT_8S:
case FR_VECT_8U:
channel->handle.adc->nBits = 64;
break;
case FR_VECT_16C:
channel->handle.adc->nBits = 128;
break;
default: /* invalid vector type for adc data */
XLAL_ERROR(XLAL_ETYPE);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment