|
principles projects CNMI-Guam old projects |
KnowHow /
Prepending WERA header to D-Tacq files--------Message -------- Subject: quick fixes for removing extra byte Date: Sun, 1 Dec 2019 23:00:31 -1000 From: Pierre Flament <pflament@hawaii.edu> To: radlab 1. through shell script: sunrise:/home/sunset0/data/kna/realtime> cat cleanraw #!/bin/csh -f dd if=$1 bs=512 count=1 >! $2 dd if=$1 bs=512 skip=513 iflag=skip_bytes >> $2 sunrise:/home/sunset0/data/kna/realtime> cleanraw 20130932330_kna.RAW.old 20130932330_kna.RAW sunrise:/home/sunset0/data/kna/realtime> ls -l 20130932330_kna*RAW* -rw-rw-r-- 1 wera users 251658752 Dec 1 22:44 20130932330_kna.RAW -rw-rw-r-- 1 wera users 251658753 Apr 3 2013 20130932330_kna.RAW.old 2. through matlab m-file sunrise:/home/sunset0/data/kna/realtime> cat cleanraw.m % cleanraw: remove extra header byte % define filein and filout before calling IQ=2; % number of channels to make pair NANT=16; % the WERA number of antennas MT=1920; % the number of WERA samples/chirp NCHIRP=2048; % the number of chirps % read binary wera data in .RAW format of short int16 f=fopen(filein,'r','ieee-le') header=uint8(zeros(512,1)); skip=uint8(zeros(1,1)); raw=int16(zeros(IQ*MT*NANT*NCHIRP,1)); header=fread(f,512,'uint8=>uint8'); skip=fread(f,1,'uint8=>uint8'); raw=fread(f,IQ*MT*NANT*NCHIRP,'int16=>int16'); fclose(f); % output the wera .RAW file f=fopen(fileout,'w','ieee-le'); fwrite(f,header,'uint8'); fwrite(f,raw,'int16'); fclose(f); -------- Forwarded Message -------- Subject: warning: invalid Kaena "kna" radial data 2013 to 11/30/2019 Date: Sun, 1 Dec 2019 17:59:57 -1000 From: Pierre Flament <pflament@hawaii.edu> To: hfrnet administrators <hfrnet.administrators@sio.ucsd.edu> 1. Synopsis 2. Actions 3. Q&A __ 1. Synopsis:
What was done: char*19 char*478 int16 int16 int16
"time" "header" ("\n" sample1.byte1) (sample1.byte2 sample2.byte1) (sample2.byte2 sample3.byte1) ...
What should have been done: char*19 char*478 int16 int16 int16 "time" "header" (sample1.byte1 sample1.byte2) (sample2.byte1 sample2.byte2) (sample3.byte1 sample3.byte2) ... If the good data was: int16 int16 int16 (sabcdefg hijklnop) (sabcdefg hijklnop) (sabcdefg hijklnop) .... It was erroneously written as: int16 int16 int16
("\n" sabcdefg) (hijklnop sabcdefg) (hijklnop sabcdefg) ....
(where letters denote 0's or 1's with a the most significant and where s is the sign bit) 2. Actions:
3. Q&A:
|