Skip to content

Commit

Permalink
Formatting cleanup, new APID defaults, no printout mess (-na to disable)
Browse files Browse the repository at this point in the history
  • Loading branch information
artlav committed Aug 25, 2019
1 parent 9bc43a6 commit 4add008
Show file tree
Hide file tree
Showing 15 changed files with 226 additions and 187 deletions.
46 changes: 29 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,37 @@ Binaries for Windows, Linux, Raspberry Pi and MacOS X are available at [Orbides]

medet input_file output_name [OPTIONS]

Expects 8 bit signed soft QPSK, 1 bit hard QPSK or decoded dump input
Expects 8 bit signed soft samples, 1 bit hard samples or decoded dump input
Image would be written to output_name.bmp

Input:
-soft Use 8 bit soft samples (default)
-h -hard Use hard samples
-d -dump Use decoded dump

Process:
-int Deinterleave (for 80k signal, i.e. Meteor M2-2, default - 72k)
-diff Diff coding (for Meteor M2-2)

Output:
-ch Make hard samples (as decoded)
-cd Make decoded dump
-cn Make image (default)
-r x APID for red (default: ',red_apid,')
-g x APID for green (default: ',green_apid,')
-b x APID for blue (default: ',blue_apid,')
-s Split image by channels
-S Both split image by channels, and output composite
-t Write stat file with time information

Print:
-q Don''t print verbose info
-Q Don''t print anything
-p Print loads of debug info
-na Don''t compress the debug output to a single line

Options:
-h Use hard samples (default - 8 bit soft)
-d Use decoded dump (default - 8 bit soft)
-ch Make hard samples (as decoded)
-cd Make decoded dump
-q Don't print verbose info
-Q Don't print anything
-p Print loads of debug info
-r x APID for red (default: 68)
-g x APID for green (default: 65)
-b x APID for blue (default: 64)
-s Split image by channels
-S Both split image by channels, and output composite
-t Write stat file with time information

As of August 2019, N2 and N2-2 got APIDs 64 (0.5-0.7), 65 (0.7-1.1) and 66 (10.5-11.5)
As of March 2017, N2 got APIDs 64 (0.5-0.7), 65 (0.7-1.1) and 68 (10.5-11.5)
Defaults produce 125 image compatible with many tools
Nice false color image is produced with -r 65 -g 65 -b 64
Decoded dump is 9 times smaller than the raw signal, and can be re-decoded 20x as fast, so it's a good format to store images and play with channels
Decoded dump is 9 times smaller than the raw signal, and can be re-decoded 20x as fast, so it''s a good format to store images and play with channels
42 changes: 21 additions & 21 deletions alib/asys.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ interface
//############################################################################//
//ASYS
type
int32=integer;
dword=cardinal;
int32=integer;
dword=cardinal;
{$ifndef fpc}qword=int64;{$endif}

{$ifndef CPUX86_64}
intptr=dword;
{$else}
intptr=PtrUInt;
{$endif}

pdword=^dword;

bytea=array[0..maxint-1]of byte;
pbytea=^bytea;
pbytea=^bytea;
inta=array[0..maxint div 4-1]of integer;
pinta=^inta;
shortinta=array[0..maxint div 4-1]of shortint;
pshortinta=^shortinta;
singlea=array[0..maxint div 4-1]of single;
psinglea=^singlea;
//############################################################################//
{$ifdef fake_vfs}
{$ifdef fake_vfs}
const
VFERR_OK=0;
VFO_READ=1;
Expand All @@ -42,46 +42,46 @@ interface
function vfopen(out f:file;n:string;m:integer):dword;
procedure vfclose(var f:file);
procedure vfwrite(var f:file;p:pointer;s:int32);
{$endif}
{$endif}
//############################################################################//
//GRPH
type
crgba=array[0..3]of byte;
pcrgba=^crgba;
pcrgba=^crgba;
bcrgba=array[0..1000000]of crgba;
pbcrgba=^bcrgba;

pallette=array[0..255]of crgba;
ppallette=^pallette;
//############################################################################//
const
gclaz:crgba=(0,0,0,0);
const
gclaz:crgba=(0,0,0,0);

CLBLUE=0;
CLGREEN=1;
CLRED=2;
gclwhite:crgba=(255,255,255,255);
gclwhite:crgba=(255,255,255,255);
gclblack:crgba=(0,0,0,255);
gclred:crgba=(0,0,255,255);
gclgreen:crgba=(0,255,0,255);
gclgreen:crgba=(0,255,0,255);
gcllightgreen:crgba=(128,255,128,255);
gcldarkgreen:crgba=(0,128,0,255);
gclblue:crgba=(255,0,0,255);
gcllightblue:crgba=(255,128,128,255);
gclgray:crgba=(128,128,128,255);
gcllightgray:crgba=(200,200,200,255);
gcldarkgray:crgba=(64,64,64,255);
gclyellow:crgba=(0,255,255,255);
gclgray:crgba=(128,128,128,255);
gcllightgray:crgba=(200,200,200,255);
gcldarkgray:crgba=(64,64,64,255);
gclyellow:crgba=(0,255,255,255);
gcldarkyellow:crgba=(0,128,128,255);
gclorange:crgba=(0,128,255,255);
gclbrown:crgba=(0,75,150,255);
gclbrown:crgba=(0,75,150,255);
gclcyan:crgba=(255,255,0,255);
gclmagenta:crgba=(255,0,255,255);
//############################################################################//
//STRVAL
function stri(par:int64):string;
function strhex(bit:dword):string;
function vali(par:string):int64;
function vali(par:string):int64;
function trimsl(s:string;n:integer;c:char):string;
//############################################################################//
implementation
Expand All @@ -94,13 +94,13 @@ function vfopen(out f:file;n:string;m:integer):dword;
if m=1 then if not fileexists(n) then begin result:=9999; exit; end;
assignfile(f,n);
filemode:=0;
if m=1 then reset(f,1);
if m=2 then rewrite(f,1);
if m=1 then reset(f,1);
if m=2 then rewrite(f,1);
result:=VFERR_OK;
end;
procedure vfclose(var f:file);begin closefile(f);end;
procedure vfwrite(var f:file;p:pointer;s:integer);begin blockwrite(f,p^,s);end;
{$endif}
{$endif}
//############################################################################//
//STRVAL
function stri(par:int64):string;begin str(par,result);end;
Expand Down
6 changes: 3 additions & 3 deletions alib/bitop.pas
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bit_io_rec=record
cur:byte;
cur_len:integer;
end;
//############################################################################//
//############################################################################//
function count_bits(n:dword):integer;

