;+
; PROJECT
;           SolarB EIS
;
; NAME
;           eis_raster_volume_string
;
; PURPOSE
;           Generate a string
;
; CATEGORY
;           EIS technical planning
;
; WRITTEN
;           John Rainnie, RAL
;
; VERSION
;           v0.1 JAR 19-May-2008
;                Added TARGET keyword. Compression is now target-dependent!
;           v0.2 JAR 28-Aug-2012
;                Tidied up TARGET keyword
;
;-
;______________________________________________________________________________
FUNCTION eis_raster_volume_string , raster , units  = units          ,     $
                                             target = target

; Take account of compression
IF (N_ELEMENTS(target) NE 1) THEN target = 'quiet sun'
ra_vol = eis_compression(raster , target = target)

; What Volume units are we using. Default is index = 0 -> kBits
;                                            index = 1 -> bits
CASE units OF
    0:      BEGIN
                formattedVolume = STRING(format='(F-10.2)',ra_vol/1024.)
                unitString      = ' kBits'
            END
    1:      BEGIN
                formattedVolume = ra_vol
                unitString      = ' bits'
            END
    ELSE:   stop
ENDCASE

volumeString = STRCOMPRESS(formattedVolume,/REMOVE_ALL) + unitString


RETURN , volumeString

END
