Picture-data can be viewed directly, or translated into standard picture formats.
Xrit2pic can perform some simple dataprocessing; e.g. false colour pictures
may be generated by mapping multiple channels onto different colours.
Some dedicated mappings (e/g/ fog and dust detection) are built-in.
Xrit2pic can also generate anaglyphs (3D images); the luminance is translated into altitude.
Movie generation is implemented, and is also possible in combination with all mentioned features.
For polar satellites tracks may be plotted on a world map; selection of parts of a track
to view or export is supported.
All data processing is done using directly the received raw files, so without generation
of intermediate files.
Next figure shows the place of xrit2pic in a MSG receiving environment.
Note: This is just an example; data coming from the Eumetsat ftp service, located on a CDROM etc. are equally suitable to manage by xrit2pic.
xrit2pic is available for both Linux and Windows. It is also compilable for other platforms (Sun/Solaris, MAC, etc.); source code is available. Note that (as far as I know) Eumetsat does only support Linux and Windows platforms, for their Tellique software.
Normally xrit2pic doesn't need much PC memory:
For METOP more PC resources may be needed. Data of this polar satellite may be virtually endless; a data set may cover multiple orbits. Showing one complete orbit is still possible with 512M RAM, if no other big programs are running.
I run a complete MSG receiving station using Linux on a 2.4GHz PC containing 512M of memory.
This is enough to receive pictures, show in an automatic way just received
pictures and search and show previous recorded pictures, al at the same time,
without loss of incoming data. (That is, without viewing METOP data!)
Executing several xrit2pic's in parallel is no problem.
Note, however, that xrit2pic can delete (on request, of course) or move files;
if a second xrit2pic is using the same data it can get "confused".
In addition, the gui state of the main window and some popups may be saved; at start-up the state of all buttons and choices in these windows is restored. The gui state is saved in xrit2pic.gini.
There are 3 places where xrit2pic.ini and xrit2pic.gini are searched after starting xrit2pic:
The 2 most important settings are:
Description main window:
Selection can be done in several ways:
Expand: Expand the tree 1 level, so all channels become visible. Clicking again will collapse the list.
After selection of one or more items a preview or file generation can be performed.
If the picture needs to be exported with special options, i.e. zoomed, custom luminance settings etc., use the File->Save menu in the preview window.
If a 'blue line' is selected then a colourpicture can be generated; click on 'Enable' in the 'Colours' box. By default the following mapping is used:
| red | green | blue | |
|---|---|---|---|
| HRIT | IR016 | VIS008 | VIS006 |
| LRIT | IR016 | -- | VIS006 |
| AVHRR | Ch1 | Ch2 | Ch4 |
Selecting button 'Mapping' pops up a window in which you can change the mapping:
Contribution of each channel to any colour can be changed with the spin-buttons
below, between (e.g.) +100 and -100%.
For each colour an offset may be defined.
Calculation of the contribution of each channel depends on the 'Mirror neg. values' button.
Some default mappings are built-in:
Pressing 'Help' gives a overview of the meaning of the status-'led's':
Note on using preview window: The first picture selected will be shown in the preview window. If this pic is not suitable to do the settings then:
Some extra movie features:
In the Translate window, second row of buttons, choose near 'Tempfiles':
If multiple items are selected only the first item will get a preview.
It is however possible to use another item to do the settings:

xrit2pic uses following directory structure to handle xrit-data:
Move data between received and done directory:
Normally never needed.
Click the Exported tab.

