Example Usage:
Phil has a stand alone C script
fits_to_ppm that converts fits files into ppm - but does NOT convert compressed files - So check fits headerbefore using.
For a fits datacube; it only converts the first image! But we can put in and shell script and it can use ds9 colortables.
Netpbm is toolkit for manipulation of graphic imagesincluding conversion of images between various formats.
ImageMagickis an open source software suite for displaying, converting, and editing raster image files.It can read and write over a 100 image formats. however theer is no utility to convert fits mages to any other format.
Ffmpeg/ffplay is a complete, cross-platform solution to record, convert and stream audio and video.
ffmpeg -qscale 5 -r 20 -b 9600 -i %04d.png ~priya/movie.mp4
Mencoder/menplayer
Mencoder:(MPlayer's Movie Encoder) is a simple movie encoder, designed
to encode MPlayer-playable movies (see above) to other MPlayer-playable
formats (see below). It encodes to MPEG-4 (DivX/Xvid), one of the
libavcodec codecs and PCM/MP3/VBRMP3 audio in 1, 2 or 3 passes. Fur-
thermore it has stream copying abilities, a powerful filter system
(crop, expand, flip, postprocess, rotate, scale, noise, RGB/YUV conver-
sion) and more.
DS9 can also be used to convert fits files or fits data cube into jpg images or mpeg1 video. However the image resolution and quality is not great.
ds9 Vtrack.fits -scale limits -2000 2000 -cmap file Blue_grey_Red.lut -saveimage tiff Vtrack1/Vtrack1.tiff -exit
PNG
This format is intended to eventually replace older formats like GIF and TIFF. It is a modern format capable of handling 16 bit quality with four color channels allowing the full use of semi-transparent colors. It also includes a huge number of lossless image compression options.
Some Common colormap formats:
render_image in='hmi_test.M_45s[2010.07.08_00:00:00/30m]' out=./test/ type=jpg min=-500 max=500 outid=# outname=test
will give a set of
uncropped grey scale images.
Example yeilding colored images:
render_image in='hmi_test.M_45s[2010.08.15_00:00:00/15m]' out=./test2/ type=jpg min=-500 max=500 palette =/home/priya/Colormaps/Blue_grey_Red.lut outid=# outname=M
fits_to_ppm in='someingaeuncompressed.fits' MIN=-2000 MAX=2000 table=/home/phil/apps/hgtest/pmag.lut | pnmtopng >xxx.png
so these are coloured png images using a lut (look up color table) from Phil's directory:
ls /usr/bin/pnm* yeild a host of utilities.
Note ppmtompeg converts it into mpeg1 video stream not mpeg4.
Mplayer is a movie player for Linux (runs on many other platforms) and runs most of the movie formats out there.
Note: ds9 can be controlled from the commandline. For eg:
ds9 -pan 1495 -640 physical -zoom 2 -scale limits -1000 1000 -cmap bb
Or in a shell script:
ds9 $basic_file{$f}.magnetogram.fits -zoom to fit -scale limits -1000 1000 -cmap grey -saveimage jpeg images/{$f}.jpg -exit
More information on how to use ds9 effectively can be found at Learning ds9
Commonly Used Image Formats:
PPM: stands for portable pixel map.
It is a netpbm format -Apparently very inefficient:It is highly redundant, while containing a lot of information that the human eye can't even discern. Furthermore, the format allows very little information about the image besides basic color, which means you may have to couple a file in this format with other independent information to get any decent use out of it. However, it is very easy to write and analyze programs to process this format, and that is the point.
GIFS: Extremely common, has been around a long time. Uses limited colors with only saves 8 bit quality -use for line drawings/cartoons with limited colours.Howver it saves canvas size info to make animation sequences.
JPEG:
Does not handle transparency at all. The image is equivalent to using "+matte" operation to remove the alpha channel, so any background transparency commonly becomes black depending on the image processing used to generate the image.
This format is also 'lossy', producing edge effects on sharp lines and borders and thus should not be used for any intermediate image processing, or storage of image originals (unless they were already in this format).
It is well suited to long term storage of real life photographs, but avoid it if you plan to further process the image, or the image contains large areas of solid colors.
MNG
This is the multi-image format for PNG, and allows animations to movie quality levels and speed.
About Colormaps:
Red Green Blue
0.000000 0.000000 0.000000 Black
0.000000 1.000000 0.000000 Green
0.000000 0.000000 1.000000 Blue
0.000000 1.000000 1.000000 Cyan
1.000000 0.000000 0.000000 Red
1.000000 1.000000 0.000000 Yellow?
1.000000 0.000000 1.000000 purple/magenta
1.000000 1.000000 1.000000 white
0.500000 0.50000 0.500000 Grey
**********
Other JSOC Documentation
Wiki
Man pages
AIA/SDO Docs
Look Data
Export Data
Tuesday, Aug 17, 2010