Beispiel #1
0
func processIQDataForSatellite(
	satellite_id string,
	local_path string,
	iq_params pb.IQParams,
	timestamp int64) (result []*pb.Contact_Blob) {

	log.Printf("Processing new IQ data %s for %s", local_path, satellite_id)

	blobs, err := demod.DecodeFromIQ(
		satellite_id, local_path,
		(float64)(*iq_params.SampleRate), *iq_params.Type)
	if err != nil {
		log.Printf("Error while processing IQ data: %s", err.Error())
		// Don't exit since some blobs may have been generated anyway.
	}
	log.Printf("Decoded %d blobs.", len(blobs))
	for _, b := range blobs {
		var cb pb.Contact_Blob = b
		result = append(result, &cb)
	}

	decoded_blobs, err := contacts.DecodeBlobs(
		satellite_id, timestamp, blobs)
	if err != nil {
		log.Printf("Error decoding blobs: %s", err.Error())
	}
	log.Printf("Decoded %d telemetry blobs.", len(decoded_blobs))
	result = append(result, decoded_blobs...)

	return result
}
Beispiel #2
0
func main() {
	flag.Parse()
	t := (pb.IQParams_Type)(pb.IQParams_Type_value[*format])
	blobs, err := demod.DecodeFromIQ(
		*satellite_id, *input_file, *sample_rate, t)
	if err != nil {
		fmt.Printf("Error: %s\n", err.Error())
		return
	}

	for _, b := range blobs {
		fmt.Printf("%s\n", b)
	}
}