function bio_peek_n_bits (var b:bit_io_rec;const n:integer):dword;
Expand All @@ -25,7 +25,7 @@ function bio_fetch_n_bits (var b:bit_io_rec;const n:integer):dword;
procedure bit_writer_create(var w:bit_io_rec;bytes:pbytea;len:integer);
procedure bio_write_bitlist_reversed(var w:bit_io_rec;l:pbytea;len:integer);
//############################################################################//
implementation
implementation
//############################################################################//
const bitcnt:array[0..255]of integer=(
0, 1, 1, 2, 1, 2, 2, 3,
Expand Down Expand Up @@ -157,6 +157,6 @@ procedure bio_write_bitlist_reversed(var w:bit_io_rec;l:pbytea;len:integer);
end;
//############################################################################//
begin
end.
end.
//############################################################################//

52 changes: 26 additions & 26 deletions alib/bmp.pas
Original file line number Diff line number Diff line change
Expand Up @@ -27,67 +27,67 @@ interface
end;
//############################################################################//
procedure make_bmp_headers(xr,yr,bpp:integer;out fh:bmp_filehdr;out ih:bmp_infohdr);
function storebmp32(fn:string;p:pointer;xr,yr:integer;rev,bgr:boolean):boolean;
function storebmp32(fn:string;p:pointer;xr,yr:integer;rev,bgr:boolean):boolean;
function storebmp8 (fn:string;p:pointer;xr,yr:integer;rev,bgr:boolean;pal:pallette):boolean;
//############################################################################//
implementation
implementation
//############################################################################//
procedure make_bmp_headers(xr,yr,bpp:integer;out fh:bmp_filehdr;out ih:bmp_infohdr);
var pcnt:integer;
begin
fh.typ:=19778;
begin
fh.typ:=19778;
fh.reserved1:=0;
fh.reserved2:=0;
fh.off_bits:=54;
fh.off_bits:=54;

ih.wid:=xr;
ih.hei:=yr;
ih.size:=sizeof(ih);
ih.planes:=1;
ih.hei:=yr;
ih.size:=sizeof(ih);
ih.planes:=1;
ih.compression:=0;

//LRPT_places is confused by this field
ih.xpels_per_meter:=0; //round((default_bmp_dpi*2.54*xr)/100); //DPI
ih.ypels_per_meter:=ih.xpels_per_meter;
ih.clr_used:=0;
ih.clr_important:=0;
case bpp of
ih.clr_used:=0;
ih.clr_important:=0;

case bpp of
32:begin
fh.size:=xr*yr*4;
fh.size:=xr*yr*4;
ih.bit_count:=32;
ih.img_size:=xr*yr*4;
end;
24:begin
fh.size:=xr*yr*3;
fh.size:=xr*yr*3;
ih.bit_count:=24;
ih.img_size:=xr*yr*3;
end;
8:begin
8:begin
pcnt:=0;
if (xr mod 4)<>0 then pcnt:=4-(xr mod 4);
fh.size:=(xr+pcnt)*yr;
fh.size:=(xr+pcnt)*yr;
fh.off_bits:=54+1024;
ih.bit_count:=8;
ih.img_size:=0;
end;
end;
end;
//############################################################################//
//############################################################################//
//############################################################################//
function storebmp_rgb(bpp:integer;fn:string;p:pointer;xr,yr:integer;rev,bgr:boolean):boolean;
var f:vfile;
var f:vfile;
fh:bmp_filehdr;
ih:bmp_infohdr;
i,j:integer;
pp:pointer;
c1,c2:pcrgba;
begin
begin
result:=false;
if vfopen(f,fn,2)<>VFERR_OK then exit;

make_bmp_headers(xr,yr,bpp*8,fh,ih);

vfwrite(f,@fh,sizeof(Fh));
vfwrite(f,@ih,sizeof(Ih));
if bgr then begin
Expand Down Expand Up @@ -154,10 +154,10 @@ function storebmp8(fn:string;p:pointer;xr,yr:integer;rev,bgr:boolean;pal:pallett
end;
//############################################################################//
function storebmp32(fn:string;p:pointer;xr,yr:integer;rev,bgr:boolean):boolean;
begin
begin
result:=storebmp_rgb(4,fn,p,xr,yr,rev,bgr);
end;
end;
//############################################################################//
begin
end.
begin
end.
//############################################################################//
Loading

0 comments on commit 4add008

Please sign in to comment.