METEOR-HRPT format.

This format is actually exactly the bytes transmitted, with a 256-bytes header added.

Header.

The header is 256 bytes. (The meaning of the first 131 bytes are equal to the first 131 bytes of the 10B-format header.) After the header the received bytes are dumepd: frames of 256 bytes. Each frame starts with the sync word:
  • 1A CF FC 1D
    (that is, if transmission is error-free).
    So: One line needs 50 frames; the first frame of a line contains at bytes 22...29 (counting from start-of-frame)
  • 02 18 A7 A3 92 DD 9A BF
    Software needs to search for this sync word. (Note that searching for frame syncword isn't needed; each frame starts at a multiple of 256 bytes in the file.)

    Here is the header description in C.
    Note:

    Reading the header in C needs to be done in 3 parts:
    fread(hrpthdr,131,1,fp);
    fread((char *)&hrpthdr->offset_lon,15,1,fp);
    fread((char *)&hrpthdr->widthmax,110,1,fp);
    
    The same holds for writing:
    fwrite(hrpthdr,131,1,fp);
    fwrite((char *)&hrpthdr->offset_lon,15,1,fp);
    fwrite((char *)&hrpthdr->widthmax,110,1,fp);
    
    
    
    #define HRPTSIGN "MHRP"
    #define LENSATNAME 16
    #define LENSIGN 4
    #define ENDFLG 8
    
    /* Sub-record for time, similar to "tm", but with 2-bytes shorts 
       (important for portability to e.g. Linux) Total 18 bytes */
    struct tm_sh
    {
      short tm_sec,tm_min,tm_hour;
      short tm_mday,tm_mon,tm_year,tm_wday,tm_yday;
      short tm_isdst;
    };
    
    /* Sub-record with Kepler info 12*4=48 bytes */
    typedef struct 
    {
      long noradnr;
      long internat;
      long year;
      float daynr;
      float decayrate;
      float inclination;
      float raan;
      float exentricity;
      float perigee;
      float anomaly;
      float revs;
      long rev_orbit;
    } KEPLER;
    
    
    The actual header of the file:
    
    typedef struct
    {
      char sign[LENSIGN];              //  4
      char satname[LENSATNAME];        // 16
      char chan_tot;                   //  1
      char filetype;                   //  1
      short width,height;              //  4     width < 2048 if zoomed
      short depth;                     //  2
      char offset_gmt,offset_sec;      //  2
      struct tm_sh tm_comp;            // 18
      KEPLER kepler;                   // 48
    
      char hdr_version[ENDFLG];        //  8
      short hdrlen;                    //  2     length of header
      short x_offset,y_offset;         //  4     Offset from original if zoomed
      char satdir,reserve2;            //  2
    
      struct tm_sh tm_satstrt;         // 18
      char tm_comp_sat_vlg;            //  1
      char fill1;                      //  1     (not written!)
    // end-of-part 1, 131 'real' bytes
    
      float offset_lon;                //  4
      char channel[11];                // 11
      char fill2;                      //  1     (not written!)
    // end-of-part 2, 15 'real' bytes
    
      short widthmax;                  //  2
      float alphamax;                  //  4
      char reserve[96];                // 96     reserved-bytes
      char endhdr[ENDFLG];             //  8
    // end-of-part 3, 110 'real' bytes
    } HRPTHDR;
    // total: 131+15+110=256 bytes