On 27/10/11 11:00 PM, hasanimam wrote: > To Josh and Marcus, > > Well I tried all aspects. > Here is what I did, > > a = numpy.fromfile("observed_data", dtype=numpy.complex64, count=-1, sep='') > file = open ("outputfile", "w") > for n in range(0,len(a)): > outstr = ("%f" % a[n]) + "\n" > file.write (outstr) > > file.close() > > The output file does not contain anything. I have really no idea why these > things are happening. > I thought that using numpy.formfile, I will be able to read the converted > binary file..however..its not happening. > > Am a little bit sad.. > Is your input file non-zero length?
and since you're using complex64, assuming you've read your file into 'a': f = open("outputfile", "w") for n in range(0,len(a)): x = str(a[n].real) + " " + str(a[n].imag)+ "\n" f.write (x) f.close() Will produce a readable-text file for output. -- Principal Investigator Shirleys Bay Radio Astronomy Consortium http://www.sbrac.org _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio