Giter Site home page Giter Site logo

meteor_decoder's Introduction

A portable decoder for METEOR M weather satellite LRPT signal

Requires Free Pascal to compile ( http://www.freepascal.org , or in your Linux distro repositories), no dependencies.

Build

Use ./build_medet.sh, or fpc -CX -XX -O3 -Mdelphi -FUunits -Fualib medet.dpr

On Windows, edit path to FPC in build.bat, then use build.bat (or the same direct invocation line as above)

Binaries

Binaries for Windows, Linux, Raspberry Pi and MacOS X are available at Orbides

Usage

medet input_file output_name [OPTIONS]

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

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

meteor_decoder's People

Contributors

artlav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor_decoder's Issues

medet_mac an unhandled exception

Now that M2 is in channel 1 - 2 - 3 mode, I wanted to make a false color image
using -r 66 - g 65 -b 64. Using medet_mac on High Sierra, when I do that or try
to use channel 66 I get an error. This does not happen on the medet_arm version.
I just tried ./medet_mac 1.s image2 -r 66 -g 65 -b 64 and got an exception error.

Here is a link to a screen grab of the error:
https://drive.google.com/file/d/1fyO_mhO-eYKXEUV-izQBoTLlLXCxJFtv/view?usp=sharing
Here is a link to a .s file with ch 1-2-3 mode:
https://drive.google.com/file/d/1u2oe92cBAn4R08FOuDv-DQO83eqnQiIb/view?usp=sharing

Hopefully you can recreate or I am suffering from pilot error!

EDIT: This problem no longer exists.

Jeff

Red Channel Missing

I'm getting an only blue and green output image when processing a soft symbol .s file.
If I run medet [input] [output] -S, the third picture is all black. But the other two are OK. And composite picture has no red color.

I processed the same .s file with LRPT Offline Decoder and i get the a normal picture with the red, blue and green channels just fine.

I'm running in on linux Linux Mint 19.1 Cinnamon compiled medet from source.

No output

When I run the program he is decoding the file well. But at the end there is no output, my folder stay empty. Am I missing something? What is the output path file supposed to be?

The console output :

Reading ../../Documents/DecodedAndDeveloped/2019_07_22_LRPT_19-58-06.s...
pos=39993840 ( 99.96%) ( 6, 6322,49) sig= -240 rs=(-1,-1,-1,-1) C5A84106
Total: 61.484665
Processing: 0.000000
Correlation: 35.990200
Viterbi: 22.235390
ECC: 3.199975
Remainder: 0.059097
Packets: 0 / 1650

The compilation output :

Free Pascal Compiler version 3.0.4+dfsg-22 [2019/01/24] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling medet.dpr
Compiling ./alib/asys.pas
Compiling met_to_data.pas
Compiling ./alib/ecc.pas
ecc.pas(223,87) Warning: Local variable "root" does not seem to be initialized
ecc.pas(235,18) Warning: Local variable "loc" does not seem to be initialized
ecc.pas(223,35) Warning: Local variable "omega" does not seem to be initialized
Compiling correlator.pas
Compiling viterbi27.pas
Compiling ./alib/bitop.pas
Compiling ./alib/tim.pas
Compiling met_jpg.pas
Compiling ./alib/bmp.pas
Compiling huffman.pas
huffman.pas(126,15) Warning: Local variable "v" does not seem to be initialized
Compiling dct.pas
Compiling met_packet.pas
medet.dpr(285,19) Warning: Local variable "hard" of a managed type does not seem to be initialized
Linking medet
/usr/bin/ld.bfd : avertissement : link.res contient des sections de sortie; avez-vous oublié -T?
2674 lines compiled, 0.6 sec
5 warning(s) issued

Update :
So I tried some troubleshooting (which isn't easy since I don't know anything in Pascal) and apparently it seem that the variable "length(big_img)" is equal to 0 which break the saving of the image.

QPSK phase correction is wrong

I think the phase correction in the fix_packet function is not correct. I was wondering why your implementation gives much poorer quality images compared to the LRPT decoder from Robonuka. I am implementing my own Meteor M2 decoder, and I researched a lot how it works and what could be the problem. There is no write access to your repository, so here is what I've changed in your code, it gives much better images now.

var j:integer;
d:pshortinta;
b:shortint;
begin
 d:=data;
 case shift of
  4:for j:=0 to len div 2-1 do begin
   b:=d[j*2+0];
   d[j*2+0]:= -d[j*2+1];
   d[j*2+1]:= -b;
  end;
  5:for j:=0 to len div 2-1 do begin
   d[j*2+0]:=-d[j*2+0];
  end;
  6:for j:=0 to len div 2-1 do begin
   b:=d[j*2+0];
   d[j*2+0]:= d[j*2+1];
   d[j*2+1]:= b;
  end;
  7:for j:=0 to len div 2-1 do begin
   d[j*2+1]:=-d[j*2+1];
  end;
 end;
end;```

Input file format

Sorry for asking but what are the file input and output formats? I tried to use .dat as an input.

Signal quality seems to be incorrect

I've observed that signal quality doesn't belong to range [0..100] as it should be. For example when signal is very weak I see -215 and even smaller values. However for good signals all looks fine (near 100).

Signal quality is calculated in met_to_data.pas with the following statement:

m.sig_q:=round(100-(vit_get_percent_BER(m.v)*10));

Internally vit_get_percent_BER() do the following:

result:=(100*v.BER)/frame_bits;

while Viterbi decoder calculates BER with:

v.BER:=0;
for i:=0 to frame_bits*2-1 do v.BER:=v.BER+hard_correlate(input[i],$FF xor corrected[i]);

So something is definitely wrong because our final signal quality is not in the range [0..100] - seems like vit_get_percent_BER() gives us wrong output.

I've tried to eliminate factor 10 and got value approx 67 for very weak signal. Also I've tried to divide by frame_bits*2 and not frame_bits and still got negative values for weak signals.

Error in readme (compilation instructions)

The readme file states that this command can be used for compilation:

fpc -CX -XX -O3 -Mdelphi -FUunits -Fualib medet.dpr

However, the "units" directory doesn't exist and this command will fail. The directory must be created first (the build_medet.sh script does this).

$fca2b63db00d9794

Привет, Артем!

Скажи пожалуйста как между собой связаны $1ACFFC1D и $fca2b63db00d9794?

corr_init(m.c,qword($fca2b63db00d9794)); //sync is $1ACFFC1D, 00011010 11001111 11111100 00011101

unhandled exception and EInOutError for read-only input file

On linux, using either pre-compiled or self-compiled code.
The code fails with:
An unhandled exception occurred at $0000000000402525: EInOutError: Access denied $0000000000402525
If the input file doesn't have write permissions for the user, even though it doesn't seem to need write permissions. (Didn't modify the size or timestamp on the input file as best I can tell.)

Only IR channel how?

Hi.
How can i get only IR channel out of the decoder?
Most of good passes for Meteor here are at night and i would like to take at least some pictures.
Thanks.
Regards -Took

Image aspect ratio

Hi!

I noticed most of the decoded pictures seems to be a little narrow such as http://weather.reyni.co/image/2020/02/10/METEOR-M220200210-081615-122.jpg, that should be something like http://weather.reyni.co/image/2020/02/10/METEOR-M220200210-081615-122-adjust.jpg (20% wider here, give or take)

I'm running medet_arm as follows:

  • medet_arm "meteor.qpsk" "meteor" -cd
  • medet_arm "meteor.dec" "meteor-img" -r 65 -g 65 -b 64 -d

Is there anything I can do to know how much wider the image needs to be?

Compiling a Binary

I have been struggling to learn enough about Pascal to compile a binary with free pascal. Is there a general guide or instructions to compile this package?

Compile error on Jetson nano

jetson nano
ubuntu 18.04
arm64/aarch64

compiile error:

./build_medet.sh
Free Pascal Compiler version 3.2.0 [2020/06/05] for aarch64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Linux for AArch64
Compiling medet.dpr
Compiling ./alib/asys.pas
Assembling asys
Compiling met_to_data.pas
Compiling ./alib/ecc.pas
ecc.pas(223,87) Warning: Local variable "root" does not seem to be initialized
ecc.pas(235,18) Warning: Local variable "loc" does not seem to be initialized
ecc.pas(223,35) Warning: Local variable "omega" does not seem to be initialized
Assembling ecc
Compiling correlator.pas
Assembling correlator
Compiling viterbi27.pas
Compiling ./alib/bitop.pas
bitop.pas(97,16) Warning: Conversion between ordinals and pointers is not portable
bitop.pas(119,15) Warning: Conversion between ordinals and pointers is not portable
bitop.pas(142,14) Warning: Conversion between ordinals and pointers is not portable
bitop.pas(151,14) Warning: Conversion between ordinals and pointers is not portable
Assembling bitop
Assembling viterbi27
Compiling ./alib/tim.pas
tim.pas(18,18) Error: Illegal assembler style specified "INTEL"
tim.pas(32,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppca64 returned an error exitcode

MetoerM2-2 OQPSK

Use Medet everyday!
Will you be creating a version with OQPSK to decode the new Meteor 2-2 Satellite?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.