Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.naic.edu/~emuller/making_gifs.html
Дата изменения: Thu Oct 21 22:53:01 2004 Дата индексирования: Mon Oct 1 22:49:17 2012 Кодировка: Поисковые слова: п п п п п п п п п п п п п |
If you have taken data in a mapping mode and have a three dimensional dataset (PPV - or have some other underhanded way of owning a 3d dataset), it is possible to construct a nifty gif, which shows the rotation of your cube. Necessary software: 1. The KARMA Data reduction set- specifically XRAY and KVIS (these exist at AO) 2. karma2ppm (Software to generate the individual gifs which form the movie) 3. Some Gif-creating software (e.g. whirlgif)1. Producing the set with KARMA:
Your dataset must be readable by KARMA. This means is must be in FITS or Miriad format. AOGRIDZILLA returns data in FITS format, though it is possible to convert from ICORR to FITS format using the command 'SDTEST' (see the FAQs for more info). The appropriate KARMA tool is called 'xray'. Simply type this into the UNIX command line. A green window pops up, click 'file' and then select your dataset. Note that (usually) only files which have *.fits (or are otherwise readable by KARMA) will appear in the file list. N.B. - You may also get a bunch of colourmap errors - these have to do with the colour table allocated to XRAY. It is ok to ignore them. N.B. - To create a 3d-rotating movie, you obviously need a 3d dataset. Dont even bother with a single-channel set. A new widget pops up, 'Xray Range Selector' This allows you to select the brightness range for the display. You must select this range (use one of the percentage buttons, or use left button to selectr minimum, right button for maximum. Then minimise the window. Now a NEW window pops up. It shows the three orthogonal directions of your cube, i.e. PP (position-position: RA, Dec), PV (position-:velocity: RA, Vel) and VP (Velocity-position: Vel, Dec). For making a movie, this window is not useful, but it is fun to play with. Then minimise the window. in 'Display' window, you can see your dataset, as PP (or whatever the first axis is). In the primary widget (i.e. the one that popped up FIRST of all), the roll, pitch and yaw functions can be ued to control the atitude of the cube. Play with them for fun. To make a movie of the cube rotating, click on 'Make Movie'. The widget that pops up will let you control the pitch/yaw/roll increment, and the number of steps. For example, to get a rotation in the RA/Vel plane, choose say, 'Yaw increment'=5, 'Num of frames'=72, then 'Start'. N.B. You can tweak colour scaling from the 'display' window from 'intensity' -> 'Pseudo color (emulated)', or by using the brightness range selector - these two functions do different things though, so be careful about what you do. When the movie is complete, a NEW widget 'Animation Control' pops up. You can preview your movie a bit here, click 'Start Movie'. It will probably move quite fast, so you can slow it down by increasing 'Frame interval (ms)'. Now. you must EXPORT the movie. Go back to the 'Movie Control' widget, and click on 'Save'. Your movie will be saved with a name, which you have specified in 'Movie Arrayfile name' and is suffixed with *.kf. N.B. The saved data is ONLY as a fits datcube. Each channel in the cube is a fram of the movie. There is no timing or colour information saved to the file, however the BRIGHTNESS scaling IS saved. One further bit of info. Unless you want the movie as a greyscale, you should save a colourmap as well. From the 'display' window, go to 'intensity' -> 'Pseudo color (emulated)' and select a colour look up table and vary the contrast scaling as you wish. You should save this table by selecting 'save'. Call the talbe something appropriate: e.g. cmap_head. It will be suffixed with *.kf. Now exit Xray.2. Creating the gifs:
It is best to create a new directory, since you are about to create a lot of files. Move the cmap file and the movie file into it, and then 'cd' to it. Now you will convert the karma-generated fits cube into a series of gif images. If you made a movie with 500 frames, then you will generate 500 files !!. to run the converter, type 'karma2ppm' type '?' at the prompt to see the current configuration. Hopefully the response will look something like: binary on #whether to write binary mode files converter "ppmtogif" #converter name count_from_zero off #count images from 0 cmapfile "cmap_heat" #default colourmap filename fixed_width_sequenc on #keep sequence numbers same width extension "gif" #converter extension name out_height 400 #output image height out_width 400 #output image width abort #abort without saving panel values add_connection #hostname port_number protocol_name exit #exit panel quit #exit panel show_chan_buf_sizes #show the R/W buffer sizes for a channelshow_connections #this will show all connections show_protocols #this will show all supported protocols show_version #this will show version information set_chan_buf_sizes #set the R/W buffer sizes for a channel If not, the parameters can be changed by typing, say cmapfile mycmap N.B. karma2ppm automatically identifies *.kf files, so you don't need to type the extension, but it does not hurt if you do. N.B. out_height and out_width are the dimesnsions of the movie in x and y. N.B. Change the cmapfile parameter to the name of your colourmap file (that you saved from the psuedocolour scaling in Xray To run the conversion, type at the command line: 'movie_from_xray prefix_for_gifs' Where 'movie_from_xray' is the name of the file created from the movie creator in xray, and 'prefix_for_gifs' is the name of the number of numerated gifs to be created. This will return a whole bunch of gifs for you to play with. you can use xv to view them. exit out of karma2ppm.3. Making the animated gif:
you can use any gif maker you like. I use whirlgif because it is straightforward, easy to install and easy to run. Here is how whirlgif is activated: First, you make a file which lists all the gifs you want in the animation, in the correct order. call it, for example, 'f_list' now type: whirlgif -animated.gif -loop 1 -time 10 -i f_list this will produce an animated gif called 'animated.gif', showing all the gifs which are listed in f_list, with 10* 1/100 of a second spacing between the frames. There are a bunch of other switches which you can use for whirlgif, look at whirlgif.man for more info. I'm not going into detail on whirlgif because people have different preferences for their gif-creators. Thats all fo' now! EM.
gs -sDEVICE=jpeg -sOutputFile=out.jpg -dNOPAUSE -dBATCH -c "/showpage { } def " -f fred.eps -c "systemdict /showpage get exec quit"