This shows you the differences between two versions of the page.
information_for_astronomers:user_guide:tips_ffts_rawdata [2013/08/01 22:07] 127.0.0.1 external edit |
information_for_astronomers:user_guide:tips_ffts_rawdata [2013/08/13 09:53] (current) bwinkel |
||
---|---|---|---|
Line 32: | Line 32: | ||
| | ||
""" | """ | ||
- | totalsize=os.path.getsize(fname) | + | totalsize=os.path.getsize(filename) |
if metainfo is None: | if metainfo is None: | ||
# getting endian | # getting endian | ||
- | ieee=np.fromfile(fname , dtype = np.dtype([('IEEE','|S4')]) , count = 1 ) | + | ieee=np.fromfile(filename , dtype = np.dtype([('IEEE','|S4')]) , count = 1 ) |
endian='>' if ieee=="IEEE" else '<' | endian='>' if ieee=="IEEE" else '<' | ||
- | metainfo=np.fromfile(fname , dtype = np.dtype([ ('IEEE','|S4'), ('DATFMT','|S4'), | + | metainfo=np.fromfile(filename , dtype = np.dtype([ ('IEEE','|S4'), ('DATFMT','|S4'), |
('DATALENGTH','%si4'%endian), ('BE_IDENT','|S8'), ('TIMESTAMP','|S28'), | ('DATALENGTH','%si4'%endian), ('BE_IDENT','|S8'), ('TIMESTAMP','|S28'), | ||
('INTTIME','%si4'%endian), ('PHASENUM','%si4'%endian), ('BENUMSEC','%si4'%endian), | ('INTTIME','%si4'%endian), ('PHASENUM','%si4'%endian), ('BENUMSEC','%si4'%endian), | ||
Line 58: | Line 58: | ||
record_length=record.itemsize | record_length=record.itemsize | ||
num_records=totalsize/record_length | num_records=totalsize/record_length | ||
- | alldata=np.fromfile(fname , dtype =record, count = num_records ) | + | alldata=np.fromfile(filename , dtype =record, count = num_records ) |
return alldata,metainfo | return alldata,metainfo | ||
# | # |