Exported/generated files (including movie files) in the destination directory are now visible. Files may be viewed using an external viewer (see 'Viewer programs' in preferences) or deleted. Temporary files, used to generate movies, are also accessible via this window.
Currently xrit2pic only uses prologue files to extract the position of the
2 parts of the HRV channel. The used prologue data is visible using Preview
(select first the prologue file in the tree).
If data is processed using external programs the prologue/epilogue data may be
needed. For this purpose they can be exported.
To extract a prologue/epilogue file select the item and click on 'Export'.
It is possible to export prologue/epilogue files in an automatic way together with the channels they belong to. See 'Other features'.
By default files will be generated with highest possible quality:
| default | PGM selected | JPEG selected | Blue line selected | ||
|---|---|---|---|---|---|
| black&white | colour | B&W or colour | |||
| LRIT (Meteosat) | JPEG 8 bits (1) | PGM 1 byte | PPM 3 bytes | JPEG 24 bit (2) | select window pops up |
| LRIT (foreign) | PGM 1 or 2 bytes | PGM 1 or 2 bytes | (not supported) | JPEG 24 bit | select window pops up |
| HRIT except HRV | PGM 2 bytes | PGM 1 or 2 bytes | PPM 3 bytes | JPEG 24 bit | select window pops up |
| HRIT HRV | PGM 2 bytes | PGM 1 or 2 bytes | (not supported) | JPEG 24 bit | |
| AVHRR | PGM 2 bytes | PGM 1 or 2 bytes | PPM 3 bytes | JPEG 24 bit | rah (for wsat, hrptreader) |
| EPS | PGM 2 bytes | PGM 1 or 2 bytes | PPM 3 bytes | JPEG 24 bit | rah (for wsat, hrptreader) |
| Admin | text (ASCII) format | ||||
| Other | binary format | ||||
Notes:
xrit2pic [options]
options:
-h this help
-e non-gui examples
-overlay_files show available overlayfiles
-nogui non-gui mode
------------------------------------------------
options for locations:
-src <path> path to source XRIT files (def.: see ini-file)
-dest <path> path to destination dir (def.: see ini-file)
------------------------------------------------
options for file formats:
-pgm generate PGM (see below for defaults)
-pgm8 generate PGM (forced to 8 bits pp)
-jpg generate JPEG (see below for defaults)
-rah generate rah from AVHRR
-nolin don't linearize AVHRR
-overwrite overwrite if file exist (default: not)
------------------------------------------------
options for choosing what to generate:
-europe Europe part only (MSG)
-gmap 'plane carre' mapping (geostat)
-movie generate movie file
-sat <sat_source> translate only this sat (MSG1, MET7...)
-type <H or L or A> translate only this type (HRIT/LRIT/AVHRR)
-chan <chan_name> translate only this channel
-segm <range> translate only these segments
-date <yy-mm-dd> translate only this date
-time <hh:mm> translate only this time
-pro extract also prologue file
-epi extract also epilogue file
-inv invert
-temp generate temperature mapping (IR only)
-anagl [anagl_opts] generate anaglyph
anagl_opts: <shft[:lmin[-lmax]]>
shft: pixel-shift left/right (def. 20)
lmin: max shift at this lum (def. 0)
lmax: min shift at this lum (def. 512)
------------------------------------------------
options for multi-channel compositions:
-compose [type] make false-color pics
type=optional; vis or airm or dust or fog
vis=default
-hrvlum use HRV for lum (high-res colour)
-inv <channame> invert this channel
-lmin <val> minval; this val mapped on 'black'
-lmax <val> maxval; this val mapped on 'white'
-inv <channame> invert this channel
-inv <channame> invert this channel
-r <channame>[=val] use this channel for red
-g <channame>[=val] use this channel for green
-b <channame>[=val] use this channel for blue
val=-100...100 (def. 100)
-ro <offset> offset for red (def. 0)
-go <offset> offset for green (def. 0)
-bo <offset> offset for blue (def. 0)
-msb <msb> msb for translation 10 bits->8 bits
<msb>=9, 8 or 7
------------------------------------------------
Other options:
-test don't generate, just show what will happen
-log generate log file 'xrit2pic.log' (in dest. dir)
-ol[=<lum>] [<type>] add overlay to picture
<lum> = overlay lum, 0..255 (def. 255)
<type> = coa(st), cou(ntry),
l(atlong), b(oth) (b=default)
Default generated formats: See Generated files.
For options -chan, -date and -time wildcards are allowed.
In the non-gui mode xrit files can be translated immediately into JPEG/PGM files.
Example:
This will translate all HRIT files with channels VIS* (VIS006, VIS008), segments 3 until 7, of februari 2004 and time 21:00, together with their prologue files.
The log file, if generated, will be placed in the destination directory. Note that this file will not be overwritten; new info will always be appended.
Make sure that you have write access to the destination directory! Otherwise nothing will happen, and also no log file will be created (because this file would be created in the destination directory).
See Example nongui commands.
The 2 PC's have the following functionality:
Advantage: Processing is quicker (decompressing Wavelet is processor intensive).
Disadvantage: Bigger files (if used format is PGM) or data loss (if JPEG is used)
Method B is currently the best method: no data loss before processing, and file sizes relatively small.
Now in detail:
If no directories are defined then defaults are used.
Define directory with XRIT files:
Some notes:
xrit2pic saves its settings into a preferences file xrit2pic.ini. This includes the directory settings discussed in the previous section.
If no viewer is specified the following built-in viewers are used:
If no encoder is defined mencoder will be used:
Note: This is another way to determine the source directory; see also Directory setting.
There are 2 files to download:
Unzip the 2 files and place the result into e.g. $HOME/bin.
There are 4 or 5 files to download:
Installation using install program:
Installation: (if install program is not used)
Start it using 'Task scheduler'.
Go to the
Using two PC's.
Xrit2pic may be used in a 2-PC environment, but has currently some limitations.
In this part 3 methods are described, as well as a detailed settings description
for one of the methods.
There are several methods to use 2 PC's:
Method A: (see detailed Windows settings below)
Method B:
Advantage compared to previous method is that the copy mechanism may run on
low priority, so less chance on lost segments. Also, raw data is read just once from harddisk 'R'.
Method C:
(Note: Working on adding losless compressed format with at least 10 bits per pixel.)
Settings for remote access (Linux).
If Linux is running on both PC's you can do a remote mount using sshfs:
(as root, of course).
Now you can browse to /mnt/msg, and from thereon to all directories below (asuming protections are set correctly).
Settings for remote access (Windows).
Method A using Windows.
In short, if your files on your Receiving PC are in:
then you need to make shareable:
and in xrit2pic on the Processing PC you can find the files on the receiver PC in:
(with rec_pc the network name of your receiver PC).
Assumed is standard Tellique installation, i.e., received directory is:
Program Files\T-Systems\BusinessTV-IP\received
on your Receiver PC.
Note: The directory which is made shared ('BusinessTV-IP' in this example)
is NOT reachable by xrit2pic, but directories below the shared directory
('received' in this case) are.
This is the reason why the directory containing received is made shareable, and NOT received itself!
Check that the directory is shared:
\\pcname\BusinessTV-IP (with pcname the name of your Receiver PC).
\\pcname\BusinessTV-IP\received
Note that this is the same directory name found on the 'Receiver PC' under 'My network locations',
but with directory received added.
Now the content of the directory on the remote 'Receiver PC' should be vissible in the main window.
What works remotely:
What maybe doesn't work remotely: (to test)
Directory setting.
Now the program will jump to the main part, and the content of the selected directory is visible.
Click 'OK'.
\\computer_name\c\
(Note: NO ':' after the disk name!)
After typing the last '\' the directory content of the remote computer is examined and made visible, and browsing is possible as usual.
Preferences.
You can get back the program's defaults by clicking the 'Load defaults' button.
Save settings by clicking on Save it '.
Note that the directory list (see Directory setting) is also saved, including the directory selected!
If the program is started a next time it will read the preferences file and will immediately load the directory which was selected just before saving the preferences file.
For each viewer options may be defined to make sure that the picture is always shown "upside up".
In the example:
Note: If no '%s' is added the filename will be added as last argument to the program.
If '%s' is present then this will be replaced by the filename. (Compare in this example avi and pgm.)
xv file.jpg
wsat -w 500 -h 500 -i file.pgm
mplayer -fps 3 file.avi -loop 0 &
Note: JPEG files will be always as they are transmitted (i.e., MSG and MET files upside-down, foreign formats upside-up).
A speed option may be defined separately; by default this is:
This results in a film speed of one frame per second.
If a different command is used make sure that this command should contain 2x %s; xrit2pic will replace the first one by the input file, the second one by the output file.
Note: Any part of the earth disc may be selected this way.
(The destination directory may also be entered manually in the 'Destination directory' field.)
(The destination directory may also be entered manually in the 'Source directory' field.)
The default time/date spec "%t" may be replaced by a more custom time spec.
Formatting will be done according to the strftime() C-function, except for the folowing % codes:
The window shows the codes to add to the format. Some examples:
format example result comment
picture picture.jpg always same filename
%s%c_%t MSG1VIS006_061220_1200.jpg
%k, %s, %c, %n, %r, %t
Some codes:
%a The abbreviated weekday name according to the current locale.
%A The full weekday name according to the current locale.
%b The abbreviated month name according to the current locale.
%B The full month name according to the current locale.
%C The century number (year/100) as a 2-digit integer. (SU)
%d The day of the month as a decimal number (range 01 to 31).
%D Equivalent to %m/%d/%y. (Yecch - for Americans only. Americans
should note that in other countries %d/%m/%y is rather common.
This means that in international context this format is ambigu-
ous and should not be used.) (SU)
%e Like %d, the day of the month as a decimal number, but a leading
zero is replaced by a space. (SU)
%H The hour as a decimal number using a 24-hour clock (range 00 to
23).
%I The hour as a decimal number using a 12-hour clock (range 01 to
12).
%j The day of the year as a decimal number (range 001 to 366).
%p Either \x{2018}AM\x{2019} or \x{2018}PM\x{2019} according to the given time value, or the
corresponding strings for the current locale. Noon is treated
as \x{2018}pm\x{2019} and midnight as \x{2018}am\x{2019}.
Saving/restoring gui state.
For following windows the gui state can be saved/restored after start-up:
To save the gui state:
The file is stored in xrit2pic.gini in the current directory. Like xrit2pic.ini it may beplaced in a central location; see
Settings
Appendices.
Installation.
This is a list of all needed/related items for xrit2pic to run:
category name needed update where to get
Main program xrit2pic(.exe) always each new release http://www.alblas.demon.nl/wsat
library GTK always never http://www.alblas.demon.nl/wsat (Windows)
library JPEG always never http://www.alblas.demon.nl/wsat
library Wavelet always never http://www.alblas.demon.nl/wsat
init-file xrit2pic.ini no (defaults) - generated by xrit2pic
gui init-file xrit2pic.gini no (defaults) - generated by xrit2pic
supporting program bzip2(.exe) AVHRR only never http://www.alblas.demon.nl/wsat (Windows)
overlay files met8*.gif etc. Geostat. Meteosat never Eumetsat
Kepler files noaa.txt AVHRR lon/lat calc. each month? http://www.celestrak.com
Linux.
Installation of xrit2pic is simple; it is just a matter of placing
the program and its libraries on the right place.
It is assumed that gtk is installed. This is normally always the case (I think)
on Linux machines. Otherwise download and install gtk-1.2.
For AVHRR bzip2 is needed. This is also present in each Linux distribution.
Windows.
Installation of xrit2pic is simple; it is just a matter of placing
the program and its libraries on the right place.
For updates it is normally enough to download just xrit2pic.zip, and then run
the installer.
Note In Properties of the link (select from menu via right mouse-click)
it is possible to minimize the command shell which pop ups at start of xrit2pic.
Also the working directory may be changed here.
Example non-gui commands.
Next command translates all HRIT files with a channel name starting with VIS for every day with UTC time of 12:00. Only segments 7 and 8 are added to the picture (which is Europe).
xrit2pic -nogui -type H -chan VIS* -segm 7-8 -time 12:00
Next is a example to do this translation 'forever'; each day the receive directory is cleaned.
xrit2pic -nogui -type H -chan VIS* -segm 7-8 -time 12:00 -log
rm /home/user/from_msg/received/*
Start it as a cronjob every day around midnight (at least several minutes from the time that the files to translate are generated!)
xrit2pic -nogui -type H -chan VIS* -segm 7-8 -time 12:00 -log
del c:\from_msg\received\*.*
Details about movie generation.
xrit2pic generates movies in the following way:
If an external encoder 'mencoder' is used then basically the same happens.
'mencoder' combines ALL files in the temp directory into a movie file; this is the reason why first
all files are moved to the sav directory. For the internal movie generator this isn't necessary.
Advantage of mencoder is that several codecs may be used. The default one is msmpeg4v2.
The options of mencoder, or even the whole command, may be replaced by something else; see preferences and mencoder manual. So other codecs or a complete different encoder program may be used.
Details about anaglyph generation.
Meteosat data doesn't contain 3d info. For getting a 3D illusion the left and right pictures are generated using
the luminance of each pixel. Clouds are bright and high, land is relatively dark and low, which clarifies why
luminance can be used for depth information.
Each pixel is duplicated in red and cyan; the shift between the two is bigger if the luminance is low ('land').
Adjusting.
In the preview window several buttons pop up in Anaglyph mode.
If land/coastlines have to be added:
Suggestion: Sea and cloudless low-land.
Suggestion: Clouds should just get some green spots.
Anaglyphs are possible for black-and-white and coloured picures, as well as movies.
Black-and-white gives better results than colour anaglyphs.
Installation of mencoder and codecs (NOT needed if the internal movie generator is used!)
Installation mencoder for Linux.
Download mplayer and codecs from:
Mplayer site
Installation mencoder for Windows.
Go to the
Mplayer site
and download MPlayer-mingw32-1.0pre5.zip
Put mencoder.exe into a directory which is in the search path (e.g. c:\windows).
codecs site
and download
win32codecs-essential-20040703.tar.bz2
Decompress and put the dll files into c:\windows\system.
Some remarks.
The generated files may be very big; full HRV pictures are 5568 x 11136. If you experience problems with viewers because of memory shortage you may try wsat. This program is able to show pictures with virtually unlimited size on a very small computer. (Drawback is that redrawing, e.g. after zoom action, is a bit slow.)
It can not read jpeg, so you should write out in PGM format if you want to use it. (File size of HRV in PGM format is about 124 Mbytes).
Program information.
xrit2pic is written in C and C++, using: