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 those 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 2 Mb of memory.
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. Note: on Linux platforms, -hog is set to True by default. It is set to False by default for other platforms.
Additional considerations must be 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. This maximum value is set by the command line switch:
-fitsmaxor the environment variable:
setenv SAOTNG_FITSMAX 1100000The default value is 1,100,000, i.e. enough space to hold a 512x512 4-byte FITS image with a FITS header. As a special case, if fitsmax is set to 0, then all FITS files will be maintained in memory. If it is set to 1, then FITS files will not be maintained in memory. Note that setting the -hog flag to false also prevents FITS files from being maintained in memory. In cases where the FITS image is not maintained in memory, the external fitsextract program is used to extract new image sections.
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.