Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://hea-www.harvard.edu/RD/saotng/memory.html
Дата изменения: Unknown Дата индексирования: Mon Oct 1 23:33:24 2012 Кодировка: Поисковые слова: storm |
By default, SAOtng maintains in memory both the scaled data and the raw data for each image being displayed. The scaled data is required for the display. The raw data is used to speed up rescaling as well as for data analysis programs that work on the image section. It also is used to display the actual pixel values of the image.
The scaled data requires one byte for each pixel. In the default case of a 512x512 image, this amounts to approximately 1/4 Mb. The raw data, however, requires n bytes for each pixel, where n depends on the data type. For integer data, this can be 2 or 4 bytes, while float data requires 4 or 8 bytes. Thus, a raw float image section can take 1 or even 2 Mb of memory for a 512x512 image.
The choice to maintain these images in memory was based on the perception that default workstation environments are offering more and more memory. It is becoming common to have at least 32 or 64 Mb of memory and even more. But in environments (such as PC/Linux machines) where memory is scarce, SAOtng allows the user to choose not to maintain the raw image section in memory. This is done using the command line switch:
-hog Falseor the environment variable:
setenv SAOTNG_HOGMEMORY FalseWhen either of these is set, SAOtng will maintain only the scaled image in memory. Hog is set to True by default for all platforms.
Additional memory considerations are applied to FITS images which are loaded into SAOtng using the Load a New Image menu option, the file public access point, or the XDir program (but not the fitspublic access point). In order to optimize repeated extraction of image sections from a FITS file, the entire FITS file will be maintained in memory if the size of the file is less than a predetermined maximum value. (In cases where the FITS image is not maintained in memory, the external fitsextract program is used to extract new image sections.)
The maximum size for maintaining a FITS image in memory is set by the command line switch:
-maxsizeor the environment variable:
setenv SAOTNG_MAXSIZE 142857The default value is 4.5 Mb for non-Linux systems, 1.5 Mb for Linux systems. As a special case, if maxsize is set to 0, then all FITS files will be maintained in memory. If it is set to 1, then FITS files effectively will never be maintained in memory. Note that setting the -hog flag to false also prevents FITS files from being maintained in memory without even checking file size.
The maxsize value can be reset at any time from the Set Max FITS Memory Size option in the File menu. If a positive value is input for maxsize, then Hogmemory is also turned on, so that raw data will be maintained in memory. If a negative value is input, Hogmemory is turned off and raw data will not be maintained in memory.
Finally, note that the fits public access point can be used to send a FITS file directly to SAOtng. (The file access point is used to send a file name rather than the file itself.) In this case, the entire FITS file is maintained in memory as received by SAOtng, regardless of the state of the hog or fixsmax flags. This configuration is required, for example, in cases where the image is being sent over the Internet from an archive server to a local SAOtng display.