~ HCOMPRESS.BCK\ HCOMPRESS.BCK:BACKUP [...] [WHITE]HCOMPRESS.BCK/SAVE_SET/INTERCHANGE/LOG WHITE ,餫V5.5 _AIRY::  _$3$DIA2: V5.5-2 ~ *[HCOMPRESS]AAREADME.;1+,n./ 4J-v0123KPWO56(񡫗7l򡫗8lF49GHJ  23 July 1993@This directory contains HCOMPRESS, the image compression packageBwritten by Richard L. White for use at the Space Telescope Science8Institute (rlw@stsci.edu). Briefly, the method used is:A (1) a wavelet transform called the H-transform (a Haar transform- generalized to two dimensions), followed byB (2) quantization that discards noise in the image while retaining' the signal on all scales, followed by3 (3) quadtree coding of the quantized coefficients.EThe technique gives very good compression for astronomical images andFis fast, requiring about 4 seconds for compression or decompression ofFa 512x512 image on a Sun SPARCstation 1. The calculations are carried9out using integer arithmetic and are entirely reversible.BConsequently, the program can be used for either lossy or losslessBcompression, with no special approach needed for the lossless caseE(e.g. there is no need for a file of residuals.) Documentation on theHuse of the programs and on the compression method is included in the doc subdirectory.GThese programs can compress 2-byte integer images in a small variety ofJinput formats. The resulting compressed image file is machine-independentEand may be transferred between computers with binary FTP. The sourceGcode is reasonably machine-independent, although it has not been testedDon a wide range of machines. Installation instructions for Unix andCVMS (VAX) machines are given in the README files in the appropriateFsubdirectories. I would be very interested to hear of any attempts toAinstall this code on other kinds of machines (e.g. MS-DOS, Macs.)AThis version (23 July 1993) corrects one bug in the decompression>from the previous version (20 April 1992). The effect of this=bug was only noticeable for lossless compression of odd-sized?images (images with dimensions that are not a power of 2.) The@compressed files in that case were correct, but the decompressedDimages could have pixel values that differed by +/- 1 count comparedAto the original. If you have any old compressed files, they will;decompress properly using this new version of the software.2Only hinv.c has changed from the previous version.DI know of no other bugs that have been discovered (but would welcomereports of such.);Copyright (c) 1993 Association of Universities for Research:in Astronomy. All rights reserved. Produced under National=Aeronautics and Space Administration Contract No. NAS5-26555.*[HCOMPRESS]DOC.DIR;1+,y./ 4-v0123 KPWO560!758L49GHJI AAREADME. HCOMPRESS.MAN HCOMPRESS.PSPAPER.PS PAPER.TEX*[HCOMPRESS.DOC]AAREADME.;1+,./ 4K-y0123KPWO56<7\ (8\[49GHJ 20 April 1992DThis directory contains documentation for HCOMPRESS. Files include:Hhcompress.man Description of how to use the programs (plain text file)Hhcompress.ps Description of how to use the programs (Postscript file)Cpaper.tex Paper describing the compression method (TeX file).Jpaper.ps Paper describing the compression method (Postscript file).?The paper is published in the Proceedings of the NASA Space andGEarth Science Data Compression Workshop, ed. James C. Tilton, Snowbird,DUtah, March 1992. The Postscript images have been omitted from thispaper to reduce the file size.KAdditional documentation on installing the programs and on operating-systemEdependent problems may be found in the aareadme files in the unix andvms directories.*[HCOMPRESS.DOC]HCOMPRESS.MAN;1+,.'/ 4A'&.-y0123KPWO(56b776h8;\49GHJLAHCOMPRESS(1) USER COMMANDS HCOMPRESS(1)NAMEA hcompress, hdecompress, fcompress, fdecompress - compress and decompress imagesSYNOPSISA hcomp -v -i raw|net|fits|hhh -s scale -r rows -c columns% [ datafile [ headerfile ] ]& hdecomp -v -s -o raw|net|fits|hhh< hcompress -s scale -k -r files... [ options ] files...< fcompress -s scale -k -r files... [ options ] files...A hdecompress -s -u -k -r -o raw|net|fits|hhh files... [ options ] files...A fdecompress -s -u -k -r -o raw|net|fits|hhh files... [ options ] files... DESCRIPTIONA hcompress is an image compression package written toA compress the Space Telescope Science Institute (STScI) Digi-A tized Sky Survey images. It is well-suited to the compres-A sion of astronomical images, which generally consist of flatA sky sprinkled with point sources (stars) and the occasionalA extended source (galaxies and nebulae). Briefly, the method used is:A (1) a wavelet transform called the H-transform (a Haar? transform generalized to two dimensions), followed byA (2) quantization that discards noise in the image while9 retaining the signal on all scales, followed by8 (3) quadtree coding of the quantized coefficients.A The technique gives very good compression for astronomicalA images and is fast, requiring about 4 seconds for compres-A sion or decompression of a 512x512 image on a Sun SPARCsta-A tion 1. The calculations are carried out using integerA arithmetic and are entirely reversible. Consequently, theA program can be used for either lossy or lossless compres-A sion, with no special approach needed for the lossless case5 (e.g. there is no need for a file of residuals.)A These programs can compress 2-byte integer images in a smallA variety of input formats. The resulting compressed imageA file is machine-independent and may be transferred between computers with binary FTP.A The executable programs hcomp and hdecomp are the basicASun Release 4.1 Last change: 20 April 1992 1AHCOMPRESS(1) USER COMMANDS HCOMPRESS(1)A tools for compression and decompression of images. UsersA with images in FITS format will generally find it easier toA use the fcompress and fdecompress scripts, while users withA images in the IRAF and STSDAS hhh/hhd file formats willA prefer the hcompress and hdecompress scripts. (FITS is theA Flexible Image Transport System, which is the universalA standard for astronomical data. IRAF is a widely usedA astronomical data analysis system; STSDAS is a package ofA IRAF tasks designed for Hubble Space Telescope data.) ThoseA who wish to use this compression software for non-A astronomical images will probably find these scripts inade-A quate and are encouraged to create their own scripts usingA these as a model. It also would be rather easy to modify? the source code so that 8-bit images can be used as input.A In Unix these programs and scripts can be installed in someA directory found in your path using the make install command.A In VMS it is necessary to define symbols pointing to theA directory and the programs by executing the @hcompinit com- mand file.7 To compress a 2-byte integer image in FITS format,' fcompress -s scale image.fitsA produces an output file named image.fits.H (or image.fits_HA in VMS) with the compressed image. The input fileA image.fits is not removed unless the -r option is specified. To decompress this image," fdecompress image.fits.H/ will create a FITS file called image.fits.A The -s scale option determines the amount of compression.A Scale = 0 or 1 leads to lossless compression, i.e. theA decompressed image has exactly the same pixel values as theA original image. If scale > 1 then the compression is lossy:A the decompressed image will not be exactly the same as theA original. For astronomical images, lossless compression isA generally rather ineffective because the images have a goodA deal of noise, which is inherently incompressible. However,A if some of this noise is discarded then the images compressA very well. The scale factor determines how much of theA noise is discarded. We have found that setting scale to 2A times sigma, the RMS noise in the image, usually results inA compression by about a factor of 10 (i.e. the compressedA image requires about 1.5 bits/pixel), while producing aA decompressed image that is nearly indistinguishable from theA original. In fact, the RMS difference between theA decompressed image and the original image will be only aboutA 1/2 sigma. Our experiments indicate that this level of lossASun Release 4.1 Last change: 20 April 1992 2AHCOMPRESS(1) USER COMMANDS HCOMPRESS(1)A has no noticeable effect on either the visual appearance ofA the image or on quantitative analysis of the image (e.g.A measurements of positions and brightnesses of stars are not adversely affected.)A Using a larger value for scale results in higher compressionA at the cost of larger differences between the compressed andA original images. A rough rule of thumb is that if scaleA equals N sigma, then the image will compress to about 3/NA bits/pixel, and the RMS difference between the original andA the compressed image will be about N/4 sigma. This crudeA relationship is inaccurate both for very high compressionA ratios and for lossless compression, but it does at leastA give an indication of what to expect of the compressed images.A For images in which the noise varies from pixel to pixelA (e.g. CCD images, where the noise is larger for brighterA pixels), the appropriate value for scale is determined byA the RMS noise level in the sky regions of the image. ForA images that are essentially noiseless, any lossy compressionA is noticeable under sufficiently close inspection of theA image, but some loss is nonetheless acceptable for typicalA applications. Note that the quantization scheme used inA hcompress is not designed to give images that appear as muchA like the original as possible to the human eye, but ratherA is designed to produce images that are as similar as possi-A ble to the original under quantitative analysis. Thus, ourA emphasis is on discarding noise without affecting the signalA rather than on discarding components of the image that areA not very noticeable to the eye (as may be done, for example,A by JPEG compression.) The resulting compression scheme isA not ideal for typical terrestrial images (though it is stillA a reasonably good method for those images), but we believe4 it is close to optimal for astronomical images.OPTIONSA hcomp -v -i raw|net|fits|hhh -s scale -r rows -c columns% [ datafile [ headerfile ] ]A hcomp reads an image from the standard input (or fromA datafile and headerfile if specified) and writes a- compressed image to the standard output.A -v Verbose. A description of the input file and theA compression achieved is written to the standard error output. -i raw|net|fits|hhh) Input format. Choices are:ASun Release 4.1 Last change: 20 April 1992 3AHCOMPRESS(1) USER COMMANDS HCOMPRESS(1)A raw Pixel values have 2 bytes in machine-A dependent order, i.e. no byte swapping isA done on input. This is the default format if& none is specified.A net Pixel values have 2 bytes in "network" order:A high byte first, then low byte for eachA pixel. Byte-swapping is done on input ifA needed. Note that this is the same as rawA format on some machines (e.g. Suns) but isA different on others (e.g. VAXes). Files inA net format can be transferred from oneA machine to another without modification, but/ files in raw format cannot.A fits FITS (Flexible Image Transport System) formatA image. Header gives image size. Bytes areA in network order. FITS format is the univer-A sal standard for transport of astronomical images.A hhh FITS-type header (but without padding linesA making header multiple of 2880 bytes) in aA file named rootname.xxh, with the pixelA values (bytes in machine-dependent order) inA a different file named rootname.xxd. No3 byte-swapping is done on input. -s scaleA Scale factor. Non-negative integer that deter-A mines the amount of compression. Default is scaleA = 1024, which could be wildly inappropriate forA your images. Use scale = 0 for lossless compres-A sion. See the discussion above for more informa- tion.A -r Pixels/row. This is the quickly varying dimensionA in the file, i.e. the order of pixels in the fileA is all pixels from first row, all pixels fromA second row, etc. Note that the size of the imageA can be specified this way only for raw and netA format images; fits and hhh format images includeA a header giving the size of the image. Default value is 256.A -c Pixels/column. This is the slowly varying dimen-7 sion in the file. Default value is 256. datafileA Input data file. If not specified the input is read from stdin.ASun Release 4.1 Last change: 20 April 1992 4AHCOMPRESS(1) USER COMMANDS HCOMPRESS(1) headerfileA Input header file. This is only specified forA format hhh, in which the header and data are inA separate files. It is also possible to concaten-A ate the header and data files into stdin for hhh format images.& hdecomp -v -s -o raw|net|fits|hhhA hdecomp reads a compressed image from the standard input and8 writes a decompressed image to the standard output.A -v Verbose. A description of the output file is writ-0 ten to the standard error output.A -s Smoothing flag. At high compressions theA decompressed image begins to appear blocky becauseA of the way information is discarded. This blocki-A ness is greatly reduced, producing more pleasingA images, if the -s flag is specified during7 decompression. Default is no smoothing. -o raw|net|fits|hhhA Output format. Default is fits for input filesA that were in FITS format and is raw for otherA input file formats. Note that this means that anA image that was originally in net format is not, byA default, decompressed to the same format. OtherA input formats are properly decompressed to the% same format on output.< hcompress -s scale -k -r files... [ options ] files...A hcompress compresses one or more images in hhh input format. -s scaleA Scale factor. Default in script is 666. NoteA that this is different than the default in hcomp.A You can modify the script to insert a typical4 value for your images as the default.? -k Keep original files after compression (default).A -r Remove original files after compression. Only theA data file (hhd) is removed, the header file is$ retained in any case. files...A One or more hhh/hhd format images to compress.A Wild cards may be used. The names of the dataA files (not the header files) should be specified.A Note that one can mix options and file names;ASun Release 4.1 Last change: 20 April 1992 5AHCOMPRESS(1) USER COMMANDS HCOMPRESS(1)A options apply only to files that follow them onA the command line. For example, the removal of theA original images may be turned on and off using theA -r and -k flags. If infile.xxd is the name of anA original image data file, the resulting compressedA image is in a file named infile.xxd.H (or$ infile.xxd_H in VMS.)< fcompress -s scale -k -r files... [ options ] files...A fcompress compresses one or more images in fits input for- mat. -s scaleA Scale factor. As for hcompress, the script$ default value is 666.? -k Keep original files after compression (default).7 -r Remove original files after compression. files...A One or more FITS format images to compress. IfA infile is the name of an input FITS file, then theA resulting compressed image is in a file named- infile.H (or infile_H in VMS.)A hdecompress -u -s -k -r -o raw|net|fits|hhh files... [ options ] files...A fdecompress -u -s -k -r -o raw|net|fits|hhh files... [ options ] files...A These programs decompress one or more compressed imageA files. hdecompress and fdecompress are actually the sameA program; the two different names are provided for con-A sistency with the two compression programs, hcompress and fcompress.+ -u Disable smoothing (default). -s Enable smoothing.A -k Keep compressed image file after decompression (default).@ -r Remove compressed image file after decompression. -o raw|net|fits|hhhA Output format. Default is fits for files origi-A nally in FITS format, and raw for other files.A Note that raw format output is correct for hhhASun Release 4.1 Last change: 20 April 1992 6AHCOMPRESS(1) USER COMMANDS HCOMPRESS(1)! format data files. files...A Names of files to decompress. The .H extension isA added to the end of the filename if it is notA explicitly specified. (In VMS the filenames mustA already have _H on the end of the file extension.)A For an input compressed image in infile.H (orA infile_H in VMS) the output decompressed image is in infile.BUGSA Current input formats include only 16 bit, 2-dimensionalA images, though the extension to other formats and to higher) dimensions would be straightforward.A FITS extensions such as multiple groups and group parameters are not accepted.A FITS header lines are not compressed when they are includedA in the compressed image file. This can significantly affectA the compression achieved for small images with largeA headers. It does have the advantage that the header can be< easily examined to determined the contents of the file.A If a highly inappropriate value is specified for the scaleA factor, the image is vastly overcompressed and much informa-A tion is lost. The compression program ought to estimate theA range of plausible scale factors from the image statisticsA and issue a warning of the user-supplied value does notA appear reasonable. It would also be useful to have the pro-A gram make a good guess for the scale factor if it is not specified.A If the wrong size is given (using the -r and -c parameters)A for a raw or net format image, the compression program mayA fail to read the entire image. No error message is issued= if the image is actually bigger than the specified size.A On VAXes running VMS, the decompressed image file may notA have the same record format as the original image. This canA cause problems if the software reading the image requires itA to have special characteristics (e.g. fixed record lengths.)A The modify program, included with the VMS command files, canA be used to change the decompressed image files so that theyA have fixed record lengths, but it uses an unsupported VMSA system routine, SYS$MODIFY, to make the modification so it% is at best a makeshift solution.AUTHORA Richard L. White, Space Telescope Science Institute Copy-A right (c) 1993 Association of Universities for Research inASun Release 4.1 Last change: 20 April 1992 7AHCOMPRESS(1) USER COMMANDS HCOMPRESS(1)A Astronomy. All rights reserved. Produced under NationalA Aeronautics and Space Administration Contract No. NAS5- 26555.? Problems, suggestions, gripes, and praise to rlw@stsci.eduASun Release 4.1 Last change: 20 April 1992 8*[HCOMPRESS.DOC]HCOMPRESS.PS;1+,.]/ 4P][b-y0123KPWO^56z78\49GHJ%!PS-Adobe-1.0,%%Creator: sol.stsci.edu:rlw (Rick L. White)%%Title: stdin(%%CreationDate: Wed Apr 22 16:52:29 1992P%%DocumentFonts: Times-Roman Times-Italic Times-Bold Symbol Times-Roman DIThacks%%Pages: (atend) %%EndComments3% Start of pscat.pro -- prolog for troff translatorK% Copyright (c) 1985,1987 Adobe Systems Incorporated. All Rights Reserved. G% GOVERNMENT END USERS: See Notice file in TranScript library directory % -- probably /usr/lib/ps/Notice=% RCS: $Header: pscat.pro,v 2.2 87/11/17 16:40:32 byron Rel $save /pscatsave exch def/$pscat 50 dict def $pscat begin/fm [1 0 0 1 0 0] def/xo 0 def /yo 0 def/M /moveto load def/R /show load def./S {exch currentpoint exch pop moveto show}def./T {exch currentpoint pop exch moveto show}def/U {3 1 roll moveto show}def /siz 0 def /font 0 def/Z {/siz exch def SF}def/F {/font exch def SF}def /SF{font 0 ne; {catfonts font 1 sub get fm 0 siz put fm 3 siz neg put  fm makefont setfont}if}defA/BP{save/catsv exch def 0 792 translate 72 432 div dup neg scale xo yo translate 0 0 moveto}def/EP{catsv restore showpage}def*% definitions for PPROC callback functions>% each PPROC is called with the following number on the stack:3% pointsize charcode railmag pswidth pschar x y wid/$pprocs 50 dict def/fractm [.65 0 0 .6 0 0] def % fractions/PS1{gsave $pprocs beginA /wid exch def pop pop pop pop pop /ch exch def /size exch def0 /pair $pprocs ch get def /cf currentfont def cf fractm makefont setfontB 0 .3 size mul 6 mul 2 copy neg rmoveto pair 0 get show rmoveto. currentfont cf setfont (\244) show setfont: pair 1 get show grestore wid .06 div 0 rmoveto end}def $pprocs begin8#34 [(1)(4)] def8#36 [(1)(2)] def8#46 [(3)(4)] defend'% DIThacks fonts for some special chars50 dict dup begin/FontType 3 def/FontName /DIThacks def+/FontMatrix [.001 0.0 0.0 .001 0.0 0.0] def0/FontBBox [-220 -280 900 900] def% a lie but .../Encoding 256 array def&0 1 255{Encoding exch /.notdef put}forEncoding dup 8#040/space put %space dup 8#110/rc put %right ceil! dup 8#111/lt put %left top curl dup 8#112/bv put %bold vert! dup 8#113/lk put %left mid curl! dup 8#114/lb put %left bot curl! dup 8#115/rt put %right top curl! dup 8#116/rk put %right mid curl! dup 8#117/rb put %right bot curl dup 8#120/rf put %right floor dup 8#121/lf put %left floor dup 8#122/lc put %left ceil dup 8#140/sq put %square dup 8#141/bx put %box dup 8#142/ci put %circle dup 8#143/br put %box rule dup 8#144/rn put %root extender dup 8#145/vr put %vertical rule! dup 8#146/ob put %outline bullet dup 8#147/bu put %bullet dup 8#150/ru put %rule dup 8#151/ul put %underline pop/DITfd 100 dict def/BuildChar{0 begin /cc exch def /fd exch def& /charname fd /Encoding get cc get def* /charwid fd /Metrics get charname get def- /charproc fd /CharProcs get charname get def4 charwid 0 fd /FontBBox get aload pop setcachedevice 40 setlinewidth+ newpath 0 0 moveto gsave charproc grestore end}def/BuildChar load 0 DITfd put%/UniqueID 5 def/CharProcs 50 dict defCharProcs begin /space{}def /.notdef{}def/ru{500 0 rls}def/rn{0 750 moveto 500 0 rls}def /vr{20 800 moveto 0 -770 rls}def!/bv{20 800 moveto 0 -1000 rls}def!/br{20 770 moveto 0 -1040 rls}def/ul{0 -250 moveto 500 0 rls}defK/ob{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath stroke}defI/bu{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath fill}def3/sq{80 0 rmoveto currentpoint dround newpath movetoC 640 0 rlineto 0 640 rlineto -640 0 rlineto closepath stroke}def3/bx{80 0 rmoveto currentpoint dround newpath movetoA 640 0 rlineto 0 640 rlineto -640 0 rlineto closepath fill}def6/ci{355 333 rmoveto currentpoint newpath 333 0 360 arc 50 setlinewidth stroke}defL/lt{20 -200 moveto 0 550 rlineto currx 800 2cx s4 add exch s4 a4p stroke}defM/lb{20 800 moveto 0 -550 rlineto currx -200 2cx s4 add exch s4 a4p stroke}defL/rt{20 -200 moveto 0 550 rlineto currx 800 2cx s4 sub exch s4 a4p stroke}defM/rb{20 800 moveto 0 -500 rlineto currx -200 2cx s4 sub exch s4 a4p stroke}def;/lk{20 800 moveto 20 300 -280 300 s4 arcto pop pop 1000 sub currentpoint stroke moveto4 20 300 4 2 roll s4 a4p 20 -200 lineto stroke}def:/rk{20 800 moveto 20 300 320 300 s4 arcto pop pop 1000 sub currentpoint stroke moveto4 20 300 4 2 roll s4 a4p 20 -200 lineto stroke}def./lf{20 800 moveto 0 -1000 rlineto s4 0 rls}def2/rf{20 800 moveto 0 -1000 rlineto s4 neg 0 rls}def./lc{20 -200 moveto 0 1000 rlineto s4 0 rls}def2/rc{20 -200 moveto 0 1000 rlineto s4 neg 0 rls}defend"/Metrics 50 dict def Metrics begin/.notdef 0 def/space 500 def /ru 500 def /br 0 def /lt 250 def /lb 250 def /rt 250 def /rb 250 def /lk 250 def /rk 250 def /rc 250 def /lc 250 def /rf 250 def /lf 250 def /bv 250 def /ob 350 def /bu 350 def /ci 750 def /bx 750 def /sq 750 def /rn 500 def /ul 500 def /vr 0 defend DITfd begin#/s2 500 def /s4 250 def /s3 333 def/a4p{arcto pop pop pop pop}def/2cx{2 copy exch}def/rls{rlineto stroke}def/currx{currentpoint pop}def7/dround{transform round exch round exch itransform} defendend/DIThacks exch definefont pop /catfonts [ /Times-Roman findfont /Times-Italic findfont /Times-Bold findfont /Symbol findfont /Times-Roman findfont /DIThacks findfont ] def %%EndProlog %%Page: ? 1BP1 F60 Z432 222(HCOMPRESS)U797(\()S827(1)S867(\))S 1564(USER)S1737(COMMANDS)S2785(HCOMPRESS)S 3150(\()S3180(1)S 3220(\))S3 F54 Z432 510(NAME)U1 F60 Z648 582(hcompress,)U940(hdecompress,)S1289(fcompress,)S1571(fdecompress)S 1895(\261)S1945(compress)S 2192(and)S2299(decompress)S 2603(images)S3 F54 Z432 681(SYNOPSIS)U60 Z648 753(hcomp)U841(-v)S911(-i)S 968(raw)S6 F1078(e)S3 F 1088(net)S6 F1178(e)S3 F 1188(\256ts)S6 F1274(e)S3 F 1284(hhh)S 1403(-s)S2 F 1466(scale)S3 F 1610(-r)S2 F 1677(rows)S3 F 1813(-c)S2 F1880(columns)S1 F2100([)S2 F2140(data\256le)S1 F2346([)S2 F2386(header\256le)S1 F2652(])S2692(])S3 F 648 951(h)U648 852(hdecomp)U901(-v)S971(-s)S 1034(-o)S 1104(raw)S6 F1214(e)S3 F 1224(net)S6 F1314(e)S3 F 1324(\256ts)S6 F1410(e)S3 F 1420(hhh)S681 951(compress)U941(-s)S2 F 1004(scale)S3 F 1148(-k)S 1221(-r)S2 F1288(\256les)S1 F1390(.)S1415(.)S1440\~ HCOMPRESS.BCKy[HCOMPRESS.DOC]HCOMPRESS.PS;1P]|(.)S1495([)S2 F1535(options)S1 F1737(])S2 F1777(\256les)S1 F1879(.)S1904(.)S1929(.)S3 F 648 1149(h)U648 1050(fcompress)U928(-s)S2 F 991(scale)S3 F 1135(-k)S 1208(-r)S2 F1275(\256les)S1 F1377(.)S1402(.)S1427(.)S1482([)S2 F1522(options)S1 F1724(])S2 F1764(\256les)S1 F1866(.)S1891(.)S1916(.)S3 F681 1149(decompress)U 1001(-s)S 1064(-u)S 1137(-k)S 1210(-r)S 1277(-o)S 1347(raw)S6 F1457(e)S3 F 1467(net)S6 F1557(e)S3 F 1567(\256ts)S6 F1653(e)S3 F 1663(hhh)S2 F1782(\256les)S1 F1884(.)S1909(.)S1934(.)S1989([)S2 F2029(options)S1 F2231(])S2 F2271(\256les)S1 F2373(.)S2398(.)S2423(.)S3 F54 Z 432 1347(D)U60 Z648 1248(fdecompress)U988(-s)S 1051(-u)S 1124(-k)S 1197(-r)S 1264(-o)S 1334(raw)S6 F1444(e)S3 F 1454(net)S6 F1544(e)S3 F 1554(\256ts)S6 F1640(e)S3 F 1650(hhh)S2 F1769(\256les)S1 F1871(.)S1896(.)S1921(.)S1976([)S2 F2016(options)S1 F2218(])S2 F2258(\256les)S1 F2360(.)S2385(.)S2410(.)S3 F54 Z471 1347(ESCRIPTION)U60 Z 648 1419(h)U (compress)R1 F943(is)S 1005(an)S 1084(image)S1254(compression)S1580(package)S1799(written)S 1991(to)S2059(compress)S 2307(the)S 2402(Space)S2567(Telescope)S2833(Science)S3042(Institute)S 3225 1491(,)U 648 1563(w)U648 1491(\(STScI\))U868(Digitized)S 1123(Sky)S 1246(Survey)S1446(images.)S 1682(It)S 1749(is)S1819(well-suited)S 2117(to)S 2194(the)S2298(compression)S 2632(of)S2712(astronomical)S 3054(images)S691 1563(hich)U826(generally)S1082(consist)S 1280(of)S 1361(\257at)S 1468(sky)S1581(sprinkled)S 1835(with)S 1972(point)S2126(sources)S2336(\(stars\))S 2516(and)S 2633(the)S2737(occasional)S3022(extended)S 648 1734(\()U648 1635(source)U825(\(galaxies)S 1063(and)S1170(nebulae\).)S1433(Brie\257y,)S 1635(the)S 1729(method)S 1930(used)S 2060(is:)S668 1734(1\))U864(a)S 915(wavelet)S1127(transform)S 1385(called)S 1554(the)S1652(H-transform)S 1973(\(a)S 2044(Haar)S2185(transform)S2443(generaliz)S 2665(ed)S 2746(to)S 2817(two)S2931(dimensions\),)S 648 1905(\()U864 1806(followed)U 1098(by)S668 1905(2\))U864(quantizat)S 1086(ion)S 1187(that)S1302(discards)S 1523(noise)S 1674(in)S 1745(the)S 1843(image)S 2015(while)S2173(retaining)S 2412(the)S 2510(signal)S 2677(on)S 2760(all)S2844(scales,)S3026(followed)S 648 2076(\()U 864 1977(by)U668 2076(3\))U864(quadtree)S 1092(coding)S 1276(of)S 1346(the)S1440(quantized)S1695(coef\256cients.)S 3210 2175(4)U 648 2247(s)U648 2175(The)U774(technique)S 1041(gives)S 1200(very)S 1339(good)S1490(compression)S 1825(for)S1926(astronomical)S 2269(images)S 2471(and)S 2589(is)S 2660(fast,)S2793(requiring)S 3045(about)S671 2247(econds)U 859(for)S949(compression)S 1273(or)S1343(decompression)S 1724(of)S1794(a)S1841(512x512)S 2071(image)S 2239(on)S2319(a)S 2366(Sun)S2479(SPARCstation)S 2849(1.)S 2934(The)S3048(calcula)S3220(-)S 648 2391(b)U648 2319(tions)U 786(are)S 881(carried)S 1070(out)S 1168(using)S1319(integer)S1507(arithmet)S 1709(ic)S 1773(and)S 1880(are)S1974(entirely)S2179(reversible.)S2472(Consequently,)S 2838(the)S2932(program)S 3156(can)S 678 2391(e)U 729(used)S 863(for)S 957(either)S 1119(lossy)S 1266(or)S1340(lossless)S1547(compression,)S 1890(with)S 2021(no)S2105(special)S2297(approach)S 2542(needed)S 2737(for)S 2831(the)S2929(lossless)S 3136(case)S 648 2607(T)U648 2463(\(e.g.)U 775(there)S916(is)S976(no)S 1056(need)S 1190(for)S1280(a)S 1327(\256le)S 1424(of)S1494(residuals.\))S685 2607(hese)U816(programs)S 1066(can)S1173(compress)S 1423(2-byte)S1600(integer)S 1791(images)S 1985(in)S2055(a)S 2105(small)S2259(variety)S 2450(of)S 2523(input)S2670(formats.)S 2912(The)S3029(resulting)S 3210 2679(y)U 648 2751(F)U648 2679(compressed)U 958(image)S 1131(\256le)S 1233(is)S1298(machine-i)S1540(ndependent)S 1843(and)S 1955(may)S 2084(be)S2166(transferred)S2452(between)S2678(computers)S 2954(with)S 3086(binar)S681 2751(TP.)U 648 2895(T)U(he)R 766(executa)S 951(ble)S1049(programs)S3 F 1300(hcomp)S1 F 1497(and)S3 F1608(hdecomp)S1 F 1865(are)S 1963(the)S 2061(basic)S 2209(tools)S 2349(for)S2442(compression)S 2769(and)S2879(decompression)S 3210 2967(d)U3 F 648 3039(f)U1 F 648 2967(of)U 725(images.)S 958(Users)S 1121(with)S 1255(images)S 1453(in)S 1527(FITS)S 1677(format)S 1865(will)S1986(generally)S 2238(\256nd)S 2358(it)S 2419(easier)S 2587(to)S 2661(use)S 2767(the)S3 F2867(fcompress)S1 F 3153(an)S3 F668 3039(decompress)U1 F989(scripts,)S 1182(while)S 1337(users)S 1480(with)S 1607(images)S 1798(in)S 1865(the)S 1959(IRAF)S 2115(and)S 2222(STSDAS)S2464(hhh/hhd)S 2681(\256le)S2778(formats)S 2982(will)S 3096(prefer)S 648 3183(u)U648 3111(the)U3 F747(hcompress)S1 F 1045(and)S3 F1157(hdecompress)S1 F1515(scripts.)S 1731(\(FITS)S 1898(is)S 1962(the)S2060(Flexible)S 2282(Image)S2457(Transport)S2715(System,)S 2931(which)S 3102(is)S 3166(the)S678 3183(niversal)U899(standard)S 1133(for)S1233(astronomical)S 1575(data.)S 1740(IRAF)S 1905(is)S1974(a)S 2030(widely)S 2223(used)S2362(astronomical)S 2703(data)S2833(analysis)S3056(system;)S 648 3327(u)U648 3255(STSDAS)U896(is)S962(a)S1015(package)S 1238(of)S 1313(IRAF)S 1474(tasks)S1619(designed)S 1858(for)S 1953(Hubble)S 2155(Space)S2324(Telescope)S2594(data.\))S 2755(Those)S 2927(who)S 3055(wish)S 3193(to)S 678 3327(se)U 754(this)S867(compression)S1197(software)S 1430(for)S1526(non-astronomical)S 1974(images)S 2171(will)S2290(probably)S 2529(\256nd)S 2647(these)S2796(scripts)S2978(inadequate)S 648 3471(m)U648 3399(and)U 758(are)S855(encouraged)S 1156(to)S 1226(create)S 1394(their)S 1528(own)S1654(scripts)S 1834(using)S 1987(these)S 2134(as)S2207(a)S 2257(model.)S 2466(It)S 2526(also)S 2646(would)S 2819(be)S 2899(rather)S 3063(easy)S 3193(to)S695 3471(odify)U 842(the)S 936(source)S 1113(code)S 1247(so)S 1320(that)S 1431(8-bit)S 1565(images)S 1756(can)S 1860(be)S 1937(used)S 2067(as)S 2137(input.)S 3213 3615(e)U3 F 648 3687(m)U1 F 648 3615(In)U 727(Unix)S 876(these)S1029(programs)S 1285(and)S1401(scripts)S 1587(can)S 1700(be)S1786(installed)S 2019(in)S 2094(some)S2249(directory)S 2495(found)S 2663(in)S 2738(your)S 2876(path)S 3008(using)S 3166(th)S3 F698 3687(ake)U 808(install)S1 F985(command.)S 1278(In)S 1348(VMS)S 1497(it)S 1551(is)S1611(necessary)S 1865(to)S1932(de\256ne)S2099(symbols)S2319(pointing)S 2540(to)S 2607(the)S2701(directory)S 2939(and)S 3046(the)S 3140(pro-)S 648 3903(T)U648 3759(grams)U815(by)S895(executing)S 1150(the)S5 F1244(@)S3 F (hcompinit)R1 F1579(command)S1837(\256le.)S 685 3903(o)U735(compress)S982(a)S 1029(2-byte)S1203(integer)S 1391(image)S 1559(in)S 1626(FITS)S1769(format,)S 648 4191(p)U3 F864 4047(fcompress)U 1144(-s)S2 F 1207(scale)S1 F1351(image.\256ts)S678 4191(roduces)U888(an)S 968(output)S 1145(\256le)S 1245(named)S1429(image.\256ts.H)S 1746(\(or)S1839(image.\256ts)S6 F(i)R1 F(H)R 2170(in)S 2239(VMS\))S 2410(with)S 2539(the)S2635(compressed)S 2941(image.)S 3146(The)S 432 4551(S)U648 4263(input)U 792(\256le)S889(image.\256ts)S 1145(is)S 1205(not)S1302(removed)S 1533(unless)S 1703(the)S3 F 1797(-r)S1 F 1864(option)S 2038(is)S2098(speci\256ed.)S 2367(To)S2454(decompress)S 2758(this)S 2865(image,)S 465 4551(un)U 545(Release)S 753(4.1)S 1496(Last)S1620(change:)S 1828(20)S 1908(April)S 2055(1992)S3210(1)SEP %%Page: ? 2BP1 F60 Z 3220 222(\))U432(HCOMPRESS)S797(\()S827(1)S867(\))S 1564(USER)S1737(COMMANDS)S2785(HCOMPRESS)S 3150(\()S3180(1)S3 F864 510(fdecompress)U1 F1204(image.\256ts.H)S 1615 654(.)U 648 798(T)U648 654(will)U 762(create)S927(a)S 974(FITS)S 1117(\256le)S 1214(called)S1379(image.\256ts)S 685 798(he)U3 F767(-s)S2 F 835(scale)S1 F 984(option)S1163(determine)S1405(s)S 1453(the)S 1552(amount)S 1758(of)S1833(compression.)S2 F 2196(Scale)S1 F2351(=)S2408(0)S 2462(or)S2536(1)S 2590(leads)S 2738(to)S2809(lossless)S3016(compres-)S 648 942(t)U648 870(sion,)U 785(i.e.)S 881(the)S977(decompressed)S 1340(image)S 1510(has)S1612(exactly)S 1809(the)S 1905(same)S 2051(pixel)S 2194(values)S 2370(as)S 2442(the)S2537(original)S 2746(image.)S 2950(If)S2 F 3011(scale)S4 F3156(>)S1 F3210(1)S 665 942(hen)U 780(the)S882(compression)S 1214(is)S 1282(lossy:)S 1450(the)S1552(decompressed)S 1921(image)S 2096(will)S2 F 2217(not)S1 F 2321(be)S2405(exactly)S 2607(the)S 2708(same)S 2859(as)S 2936(the)S3037(original.)S 648 1086(g)U648 1014(For)U753(astronomical)S1087(images,)S1295(lossless)S1500(compression)S 1826(is)S1888(generally)S 2135(rather)S2298(ineffecti)S 2500(ve)S2579(because)S 2791(the)S 2886(images)S 3078(have)S3213(a)S678 1086(ood)U 796(deal)S925(of)S 1003(noise,)S 1173(which)S 1348(is)S1416(inherently)S1689(incompressible.)S2117(However,)S 2379(if)S 2443(some)S 2597(of)S 2674(this)S 2788(noise)S 2942(is)S3009(discarded)S 3225 1158(.)U 648 1230(W)U648 1158(then)U 776(the)S 874(images)S1069(compress)S 1320(very)S 1450(well.)S 1612(The)S2 F 1729(scale)S1 F 1876(factor)S2040(determine)S2282(s)S 2328(how)S 2454(much)S 2611(of)S 2684(the)S 2781(noise)S 2931(is)S2994(discarded)S 705 1230(e)U 761(have)S 904(found)S 1073(that)S1193(setting)S2 F 1383(scale)S1 F 1536(to)S1612(2)S 1671(times)S 1831(sigma,)S 2019(the)S 2122(RMS)S 2277(noise)S 2433(in)S 2509(the)S 2612(image,)S2804(usually)S3007(results)S 3193(in)S 3213 1302(e)U 648 1374(p)U648 1302(compression)U980(by)S 1068(about)S1230(a)S 1285(factor)S 1454(of)S 1532(10)S 1620(\(i.e.)S 1742(the)S1844(compressed)S 2156(image)S2332(requires)S 2554(about)S 2716(1.5)S2819(bits/pixel\),)S 3106(whil)S678 1374(roducing)U919(a)S973(decompressed)S 1341(image)S 1516(that)S 1633(is)S 1699(nearly)S1876(indistinguishable)S 2314(from)S 2457(the)S2557(original.)S 2806(In)S 2882(fact,)S 3014(the)S 3114(RMS)S 3220 1446(r)U 648 1518(e)U648 1446(difference)U 916(between)S 1140(the)S1237(decompressed)S 1601(image)S 1772(and)S 1882(the)S1979(original)S 2190(image)S 2361(will)S 2478(be)S 2558(only)S 2688(about)S 2845(1/2)S 2945(sigma.)S 3147(Ou)S675 1518(xperiments)U969(indicate)S 1186(that)S 1302(this)S 1414(level)S 1557(of)S 1632(loss)S 1750(has)S 1855(no)S1940(noticeabl)S2162(e)S 2214(effect)S 2377(on)S 2462(either)S 2625(the)S 2724(visual)S2893(appearanc)S3138(e)S 3190(of)S 3220 1590(f)U 648 1662(s)U648 1590(the)U 746(image)S918(or)S992(on)S1076(quantitat)S 1288(ive)S1386(analysis)S 1604(of)S 1678(the)S 1776(image)S 1948(\(e.g.)S2079(measureme)S 2354(nts)S 2447(of)S2520(positions)S 2760(and)S2870(brightnesses)S3190(o)S671 1662(tars)U 778(are)S 872(not)S969(adversely)S1220(affecte)S 1385(d.\))S 648 1761(U)U(sing)R812(a)S 860(larger)S 1022(value)S 1174(for)S2 F 1265(scale)S1 F1409(results)S 1586(in)S 1653(higher)S1827(compression)S 2151(at)S 2215(the)S 2309(cost)S 2426(of)S 2496(larger)S2657(difference)S2902(s)S2945(between)S 3166(the)S 3213 1833(e)U 648 1905(w)U648 1833(compressed)U 953(and)S1061(original)S1270(images.)S1497(A)S 1561(rough)S 1722(rule)S 1837(of)S 1908(thumb)S 2083(is)S 2144(that)S 2256(if)S2 F 2314(scale)S1 F 2458(equals)S2632(N)S 2695(sigma,)S 2874(then)S 2998(the)S 3092(imag)S691 1905(ill)U764(compress)S 1013(to)S 1082(about)S 1238(3/N)S1350(bits/pixel,)S 1611(and)S 1719(the)S 1814(RMS)S1961(difference)S2227(between)S 2449(the)S2544(original)S 2753(and)S 2861(the)S2956(compressed)S 3210 1977(n)U 648 2049(r)U648 1977(image)U 822(will)S942(be)S 1025(about)S 1185(N/4)S 1301(sigma.)S 1505(This)S 1637(crude)S1796(relationship)S 2106(is)S2171(inaccura)S 2376(te)S 2445(both)S 2577(for)S 2672(very)S 2804(high)S2936(compressio)S668 2049(atios)U 812(and)S 929(for)S1028(lossless)S1240(compression,)S 1588(but)S 1694(it)S 1757(does)S 1896(at)S 1969(least)S 2109(give)S 2242(an)S2328(indicati)S 2510(on)S 2599(of)S 2678(what)S 2824(to)S 2900(expect)S 3087(of)S 3166(the)S 648 2265(F)U648 2121(compressed)U 952(images.)S 681 2265(or)U 756(images)S952(in)S 1024(which)S 1196(the)S 1295(noise)S 1447(varies)S 1616(from)S 1758(pixel)S 1904(to)S 1976(pixel)S 2122(\(e.g.)S 2254(CCD)S2402(images,)S 2613(where)S 2785(the)S 2884(noise)S 3035(is)S 3099(larger)S 648 2409(r)U648 2337(for)U745(brighter)S963(pixels\),)S 1169(the)S1270(appropriate)S 1572(value)S 1730(for)S2 F 1827(scale)S1 F 1978(is)S2045(determine)S2287(d)S 2344(by)S 2431(the)S 2532(RMS)S 2685(noise)S 2839(level)S 2984(in)S 3057(the)S 3157(sky)S668 2409(egions)U854(of)S 933(the)S 1036(image.)S 1248(For)S 1360(images)S 1560(that)S 1680(are)S1782(essentially)S2065(noiseless,)S 2325(any)S 2440(lossy)S2591(compression)S 2923(is)S2991(noticeabl)S3213(e)S 3223 2481(l)U 648 2553(a)U648 2481(under)U815(suf\256ciently)S 1116(close)S1270(inspection)S 1548(of)S 1628(the)S 1732(image,)S 1925(but)S 2032(some)S 2189(loss)S 2312(is)S2381(nonetheless)S 2691(accept)S 2846(able)S 2976(for)S 3075(typica)S675 2553(pplicati)U 857(ons.)S 997(Note)S 1136(that)S 1249(the)S1345(quantizat)S 1567(ion)S 1666(scheme)S 1869(used)S 2001(in)S3 F2070(hcompress)S1 F 2365(is)S2 F 2427(not)S1 F2526(designed)S 2762(to)S 2831(give)S 2957(images)S 3149(that)S 648 2697(t)U648 2625(appear)U831(as)S 902(much)S 1057(like)S 1169(the)S1264(original)S 1473(as)S1544(possible)S 1762(to)S 1830(the)S 1925(human)S 2110(eye,)S 2230(but)S 2328(rather)S 2490(is)S2551(designed)S 2786(to)S2854(produce)S 3069(images)S665 2697(hat)U 761(are)S857(as)S 929(similar)S 1119(as)S1191(possible)S 1410(to)S 1479(the)S1575(original)S 1785(under)S1944(quantitat)S 2156(ive)S2252(analysis.)S 2503(Thus,)S 2660(our)S2762(emphasis)S 3008(is)S 3069(on)S 3150(dis-)S 648 2841(n)U648 2769(carding)U 855(noise)S1008(without)S1218(affecting)S 1459(the)S 1559(signal)S 1729(rather)S 1896(than)S 2026(on)S2111(discarding)S2387(components)S 2703(of)S 2778(the)S 2877(image)S 3050(that)S 3166(are)S 678 2841(ot)U 753(very)S888(noticeabl)S1110(e)S 1165(to)S 1240(the)S 1342(eye)S 1454(\(as)S 1552(may)S 1684(be)S 1769(done,)S 1928(for)S2025(example,)S 2272(by)S 2359(JPEG)S2522(compression.\))S 2908(The)S3029(resulting)S 3210 2913(d)U 648 2985(m)U648 2913(compression)U 984(scheme)S 1197(is)S 1269(not)S 1378(ideal)S 1528(for)S1630(typical)S1827(terrestrial)S 2091(images)S2294(\(though)S 2512(it)S 2577(is)S 2648(still)S2770(a)S2828(reasonably)S 3120(goo)S695 2985(ethod)U 849(for)S 939(those)S1086(images\),)S 1312(but)S 1409(we)S1499(believe)S 1694(it)S 1748(is)S 1808(close)S 1952(to)S2019(optimal)S 2224(for)S2314(astronomical)S2646(images.)S3 F54 Z432 3156(OPTIONS)U60 Z648 3228(hcomp)U841(-v)S911(-i)S 968(raw)S6 F1078(e)S3 F 1088(net)S6 F1178(e)S3 F 1188(\256ts)S6 F1274(e)S3 F 1284(hhh)S 1403(-s)S2 F 1466(scale)S3 F 1610(-r)S2 F 1677(rows)S3 F 1813(-c)S2 F1880(columns)S1 F2100([)S2 F2140(data\256le)S1 F2346([)S2 F2386(header\256le)S1 F2652(])S2692(])S 3213 3327(a)U 648 3399(c)U3 F648 3327(hcomp)U1 F 841(reads)S988(an)S 1065(image)S 1233(from)S 1370(the)S1464(standard)S 1688(input)S 1832(\(or)S 1922(from)S2 F2059(data\256le)S1 F 2260(and)S2 F2367(header\256le)S1 F 2628(if)S2685(speci\256ed\))S 2939(and)S 3046(writes)S675 3399(ompressed)U 952(image)S 1120(to)S 1187(the)S1281(standard)S1505(output.)S3 F 864 3498(-)U(v)R1 F1080(Verbose.)S1317(A)S1382(description)S 1672(of)S 1743(the)S 1838(input)S 1983(\256le)S 2081(and)S 2189(the)S2284(compression)S2609(achieve)S2794(d)S 2845(is)S2906(written)S 3098(to)S 3166(the)S3 F 864 3669(-)U1 F1080 3570(standard)U 1304(error)S1441(output.)S3 F 884 3669(i)U 921(raw)S6 F1031(e)S3 F 1041(net)S6 F1131(e)S3 F 1141(\256ts)S6 F1227(e)S3 F 1237(hhh)S1 F 1080 3741(I)U(nput)R1227(format.)S1423(Choices)S 1637(are:)S3 F 1080 3840(r)U(aw)R1 F 1296(Pixel)S 1445(values)S 1623(have)S1761(2)S 1815(bytes)S 1966(in)S2037(machine-de)S2319(pendent)S 2534(order,)S 2700(i.e.)S 2798(no)S 2882(byte)S3010(swapping)S3 F 1080 4011(n)U1 F1296 3912(is)U 1356(done)S 1493(on)S 1573(input.)S 1752(This)S 1879(is)S 1939(the)S2033(default)S 2221(format)S 2402(if)S 2459(none)S 2596(is)S2656(speci\256ed.)S3 F1113 4011(et)U1 F 1296(Pixel)S 1447(values)S 1628(have)S1768(2)S 1824(bytes)S 1977(in)S5 F2050(")S1 F (network)R5 F(")R1 F 2323(order:)S 2493(high)S 2626(byte)S2756(\256rst,)S 2890(then)S 3020(low)S 3136(byte)S 3217 4083(s)U 1296 4155(t)U1296 4083(for)U 1391(each)S 1527(pixel.)S1708(Byte-swapping)S 2097(is)S 2162(done)S 2304(on)S 2389(input)S 2538(if)S2600(needed.)S 2831(Note)S 2973(that)S 3089(this)S3200(i)S1313 4155(he)U 1392(same)S 1538(as)S 1610(raw)S 1722(format)S 1905(on)S 1987(some)S2136(machines)S 2386(\(e.g.)S 2515(Suns\))S 2673(but)S 2772(is)S2833(different)S 3062(on)S 3143(oth-)S 1296 4299(a)U1296 4227(ers)U 1388(\(e.g.)S1517(VAXes\).)S 1773(Files)S 1911(in)S 1979(net)S 2074(format)S 2256(can)S 2361(be)S2439(transferred)S 2721(from)S 2859(one)S2967(machine)S 3193(to)S1323 4299(nother)U1497(without)S1701(modi\256cation,)S 2041(but)S2138(\256les)S 2258(in)S 2325(raw)S 2435(format)S2616(cannot.)S 3210 4587(2)U 432(Sun)S 545(Release)S 753(4.1)S 1496(Last)S1620(change:)S 1828(20)S 1908(April)S 2055(1992)SEP %%Page: ? 3BP1 F60 Z 432 222(H)U (COMPRESS)R797(\()S827(1)S867(\))S 1564(USER)S1737(COMMANDS)S2785(HCOMPRESS)S 3150(\()S3180(1)S 3220(\))S3 F1080 510(\256ts)U1 F 1296(FITS)S1445(\(Flexible)S 1689(Image)S1866(Transport)S2125(System\))S 2347(format)S 2533(image.)S 2741(Header)S 2940(gives)S 3092(image)S1296 582(size.)U 1451(Bytes)S 1614(are)S 1714(in)S1787(network)S 2010(order.)S 2197(FITS)S 2345(format)S 2531(is)S 2596(the)S2695(universal)S2941(standard)S 3170(for)S3 F 1080 753(h)U1 F1296 654(transport)U 1530(of)S1600(astronomical)S1932(images.)S3 F 1113 753(hh)U1 F1296(FITS-type)S 1567(header)S 1752(\(but)S1873(without)S2080(padding)S 2297(lines)S 2434(making)S 2638(header)S2822(multiple)S 3047(of)S 3120(2880)S 3220 825(-)U 1296 897(d)U1296 825(bytes\))U 1465(in)S1534(a)S 1583(\256le)S 1682(named)S2 F1865(rootname.xxh)S1 F2199(,)S 2236(with)S 2365(the)S 2461(pixel)S 2604(values)S2779(\(bytes)S 2947(in)S3015(machine)S1326 897(ependent)U1570(order\))S 1743(in)S1816(a)S1869(different)S 2103(\256le)S 2206(named)S2 F2393(rootname.xxd)S1 F2727(.)S 2788(No)S2886(byte-swapping)S3 F 864 1068(-)U1 F 1296 969(is)U 1356(done)S 1493(on)S 1573(input.)S3 F 884 1068(s)U2 F 947(scale)S1 F 1100(Scale)S1271(factor.)S1487(Non-negative)S1855(integer)S 2063(that)S2194(determine)S2436(s)S 2499(the)S 2612(amount)S 2832(of)S2921(compression.)S2 F 1080 1212(s)U1 F1080 1140(Default)U 1289(is)S2 F 1357(scale)S1 F1509(=)S 1569(1024,)S 1731(which)S 1905(could)S 2066(be)S 2150(wildly)S2331(inappropriate)S 2680(for)S 2777(your)S2914(images.)S 3147(Use)S2 F1103 1212(cale)U1 F1224(=)S1277(0)S 1327(for)S1417(lossless)S1620(compression.)S 1979(See)S 2086(the)S2180(discussion)S 2450(above)S 2614(for)S 2704(more)S2848(information.)S 3210 1311(n)U3 F864(-r)S1 F1080(Pixels/row.)S 1393(This)S 1521(is)S 1581(the)S1675(quickly)S1876(varying)S2080(dimension)S 2351(in)S 2418(the)S2512(\256le,)S 2624(i.e.)S 2718(the)S 2812(order)S 2959(of)S 3029(pixels)S3193(i)S1080 1383(the)U 1176(\256le)S 1275(is)S 1337(all)S 1420(pixels)S 1586(from)S1725(\256rst)S 1840(row,)S 1970(all)S 2053(pixels)S 2219(from)S 2357(second)S 2545(row,)S 2674(etc.)S 2801(Note)S 2939(that)S 3051(the)S 3146(size)S3 F 1080 1527(h)U1 F1080 1455(of)U 1155(the)S 1254(image)S 1427(can)S 1536(be)S1618(speci\256ed)S 1857(this)S 1968(way)S 2092(only)S 2223(for)S3 F 2317(raw)S1 F 2441(and)S3 F 2552(net)S1 F 2656(format)S2841(images;)S3 F 3053(\256ts)S1 F 3153(and)S3 F1113 1527(hh)U1 F 1207(format)S 1396(images)S1595(include)S1801(a)S 1855(header)S 2043(giving)S 2224(the)S 2325(size)S 2446(of)S 2523(the)S 2624(image.)S2834(Default)S 3042(value)S 3200(is)S3 F 864 1698(-)U1 F1080 1599(256.)U3 F 884 1698(c)U1 F1080(Pixels/column.)S 1480(This)S 1607(is)S 1667(the)S 1761(slowly)S1941(varying)S2145(dimension)S 2416(in)S 2483(the)S2577(\256le.)S2709(Default)S 2910(value)S 3061(is)S 3121(256.)S2 F 864 1896(h)U864 1797(data\256le)U1 F 1080(Input)S 1227(data)S1348(\256le.)S 1480(If)S 1540(not)S1637(speci\256ed)S 1871(the)S 1965(input)S 2109(is)S 2169(read)S 2293(from)S 2430(stdin.)S2 F894 1896(eader\256le)U1 F1080 1968(Input)U 1229(header)S1412(\256le.)S 1546(This)S 1675(is)S 1737(only)S1866(speci\256ed)S 2102(for)S 2194(format)S3 F 2377(hhh)S1 F(,)R 2513(in)S 2582(which)S 2751(the)S 2847(header)S 3030(and)S 3139(data)S 1080 2112(s)U1080 2040(are)U 1180(in)S1253(separate)S1477(\256les.)S 1638(It)S 1701(is)S 1767(also)S1890(possible)S 2113(to)S2186(concate)S 2371(nate)S 2498(the)S 2597(header)S 2783(and)S 2895(data)S3021(\256les)S 3146(into)S1103 2112(tdin)U 1217(for)S3 F 1307(hhh)S1 F 1426(format)S1607(images.)S3 F 648 2310(h)U648 2211(hdecomp)U901(-v)S971(-s)S 1034(-o)S 1104(raw)S6 F1214(e)S3 F 1224(net)S6 F1314(e)S3 F 1324(\256ts)S6 F1410(e)S3 F 1420(hhh)S681 2310(decomp)U1 F 907(reads)S1060(a)S1113(compressed)S 1423(image)S 1597(from)S 1740(the)S1840(standard)S 2070(input)S 2219(and)S 2331(writes)S2503(a)S2555(decompressed)S 2921(image)S 3094(to)S 3166(the)S648 2382(standard)U 872(output.)S3 F 864 2481(-v)U1 F1080(Verbose.)S1315(A)S1378(description)S 1666(of)S 1736(the)S 1830(output)S 2004(\256le)S 2101(is)S2161(written)S 2352(to)S 2419(the)S2513(standard)S 2737(error)S2874(output.)S 3220 2580(r)U3 F864(-s)S1 F1080(Smoothing)S1379(\257ag.)S 1539(At)S 1634(high)S1776(compressions)S 2138(the)S2247(decompressed)S 2623(image)S 2806(begins)S 2998(to)S 3079(appea)S1080 2652(blocky)U1283(because)S 1513(of)S 1602(the)S 1714(way)S1852(information)S 2175(is)S2253(discarded.)S 2557(This)S2702(blockiness)S 2994(is)S3072(greatly)S 3220 2724(-)U 1080 2796(s)U1080 2724(reduced,)U1308(producing)S 1574(more)S1720(pleasing)S1943(images,)S 2151(if)S 2210(the)S3 F 2306(-s)S1 F 2371(\257ag)S 2483(is)S2545(speci\256ed)S 2781(during)S2959(decompres)S1103 2796(ion.)U1235(Default)S 1436(is)S 1496(no)S1576(smoothing.)S3 F 864 2895(-o)U 934(raw)S6 F1044(e)S3 F 1054(net)S6 F1144(e)S3 F 1154(\256ts)S6 F1240(e)S3 F 1250(hhh)S1 F1080 2967(Output)U1271(format.)S1491(Default)S 1695(is)S3 F 1758(\256ts)S1 F 1857(for)S 1950(input)S2097(\256les)S 2220(that)S 2334(were)S 2474(in)S 2544(FITS)S 2690(format)S 2874(and)S 2984(is)S3 F 3047(raw)S1 F 3170(for)S3 F 3220 3039(t)U1 F 1080 3111(f)U1080 3039(other)U 1226(input)S 1372(\256le)S1471(formats.)S 1712(Note)S 1851(that)S 1964(this)S 2073(means)S 2249(that)S 2362(an)S 2441(image)S 2610(that)S 2722(was)S2836(originally)S 3092(in)S3 F 3160(ne)S1 F1100 3111(ormat)U 1266(is)S 1331(not,)S 1448(by)S1533(default,)S1741(decompressed)S 2107(to)S 2179(the)S 2278(same)S2427(format.)S 2648(Other)S 2810(input)S2958(formats)S 3166(are)S3 F 648 3282(h)U1 F1080 3183(properly)U1304(decompressed)S 1665(to)S 1732(the)S 1826(same)S 1970(format)S 2151(on)S2231(output.)S3 F681 3282(compress)U941(-s)S2 F 1004(scale)S3 F 1148(-k)S 1221(-r)S2 F1288(\256les)S1 F1390(.)S1415(.)S1440(.)S1495([)S2 F1535(options)S1 F1737(])S2 F1777(\256les)S1 F1879(.)S1904(.)S1929(.)S 2241 3381(.)U3 F648(hcompress)S1 F941(compresses)S 1238(one)S 1345(or)S 1415(more)S 1559(images)S 1750(in)S3 F 1817(hhh)S1 F 1936(input)S 2080(format)S3 F 864 3480(-s)U2 F 933(scale)S1 F 1086(Scale)S1243(factor.)S1445(Default)S 1652(in)S 1725(script)S 1885(is)S 1951(666.)S 2102(Note)S 2245(that)S 2362(this)S 2474(is)S2539(different)S 2772(than)S 2901(the)S3000(default)S 3193(in)S 3213 3552(e)U 1080 3624(d)U3 F1080 3552(hcomp)U1 F(.)R 1315(You)S 1445(can)S 1556(modify)S 1757(the)S 1858(script)S 2019(to)S 2093(insert)S2254(a)S2308(typical)S 2500(value)S 2658(for)S 2755(your)S 2892(images)S 3090(as)S 3166(th)S1110 3624(efault.)U3 F 864 3723(-)U(k)R1 F 1080(Keep)S1227(original)S1435(\256les)S 1555(after)S1686(compression)S2010(\(default\).)S 3213 3822(e)U3 F864(-r)S1 F 1080(Remove)S1313(original)S1533(\256les)S 1665(after)S1808(compression.)S 2179(Only)S 2331(the)S 2437(data)S 2569(\256le)S2677(\(hhd\))S 2838(is)S2909(removed,)S 3166(th)S1080 3894(header)U 1261(\256le)S 1358(is)S1418(retained)S 1633(in)S 1700(any)S 1807(case.)S2 F864 3993(\256)U(les)R1 F966(.)S991(.)S1016(.)S 1080(One)S 1211(or)S 1292(more)S1447(hhh/hhd)S 1675(format)S 1867(images)S 2069(to)S2147(compress.)S 2440(Wild)S 2592(cards)S 2750(may)S 2884(be)S 2971(used.)S 3146(The)S 1080 4137(m)U1080 4065(names)U 1260(of)S 1336(the)S 1436(data)S1563(\256les)S 1689(\(not)S 1812(the)S 1912(header)S2099(\256les\))S 2245(should)S 2430(be)S2512(speci\256ed.)S 2786(Note)S 2928(that)S 3044(one)S 3156(can)S1127 4137(ix)U1199(options)S 1401(and)S 1512(\256le)S 1613(names;)S1808(options)S 2009(apply)S 2167(only)S 2298(to)S2369(\256les)S 2493(that)S 2608(follow)S 2789(them)S 2934(on)S 3018(the)S 3116(com-)S 1080 4281(u)U1080 4209(mand)U 1235(line.)S 1382(For)S1486(example,)S 1727(the)S1822(removal)S 2041(of)S 2112(the)S2207(original)S 2416(images)S 2608(may)S 2732(be)S 2809(turned)S 2983(on)S 3063(and)S 3170(off)S1110 4281(sing)U 1234(the)S3 F 1332(-r)S1 F 1403(and)S3 F 1514(-k)S1 F1591(\257ags.)S 1763(If)S2 F1827(in\256le.xxd)S1 F 2071(is)S 2135(the)S 2233(name)S 2388(of)S 2462(an)S2543(original)S 2755(image)S 2927(data)S3051(\256le,)S 3166(the)S432 4569(Sun)U 545(Release)S 753(4.1)S 1496(Last)S1620(change:)S 1828(20)S 1908(April)S 2055(1992)S3210(3)SEP %%Page: ? 4BP1 F60 Z 432 222(H)U (COMPRESS)R797(\()S827(1)S867(\))S 1564(USER)S1737(COMMANDS)S2785(HCOMPRESS)S 3150(\()S3180(1)S 3220(\))S3 F 648 609(f)U1 F1080 510(resulting)U1311(compressed)S 1615(image)S 1783(is)S 1843(in)S1910(a)S 1957(\256le)S 2054(named)S2 F2235(in\256le.xxd)S3 F 2460(.H)S1 F 2542(\(or)S2 F2632(in\256le.xxd)S6 F2857(i)S3 F(H)R1 F 2954(in)S 3021(VMS.\))S3 F668 609(compress)U928(-s)S2 F 991(scale)S3 F 1135(-k)S 1208(-r)S2 F1275(\256les)S1 F1377(.)S1402(.)S1427(.)S1482([)S2 F1522(options)S1 F1724(])S2 F1764(\256les)S1 F1866(.)S1891(.)S1916(.)S 2205 708(.)U3 F648(fcompress)S1 F928(compresses)S 1225(one)S 1332(or)S 1402(more)S 1546(images)S 1737(in)S3 F 1804(\256ts)S1 F 1900(input)S 2044(format)S3 F 864 807(-s)U2 F 927(scale)S1 F 1080(Scale)S1231(factor.)S 1427(As)S 1513(for)S3 F1603(hcompress)S1 F(,)R 1911(the)S 2005(script)S2159(default)S 2347(value)S 2498(is)S 2558(666.)S3 F 864 1005(-)U 864 906(-k)U1 F 1080(Keep)S1227(original)S1435(\256les)S 1555(after)S1686(compression)S2010(\(default\).)S3 F 884 1005(r)U1 F 1080(Remove)S1301(original)S1509(\256les)S 1629(after)S1760(compression.)S 3207 1104(S)U2 F 864(\256les)S1 F966(.)S991(.)S1016(.)S 1080(One)S 1203(or)S 1276(more)S 1423(FITS)S 1569(format)S 1753(images)S 1947(to)S2017(compress.)S 2302(If)S2 F2365(in\256le)S1 F 2509(is)S 2571(the)S 2667(name)S 2820(of)S 2892(an)S 2971(input)S 3117(FIT)S1080 1176(\256le,)U 1200(then)S 1332(the)S1434(resulting)S1673(compressed)S 1985(image)S 2161(is)S 2229(in)S2304(a)S 2359(\256le)S 2463(named)S2 F2651(in\256le)S3 F 2777(.H)S1 F 2866(\(or)S2 F2963(in\256le)S6 F3089(i)S3 F(H)R1 F 3193(in)S3 F 648 1347(h)U1 F1080 1248(VMS.\))U3 F681 1347(decompress)U 1001(-u)S 1074(-s)S 1137(-k)S 1210(-r)S 1277(-o)S 1347(raw)S6 F1457(e)S3 F 1467(net)S6 F1557(e)S3 F 1567(\256ts)S6 F1653(e)S3 F 1663(hhh)S2 F1782(\256les)S1 F1884(.)S1909(.)S1934(.)S1989([)S2 F2029(options)S1 F2231(])S2 F2271(\256les)S1 F2373(.)S2398(.)S2423(.)S 648 1545(T)U3 F648 1446(fdecompress)U988(-u)S 1061(-s)S 1124(-k)S 1197(-r)S 1264(-o)S 1334(raw)S6 F1444(e)S3 F 1454(net)S6 F1544(e)S3 F 1554(\256ts)S6 F1640(e)S3 F 1650(hhh)S2 F1769(\256les)S1 F1871(.)S1896(.)S1921(.)S1976([)S2 F2016(options)S1 F2218(])S2 F2258(\256les)S1 F2360(.)S2385(.)S2410(.)S685 1545(hese)U817(programs)S1069(decompress)S 1378(one)S 1490(or)S;)~ HCOMPRESS.BCKy[HCOMPRESS.DOC]HCOMPRESS.PS;1P] L 1565(more)S1714(compressed)S 2023(image)S2195(\256les.)S3 F2354(hdecompress)S1 F 2711(and)S3 F2822(fdecompress)S1 F 3166(are)S 3220 1617(-)U 648 1689(s)U648 1617(actuall)U810(y)S 862(the)S 958(same)S1104(program;)S 1347(the)S 1443(two)S1555(different)S 1784(names)S 1959(are)S2054(provided)S 2289(for)S2380(consistency)S 2682(with)S 2810(the)S 2905(two)S3016(compres)S671 1689(ion)U768(programs,)S3 F1030(hcompress)S1 F 1323(and)S3 F1430(fcompress)S1 F(.)R 1766 1788(.)U3 F 864 1887(-)U 864 1788(-u)U1 F1080(Disable)S1284(smoothing)S1558(\(default\))S3 F 884 1887(s)U1 F 1080(Enable)S1268(smoothing.)S3 F 864 1986(-)U(k)R1 F 1080(Keep)S1227(compressed)S 1531(image)S 1699(\256le)S 1796(after)S1927(decompression)S2308(\(default\).)S3 F 864 2184(-)U 864 2085(-r)U1 F 1080(Remove)S1301(compressed)S 1605(image)S 1773(\256le)S 1870(after)S2001(decompression.)S3 F 884 2184(o)U 934(raw)S6 F1044(e)S3 F 1054(net)S6 F1144(e)S3 F 1154(\256ts)S6 F1240(e)S3 F 1250(hhh)S1 F 1080 2256(O)U(utput)R1274(format.)S1497(Default)S 1705(is)S3 F 1772(\256ts)S1 F 1874(for)S1970(\256les)S2096(originally)S 2357(in)S 2430(FITS)S2579(format,)S 2781(and)S3 F 2894(raw)S1 F 3020(for)S 3116(other)S2 F864 2427(\256)U1 F1080 2328(\256les.)U 1235(Note)S 1372(that)S3 F 1483(raw)S1 F 1603(format)S 1784(output)S 1958(is)S2018(correct)S 2206(for)S3 F 2296(hhh)S1 F 2415(format)S 2596(data)S2717(\256les.)S2 F894 2427(les)U1 F966(.)S991(.)S1016(.)S 1080(Names)S 1268(of)S1339(\256les)S 1460(to)S1528(decompress.)S 1868(The)S3 F 1983(.H)S1 F2066(extension)S 2318(is)S 2379(added)S 2543(to)S 2610(the)S 2704(end)S 2811(of)S 2881(the)S2975(\256lename)S 3203(if)S 1080 2571(o)U1080 2499(it)U 1136(is)S 1198(not)S1297(explicit)S 1479(ly)S1548(speci\256ed.)S 1819(\(In)S 1910(VMS)S 2060(the)S2155(\256lenames)S 2407(must)S2545(already)S 2744(have)S6 F2879(i)S3 F(H)R1 F 2977(on)S 3058(the)S 3153(end)S 1110 2571(f)U 1151(the)S 1246(\256le)S1344(extension.\))S 1631(For)S 1735(an)S 1813(input)S1958(compressed)S 2263(image)S 2432(in)S2 F2500(in\256le)S3 F 2626(.H)S1 F 2709(\(or)S2 F2800(in\256le)S6 F2926(i)S3 F(H)R1 F 3024(in)S 3091(VMS\))S3 F54 Z432 2742(BUGS)U1 F60 Z1080 2643(the)U 1174(output)S1348(decompressed)S 1709(image)S 1877(is)S 1937(in)S2 F2004(in\256le)S1 F2130(.)S648 2814(Current)U 855(input)S1002(formats)S1209(include)S 1410(only)S 1540(16)S 1623(bit,)S1725(2-dimensional)S2093(images,)S 2302(though)S 2492(the)S2588(extension)S 2841(to)S 2910(other)S3056(formats)S 648 2985(F)U648 2886(and)U755(to)S 822(higher)S996(dimensions)S 1290(would)S 1460(be)S1537(straightforward.)S681 2985(ITS)U791(extensions)S 1065(such)S 1195(as)S1265(multiple)S 1487(groups)S 1670(and)S 1777(group)S1937(paramete)S 2159(rs)S 2222(are)S 2316(not)S 2413(accept)S 2568(ed.)S 3210 3084(n)U 648 3156(s)U648 3084(FITS)U 796(header)S 982(lines)S 1121(are)S 1219(not)S1320(compressed)S 1628(when)S 1782(they)S 1910(are)S2008(included)S 2240(in)S 2311(the)S2409(compressed)S 2717(image)S2889(\256le.)S 3025(This)S 3156(ca)S671 3156(igni\256cantly)U 976(affect)S 1144(the)S1248(compression)S1581(achieve)S1766(d)S 1825(for)S 1924(small)S 2084(images)S 2284(with)S 2420(large)S2570(headers.)S 2818(It)S 2884(does)S 3023(have)S 3166(the)S 648 3327(I)U648 3228(advantage)U 913(that)S 1024(the)S 1118(header)S 1299(can)S 1403(be)S 1480(easily)S1641(examined)S 1896(to)S1963(determine)S2205(d)S 2255(the)S2349(contents)S 2570(of)S 2640(the)S2734(\256le.)S 668 3327(f)U711(a)S 761(highly)S938(inappropriate)S 1283(value)S 1437(is)S1500(speci\256ed)S 1737(for)S 1829(the)S 1925(scale)S2068(factor,)S 2246(the)S 2342(image)S 2512(is)S 2574(vastly)S2740(overcompressed)S 3153(and)S 3220 3399(-)U 648 3471(t)U648 3399(much)U805(information)S 1113(is)S 1175(lost.)S 1319(The)S1435(compression)S1761(program)S 1987(ought)S 2146(to)S2215(estimate)S 2439(the)S 2535(range)S 2691(of)S2763(plausible)S 3003(scale)S 3146(fac)S665 3471(ors)U 759(from)S 897(the)S 992(image)S1161(statistics)S 1389(and)S 1496(issue)S1636(a)S1683(warning)S 1900(of)S 1970(the)S2064(user-supplied)S 2408(value)S 2559(does)S 2689(not)S 2786(appear)S2967(reasonable.)S 648 3642(I)U 648 3543(It)U 705(would)S 875(also)S992(be)S 1069(useful)S 1236(to)S 1303(have)S 1437(the)S1531(program)S 1755(make)S1906(a)S 1953(good)S 2093(guess)S 2246(for)S 2336(the)S 2430(scale)S 2571(factor)S 2732(if)S 2789(it)S 2843(is)S 2903(not)S3000(speci\256ed.)S 668 3642(f)U 709(the)S 804(wrong)S 978(size)S 1093(is)S 1154(given)S1309(\(using)S 1480(the)S3 F 1575(-r)S1 F 1643(and)S3 F 1751(-c)S1 F1819(paramete)S 2041(rs\))S 2125(for)S2216(a)S3 F 2264(raw)S1 F 2385(or)S3 F 2456(net)S1 F 2557(format)S 2739(image,)S 2922(the)S3016(compres-)S 648 3786(b)U648 3714(sion)U 775(program)S 1006(may)S 1137(fail)S 1245(to)S 1319(read)S 1450(the)S 1551(entire)S 1716(image.)S 1926(No)S 2026(error)S2170(message)S 2401(is)S 2468(issued)S 2645(if)S 2708(the)S 2808(image)S 2982(is)S3048(actuall)S3210(y)S678 3786(igger)U 822(than)S 946(the)S1040(speci\256ed)S 1274(size.)S 648 3885(O)U(n)R 742(VAXes)S 942(running)S 1150(VMS,)S 1315(the)S1410(decompressed)S 1772(image)S 1941(\256le)S 2039(may)S 2164(not)S 2262(have)S 2396(the)S 2490(same)S 2634(record)S 2808(format)S 2989(as)S 3059(the)S 3153(ori-)S 3223 3957(l)U 648 4029(c)U648 3957(ginal)U 798(image.)S 1010(This)S 1146(can)S 1259(cause)S1422(problems)S 1675(if)S 1741(the)S1844(software)S2080(reading)S 2290(the)S 2393(image)S2570(requires)S 2793(it)S 2855(to)S 2930(have)S 3072(specia)S675 4029(haracte)U 850(ristics)S 1015(\(e.g.)S1143(\256xed)S 1284(record)S1459(lengths.\))S 1709(The)S3 F 1824(modify)S1 F2025(program,)S2265(included)S 2494(with)S 2622(the)S 2717(VMS)S2867(command)S3125(\256les,)S 648 4173(a)U648 4101(can)U756(be)S 837(used)S971(to)S 1042(change)S 1237(the)S1335(decompressed)S 1700(image)S1871(\256les)S 1994(so)S 2070(that)S 2184(they)S 2311(have)S2448(\256xed)S 2591(record)S2768(lengths,)S 2980(but)S 3080(it)S 3137(uses)S 675 4173(n)U728(unsupported)S 1048(VMS)S 1200(system)S1390(routine,)S1599(SYS$MOD)S 1877(IFY,)S 2011(to)S 2081(make)S 2235(the)S2332(modi\256cation)S 2660(so)S 2736(it)S 2793(is)S 2855(at)S 2921(best)S3040(a)S 3089(make-)S 432 4542(S)U648 4245(shift)U775(solution.)S 465 4542(un)U 545(Release)S 753(4.1)S 1496(Last)S1620(change:)S 1828(20)S 1908(April)S 2055(1992)S3210(4)SEP %%Page: ? 5BP1 F60 Z 3220 222(\))U3 F54 Z 432 510(A)U1 F60 Z432 222(HCOMPRESS)U797(\()S827(1)S867(\))S 1564(USER)S1737(COMMANDS)S2785(HCOMPRESS)S 3150(\()S3180(1)S3 F54 Z471 510(UTHOR)U1 F60 Z648 582(Richard)U859(L.)S 931(White,)S 1114(Space)S1278(Telescope)S1543(Science)S1751(Institute)S 2059 681(u)U 432 4542(S)U648 681(Problems,)U910(suggestions,)S1225(gripes,)S 1407(and)S 1514(praise)S 1678(to)S 1745(rlw)S5 F(@)R1 F (stsci.ed)R 465 4542(un)U 545(Release)S 753(4.1)S 1496(Last)S1620(change:)S 1828(20)S 1908(April)S 2055(1992)S3210(5)SEP %%Trailerpscatsave end restore %%Pages: 5*[HCOMPRESS.DOC]PAPER.PS;1+,./ 4N*-y0123KPWO56718!]49GHJZ%!PS-Adobe-2.0(%%Creator: dvips by Radical Eye Software%%Title: nasa_nofigs.dvi %%Pages: 6 1%%BoundingBox: 0 0 612 792 %%EndComments%%BeginDocument: tex.proK/TeXDict 200 dict def TeXDict begin /bdf{bind def}def /Inch{Resolution mul}Kbdf /Dots{72 div Resolution mul}bdf /dopage{72 Resolution div dup neg scaleKtranslate}bdf /@letter{Resolution dup -10 mul dopage}bdf /@note{@letter}bdfK/@a4{Resolution dup -10.6929133858 mul dopage}bdf /@translate{translate}bdfF/@scale{scale}bdf /@rotate{rotate}bdf /@landscape{[0 1 -1 0 0 0]concatCResolution dup dopage}bdf /@legal{Resolution dup -13 mul dopage}bdfL/@manualfeed{statusdict /manualfeed true put}bdf /@copies{/#copies exch def}Jbdf /@FontMatrix[1 0 0 -1 0 0]def /@FontBBox[0 0 1 1]def /dmystr(ZZf@@)defL/newname{dmystr cvn}bdf /df{/fontname exch def dmystr 2 fontname cvx(@@@)cvsMputinterval newname 7 dict def newname load begin /FontType 3 def /FontMatrixJ@FontMatrix def /FontBBox @FontBBox def /BitMaps 256 array def /BuildChar{KCharBuilder}def /Encoding TeXEncoding def end fontname{/foo setfont}2 arrayGcopy cvx def fontname load 0 dmystr 5 string copy cvn cvx put}bdf /dfe{Gnewname newname load definefont setfont}bdf /ch-image{ch-data 0 get}bdfK/ch-width{ch-data 1 get}bdf /ch-height{ch-data 2 get}bdf /ch-xoff{ch-data 3Kget}bdf /ch-yoff{ch-data 4 get}bdf /ch-tfmw{ch-data 5 get}bdf /CharBuilder{Ksave 3 1 roll exch /BitMaps get exch get /ch-data exch def ch-data null ne{Lch-tfmw 0 ch-xoff neg ch-yoff neg ch-width ch-xoff sub ch-height ch-yoff subIsetcachedevice ch-width ch-height true[1 0 0 1 ch-xoff ch-yoff]{ch-image}Mimagemask}if restore}bdf /dc{/ch-code exch def dup 0 get length 1 lt{pop[<00>L1 1 0 0 8.00]}if /ch-data exch def newname load /BitMaps get ch-code ch-dataJput}bdf /bop{gsave /SaveImage save def 0 0 moveto}bdf /eop{clear SaveImageKrestore showpage grestore}bdf /@start{/Resolution exch def /TeXEncoding 256Marray def 0 1 255{TeXEncoding exch 1 string dup 0 3 index put cvn put}for}bdfJ/p{show}bdf /RuleMatrix[1 0 0 -1 0 -1]def /BlackDots 8 string def /v{gsaveLcurrentpoint translate false RuleMatrix{BlackDots}imagemask grestore}bdf /a{Nmoveto}bdf /delta 0 def /tail{dup /delta exch def 0 rmoveto}bdf /b{exch p tailN}bdf /c{p delta 4 sub tail}bdf /d{p delta 3 sub tail}bdf /e{p delta 2 sub tailN}bdf /f{p delta 1 sub tail}bdf /g{p delta 0 rmoveto}bdf /h{p delta 1 add tail}Nbdf /i{p delta 2 add tail}bdf /j{p delta 3 add tail}bdf /k{p delta 4 add tail}Mbdf /l{p -4 0 rmoveto}bdf /m{p -3 0 rmoveto}bdf /n{p -2 0 rmoveto}bdf /o{p -1L0 rmoveto}bdf /q{p 1 0 rmoveto}bdf /r{p 2 0 rmoveto}bdf /s{p 3 0 rmoveto}bdfJ/t{p 4 0 rmoveto}bdf /w{0 rmoveto}bdf /x{0 exch rmoveto}bdf /y{3 -1 roll pKmoveto}bdf /bos{/section save def}bdf /eos{clear section restore}bdf /SDictK200 dict def SDict begin /@SpecialDefaults{/hs 8.5 Inch def /vs 11 Inch defL/ho 0 def /vo 0 def /hsc 1 def /vsc 1 def /ang 0 def /CLIP false def /BBcalcJfalse def}bdf /@hsize{/hs exch def /CLIP true def}bdf /@vsize{/vs exch defH/CLIP true def}bdf /@hoffset{/ho exch def}bdf /@voffset{/vo exch def}bdfK/@hscale{@scaleunit div /hsc exch def}bdf /@vscale{@scaleunit div /vsc exchLdef}bdf /@angle{/ang exch def}bdf /@scaleunit 100 def /@rwi{10 div /rwi exchLdef}bdf /@llx{/llx exch def}bdf /@lly{/lly exch def}bdf /@urx{/urx exch def}Lbdf /@ury{/ury exch def /BBcalc true def}bdf /@setclipper{BBcalc{rwi urx llxGsub div dup scale llx neg lly neg translate}{hsc vsc scale}ifelse CLIP{Nnewpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto closepath clip}{Kinitclip}ifelse}bdf end /@MacSetUp{userdict /md known{userdict /md get typeL/dicttype eq{md begin /letter{}def /note{}def /legal{}def /od{txpose 1 0 mtxEdefaultmatrix dtransform exch atan/pa exch def newpath clippath mark{Etransform{itransform moveto}}{transform{itransform lineto}}{6 -2 rollEtransform 6 -2 roll transform 6 -2 roll transform{itransform 6 2 rollHitransform 6 2 roll itransform 6 2 roll curveto}}{{closepath}}pathforallEnewpath counttomark array astore /gc xdf pop ct 39 0 put 10 fz 0 fs 2KF/|______Courier fnt invertflag{PaintBlack}if}def /txpose{pxs pys scale pprIaload pop por{noflips{pop exch neg exch translate pop 1 -1 scale}if xflipKyflip and{pop exch neg exch translate 180 rotate 1 -1 scale ppr 3 get ppr 1Lget neg sub neg ppr 2 get ppr 0 get neg sub neg translate}if xflip yflip notNand{pop exch neg exch translate pop 180 rotate ppr 3 get ppr 1 get neg sub negM0 translate}if yflip xflip not and{ppr 1 get neg ppr 0 get neg translate}if}{Lnoflips{translate pop pop 270 rotate 1 -1 scale}if xflip yflip and{translateLpop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0Lget neg sub neg translate}if xflip yflip not and{translate pop pop 90 rotateLppr 3 get ppr 1 get neg sub neg 0 translate}if yflip xflip not and{translateMpop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 exch translate}if}ifelseEscaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copyFtranslate .96 dup scale neg exch neg exch translate}if}def /cp{pop popNshowpage pm restore}def end}if}if}def /psf$TeXscale{65536 div}def /startTexFigM{/psf$SavedState save def userdict maxlength dict begin Resolution 72 div dupMneg scale currentpoint translate /psf$ury exch psf$TeXscale def /psf$urx exchNpsf$TeXscale def /psf$lly exch psf$TeXscale def /psf$llx exch psf$TeXscale defN/psf$y exch psf$TeXscale def /psf$x exch psf$TeXscale def currentpoint /psf$cyKexch def /psf$cx exch def /psf$sx psf$x psf$urx psf$llx sub div def /psf$syGpsf$y psf$ury psf$lly sub div def psf$sx psf$sy scale psf$cx psf$sx divNpsf$llx sub psf$cy psf$sy div psf$ury sub translate /showpage{}def /erasepage{I}def /copypage{}def @MacSetUp}def /doclip{psf$llx psf$lly psf$urx psf$uryJcurrentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll exch linetoHexch lineto exch lineto closepath clip newpath moveto}def /endTexFig{endKpsf$SavedState restore}def /@beginspecial{SDict begin /SpecialSave save defNgsave Resolution 72 div dup neg scale currentpoint translate @SpecialDefaults}Nbdf /@setspecial{ho vo translate @setclipper ang rotate /showpage{}def newpathJ}bdf /@endspecial{grestore clear SpecialSave restore end}bdf /@defspecial{HSDict begin}bdf /@fedspecial{end}bdf /li{lineto}bdf /rl{rlineto}bdf /rc{Ircurveto}bdf /np{/SaveX currentpoint /SaveY exch def def newpath}bdf /st{Hstroke SaveX SaveY moveto}bdf /fil{fill SaveX SaveY moveto}bdf /ellipse{E/endangle exch def /startangle exch def /yrad exch def /xrad exch defD/savematrix matrix currentmatrix def translate xrad yrad scale 0 0 14startangle endangle arc savematrix setmatrix}bdf end %%EndDocumentLTeXDict begin 300 @start /fa df[N17 7 -1 -10 23]45 dc[47 41 -2 0 52]65 dc[<00003FF000N000003FFFF0000000FFFFFC000003FFFFFF00000FFF803F80001FF8000FC0007FF00003E000FFCN00001F000FF800001F001FF800000F803FF000000F803FF0000007807FE0000007807FE0000007N807FE000000000FFC000000000FFC000000000FFC000000000FFC000000000FFC000000000FFC0N00000000FFC000000000FFC000000000FFC000000000FFC000000000FFC0000000007FE0000007N807FE0000007807FE0000007803FF000000F803FF000000F801FF800001F800FF800001F800FFCN00003F8007FF00007F8001FF8001FF8000FFF807FF80003FFFFFFF80000FFFFF8F800003FFFE07N8000003FF00380>41 41 -4 0 50]67 dc[47 41 -3 0 54]72Ndc[23 41 -1 0 26]73 dc[39 41 -3 0 47]80 dcN[<01FC07FC0FFF1FFC3FFFFFFC7FC3FFFC7F81FF80FF80FF80FF007F80FF007F80FF007F80FF80N7F807F807F807FC07F803FF07F800FFFFF8003FFFF80007FFF800000FF8000007F800F007F803FMC07F803FC07F803FC0FF003FC0FF003FC1FE001FFFFC000FFFF00001FF8000>30 27 -2 0 33]M97 dc[<001FE00000FFFC0003FFFF000FFC1F801FF007C03FE007C03FC003C07FC000007FC000N00FF800000FF800000FF800000FF800000FF800000FF800000FF800000FF800000FF8000007F80M1E007FC07F803FC07F803FC07F801FE07F800FF07F8003FFFF0000FFFE00001FF000>26 27 -2N0 31]99 dc[<001FF00000FFFE0003FFFF800FFC0FC01FF003C03FE003E03FC001E07FC000007FN800000FF800000FF800000FF800000FF800000FFFFFFE0FFFFFFE0FFFFFFE0FF800FE0FF800FE0N7F800FE07F801FC03FC01FC03FC03FC01FE03F800FF07F0003FFFE0001FFF800003FE000>27 27N-2 0 32]101 dc[<7FFFC0007FFFC0007FFFC0007FFFC00007F8000007F8000007F8000007F800N0007F8000007F8000007F8000007F8000007F8000007F8000007F8000007F8000007F8000007F8N000007F8000007F8000007F8000007F8000007F80000FFFFC000FFFFC000FFFFC000FFFFC00007NF8000007F8000007F8000007F8000007F8000007F8000007F83F0007F87F8007F87F8003FC7F80M03FE7F8001FF7F80007FFF00001FFE000003F800>25 42 -2 0 21]102 dc[<007FF00003FFFEN000FFFFF803FC01FE07F0007F07E0003F0FE0003F8FC0001F8FC0001F8FC0001F8FE0003F87E00N0FF83FFFFFF81FFFFFF00FFFFFF01FFFFFE03FFFFFC03FFFFF003FFFF8003E0000003E0000003CN0000003CFF80001FFFE0001FFFF8001FC1FC003FC1FE003F80FE007F80FF007F80FF007F80FF00N7F80FF007F80FF007F80FF303F80FEFC3FC1FEFC1FC1FEFC0FFFFFFC03FFEFF800FF81F0>30 40M-2 13 34]103 dc[33 42 -3 0 38]104 dc[16 43 -2 0 19]105 dc[16 42 -2 0 19]108 dc[52 27 -3 0 57]109Ndc[33 27 -3 0 38]110 dc[<003FE00001FFFCN0007FFFF000FF07F801FE03FC03FC01FE03F800FE07F800FF07F800FF0FF800FF8FF800FF8FF80N0FF8FF800FF8FF800FF8FF800FF8FF800FF8FF800FF87F800FF07F800FF07F800FF03F800FE03FMC01FE01FC01FC00FF07F8003FFFE0001FFFC00003FE000>29 27 -2 0 34]111 dc[33 39M-2 12 38]112 dc[24 27 -2 0 28]114 dc[22 27 -2 0 27]115 dc[<N003F8000FFC001FFF003FCF007F8F807F87807F87807F87807F87807F87807F87807F80007F800N07F80007F80007F80007F80007F80007F80007F80007F80007F80007F800FFFFF0FFFFF0FFFFF0N1FFFF007F80003F80003F80001F80000F80000F80000F800007800007800007800007800>21 38L-1 0 27]116 dc dfe /fb df[<80C0603018180C0C06063E7EFE7E7C38>7 16 -4 10 14]44Ndc[12 3 -3 -9 17]45 dc[<387CFC7E7C38>7 6 -4 0 14]46 dc[<07E0001FNF8003C3E00780F00780780780780F003C0F803C0F803E0F803E0F801E0F801F0F801F0F801F0F8N01F07C00F87C00F87C00F87C00F87C00F83C00F83E00783E00781E00781E00780F00780F007807N80700380F001E1E000FFC0003F00>21 32 -4 0 25]48 dc[16 32 -4 0 25]49 dc[24 32 -2 0 25]50 dc[<07F0001FFE00381F00780F80FC07C0FE03E0FE03F0FE03F07E03F0N3C01F80001F80001F00001F00001E00003C000078000FE0000FF00000F800003E00001F00001F8M0300F807C0FC0FC07C0FE07C07E07C07C07C03807801C0F800FFE0003F80>22 32 -3 0 25]51Ndc[<03FFF003FFF0001F00000F00000F00000F00000F00000F00000F00FFFFFCFFFFFCE0078070N07803007801807800C03C00603C00703C00383C001C3C000C3C00061E00031E00019E0001DE000N0FE00007E00003F00001F00000F0000070000070>22 32 -3 0 25]52 dc[<1C00003E00007E00N003F00003F00003F00003F00001F00001F00001F80000F80000F800007800007C00003C00003C0N0001C00000E000006000007000003000001800000C00C00600C003006001806000C06000C07FFFNE03FFFF03FFFF83FFFF83C0000180000>21 34 -7 0 25]55 dc[<03F0000FFE003C0F00380180N7000C0F00060E00070E00070E000707000787000783800F83803F01C07F00F1FE003FFC000FF80N01FF0003FF8007F9C00FF0E00FC0700F80380F001C0E001C0E001C06001C03001C03803801E078N007FF0001F80>22 32 -3 0 25]56 dc[<1F80003FE000607800F03C00F80E00FC0F00FC07807CN07803803C00003E00001E00001E007F9F00FFDF01E07F01C03F83C01F83C01F87C00F87C00F87CL00F83E00F83E00783E00783E00781E00780F00780F00700780F001E1E000FFC0003F00>21 32M-4 0 25]57 dc[<38007C00FC007E007C0038000000000000000000000000000000000000000EM001F001F801F800F800700>9 21 -4 0 14]58 dc[<007FF00001FFFF0007C00FF00E0000FC1CN0000003800000030000000601F81E0607FE3F0E0F07798C1E01F8CC1E00F84C3C00786C3C00786NC3C00786C3C003C3C3C003C3C3C003C3C3C003C3C3C003C361E003C361E001E360F003E3307803NE3383C0703181E0E060C0FFC060601F00E0700000C0380001801C00038007000F0003E03C0000FNFF800001FC00>32 35 -6 0 39]64 dc[33 34 -2 0 37]M65 dc[32 34 -2 0 35]66 dc[<003F800001NFFF00003F038000F800E001F0003001E0001803E0001C07C0000C07C000060FC000060F8000030NF8000030F8000030F8000000F8000000FC000000FC000000FC000000FC000000FC0000007E0000N187E00001C3E00001C3F00001C1F00001C0F80001C0F80001C07C0003E03E0003E01F0007E007CN00FE003F01CE000FFF060001FC03>32 34 -6 0 36]67 dc[35 34 -2 0 38]68 dc[33 34 -2 0 34]69 dc[38 34 -2 0 37]72 dc[21 34 -1 0 18]73 dc[<0FC000003FF80000707C0000FC3E0000FE1F0000FEN0F8000FE0F80007E0F80003C0F80000007C0000007C0000007C0000007C0000007C0000007C000N0003E0000003E0000003E0000003E0000003E0000003E0000001F0000001F0000001F0000001F0M000001F0000001F0000000F8000000F8000000F8000000F8000000F800003FFF80003FFF80>25N34 -2 0 26]74 dc[28 34 -2 0 31]76 dc[47 34 -2 0 46]77 dc[38 34 -2N0 37]78 dc[<007F800001FFF00007E0FC000F803E001F000F803E0007C07E0003E07C0003F07CN0001F0FC0001F8FC0000FCF80000FCF800007EF800007EFC00007EFC00003FFC00003FFC00003FNFC00003FFC00003F7E00003F7E00003F3E00003F3F00003F1F00003E1F80003E0F80003E07C000N7C03E0007801F000F800F801F0003E07E0000FFF800001FC00>32 34 -6 0 39]79 dc[32 34 -2 0 34]80 dc[35 34 -2 0 37]82 dc[<80FE0000E7FF8000FF03C0007C00E00078007000700078007000N380060003C0060003C0030003E0000003E0000003E0000003E0000007E000001FC00001FFC0000NFFF80001FFF80003FFE00007FFC0000FFC00000FC000000F8000000F8000000F0003000F000300N07000300078003800380078003C0078001E00F8000F03F80003FF180000FC0C0>26 34 -3 0 28N]83 dc[<3FFFF8003FFFF800007E0000003E0000003E0000003E0000003E0000003E0000003E00N00001F0000001F0000001F0000001F0000001F0000001F0000000F8000000F8000000F8000000FN8000000F8000000F80000007C000C007C006C007C006C007C0066007C0066007C0066003E00670N03E0063003E0063803E00E3E03E03E3FFFFFFF1FFFFFFF>32 34 -6 0 36]84 dc[<007E000000N03FF8000000781C000000F007000001E003800001E001800003E000C00003E000600003E000600N003E000600003E000300003E000300003E000300003E000300003E000300001F000180001F0001N80001F000180001F000180001F000180001F000180000F8000C0000F8000C0000F8000C0000F80N00C0000F8000C0000F8000C00007C000600007C000600007C000600007C000600007E000F800FFNFF0FFF80FFFF0FFF80>33 34 -7 0 37]85 dc[<0018000000001C000000003C000000003E0000N00003E000000003F000000003F800000007F800000007DC00000007CC00000007C600000007C60N000000FC30000000F830000000F818000000F818000000F80C000001F80C000001F006000001F0N06000001F003000001F003000003F001800003E001C00003E000C00003E000E00003E000600007ME000300007C000300007C000180007C0001C000FE0003E00FFFC01FFE0FFFE00FFE0>35 34 -6N0 37]86 dc[<006000180000000070001C00000000F0001C00000000F8001E00000000F8003E00N000000F8003F00000000FC003F00000000FC003F80000000FE003F80000001FE003EC0000001F3N003EC0000001F3007E60000001F1807C60000001F1807C30000001F0C07C30000001F0C07C3800N0003F0607C18000003E0607C1C000003E030FC0C000003E030F80C000003E018F806000003E018NF806000003E01CF803000007E00CF803000007C00EF801800007C007F801800007C007F000C000N07C003F000C00007C003F000600007C001F00060000FC001F00070000FC003F000F800FFFC1FFFN07FF80FFFC1FFF87FF80>49 34 -6 0 51]87 dc[<1F83C03FE7F07C3FB8F81F8CF80F8CF8078CNF8078C7C07807C07803E03C01F83C007FFC001FFC00003C00E03C01F01E01F83C01F83C01F8780N0FFF0003FC00>22 21 -3 0 25]97 dc[22 35 -5 0 28]98 dc[<07E0001FF8003E0E007C0300780300F80180F80000F800N00F80000F80000F80000F80000F800007800007C07003C0F801E0FC00F0FC0078FC003FF8000FEN00>18 21 -4 0 22]99 dc[<07C3FC1FFBFC3C1FE07807E0F803E0F001E0F001E0F001E0F001E0NF800F0F800F0F800F0F800F07800F07C00F03C00781E00780F00F80783F803FF7800FC7800003CN00003C00003C00003C00003C00003C00001E00001E00001E00001E00001E0000FE0000FF00000FM>24 35 -4 0 28]100 dc[u,~ HCOMPRESS.BCKy[HCOMPRESS.DOC]PAPER.PS;1N5 .<03F0000FFC001F07003C0380780180F800C0F80000F00000F00000NF80000F80000F80000FFFFE07FFFE07C01E03C01E01E01E00F01E00783C003FF80007E00>19 21N-3 0 22]101 dc[22 35N-1 0 15]102 dc[<03FC00000FFF80003E03E0007800700070003800E0001C00E0001C00E0001CN0070001C0070001C003C007C001FFFFC0007FFF8000FFFF0000FFFC0000E0000000C0000000C00N00000E7E000007FF800003C3C0000781E0000780F0000F80F8000F80F8000F80F80007C0780007MC0780003C0FBC001F0FBC0007FFFC0001F8780>26 32 0 11 25]103 dc[25 35 -1 0 28]104 dc[13 34 0 0 13]105 dc[26 35 -1 0 26]107 dc[14 35 0 0 13]108 dc[40 21 -1 0 43]109 dc[25 21 -1 0M28]110 dc[<03F0000FFE003E0F807803C07801E0F801F0F000F0F000F8F000F8F8007CF8007CKF8007CF8007C78007C7C007C3C00781E00780F00F00781E001FFC0007F00>22 21 -3 0 25]N111 dc[27 31 0 10 28]112 dc[20 21 -1 0 20]114 dc[17 21 -2 0 20]115 dc[<0F001FC03C603C603C303C303C303C303C301E001E00N1E001E001E001E000F000F000F000F00FFF8FFF81F800F80078003800380018001C000C000C000MC0>13 31 -4 0 19]116 dc[<07E3FC1FFBFC3C1FE03C07E03C03E03C03E03C01E03C01E03C01ME01E00F01E00F01E00F01E00F01E00F01E00F00F00780F00781F00F8FFp407F8FF07F80F0078>22M21 -4 0 28]117 dc[<01C00001C00001E00001E00001F00003F80003D80003DC0003CC0007C6M000786000783000783000781800F81800F00C00F00C00F00601F00F8FFE3FEFFE1FF>24 21 -4M0 26]118 dc[<0380380000038038000003C03C000003C03C000003E03E000007E03E000007B0N7B000007B07B000007987980000798798000078C70C0000F8C70C0000F06F060000F06F060000FM03F030000F03F030000F01E018001F01E01C001F01E03E00FFC7FC7F80FFC7FC7FC0>34 21 -4M0 36]119 dc[26 21 -1 0 26]120 dc[<3C0000007F000000E3800000C1C0N0000FCE00000FC6000007C300000003000000018000000180000001C0000001C0000001E000000N1E0000001F0000003F8000003D8000003DC000003CC000007C6000007860000078300000783000N0078180000F8180000F00C0000F00C0000F0060001F00F800FFE3FE00FFE1FF0>28 31 0 10 26N]121 dc dfe /fc df[45 35 -1 0 48]14 dc[14 6 -1 -8 19]45 dc[<1C007F007F00FF80FF80FF807F007F001C00>M9 9 -3 0 16]46 dc[<00FF0003FFC00FFFF01FC3F83F00FC3F00FC7E007E7E007E7E007EFE00N7FFE007FFE007FFE007FFE007FFE007FFE007FFE007FFE007FFE007FFE007FFE007FFE007F7E00N7E7E007E7E007E7E007E3F00FC3F00FC1FC3F80FFFF003FFC000FF00>24 32 -2 0 29]48 dc[20 32 -4 0 29]49 dc[22 32 -3 0 29]50 dc[<01FF000FFFE01FFFF07E07F87E03FCFF01FEFF01NFEFF01FFFF01FF7E01FF3C01FF0001FF0001FE0001FE0003FC0007F800FFE000FF0000FFC0000FME00007F00607F81F03FC3F83FC3F83FC3F83FC3F83FC1F03F81F07F80FFFF007FFC000FF00>24N32 -2 0 29]51 dc[<01FFFF01FFFF01FFFF0007F00007F00007F00007F00007F00007F0FFFFFFNFFFFFFFFFFFFF003F07803F03C03F01E03F00E03F00F03F00783F003C3F001E3F000F3F000F3F0N007BF0003FF0001FF0000FF00007F00007F00003F00001F00000F0>24 32 -2 0 29]52 dc[<03NFC000FFF003FFFC07C0FE07C07F0FE03F8FE03F8FE03FCFE03FC7E03FC3C03FC0003FC0003FC00N03F83803F83C03F03E07F03FFFC03FFF803CFE003C00003C00003C00003FF0003FFC003FFF003FNFF803FFFC03FFFE03FFFF03C01F0200030>22 32 -3 0 29]53 dc[<00FF0003FFE007FFF00FC1NF81F80FC3F00FE3F00FE7F00FF7F00FF7F00FFFF00FFFF00FFFF00FFFF00FFFF80FEFF80FEFF80NFCFFC1FCFF7FF8FF3FE0FF1F807F00007F00F87F01FC3F81FC1F81FC1F81FC0FC0FC07F07801FFNF800FFF0001FC0>24 32 -2 0 29]54 dc[<01FF000FFFE01FFFF03F80F87E003C7C001EF8001ENF8001FF8001FF8003FF800FF7C03FF7C0FFF3E1FFE1FFFFE0FFFFC03FFF807FFF00FFFC01FFFF0N3FFDF83FF8F83FE07C3F807C3E007C3E007C1E007C1E00F80F81F807FFF003FFC000FF00>24 32M-2 0 29]56 dc[<01F80007FF000FFFC01E0FE03F03F03F81F83F81FC3F80FC3F80FE1F00FE00N00FE01F8FF07FCFF1FFEFF3F83FF3F01FF7F01FF7F01FFFF00FFFF00FFFF00FFFF00FFFF00FEFFN00FEFF00FE7F00FC7F00FC3F01F81F83F00FFFE007FFC000FF00>24 32 -2 0 29]57 dc[38 34 -2 0 43]65 dc[<0003FF0000001FFFE000007FFFF80001NFF807C0003FC001E0007F8000F000FE00007801FE00003803FC00003C03FC00001C07FC00001C0N7F800001C07F80000000FF80000000FF80000000FF80000000FF80000000FF80000000FF800000N00FF80000000FF800000007F800003C07F800003C07FC00003C03FC00007C03FC00007C01FE000M0FC00FE0000FC007F8001FC003FC003FC001FF80FFC0007FFFF7C0001FFFC1C00003FE00C0>34N34 -3 0 41]67 dc[33 34 -2 0 38]69 dc[40 34 -2 0 45]72 dc[20 34 -1 0 22]73 dc[33 34 -2 0 39]80Ndc[40 34 -2 0 43]82 dc[25 34 -3 0 32]83 dc[<03FFFFFC0003FFFFFC0003FFFFFC000003FC000000N03FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC0000N0003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00N00E003FC00E0E003FC00E0E003FC00E0E003FC00E0F003FC01E0F003FC01E07003FC01C07803FCN03C07C03FC03C07E03FC0FC07FFFFFFFC07FFFFFFFC07FFFFFFFC0>35 33 -2 0 40]84 dc[<00N01FF8000000FFFF000003FFFF800007F807E0000FE001F0001FC000F8003FC00078003F8000780N07F80003C007F80003C007F80003C007F80003C007F80003C007F80003C007F80003C007F80003NC007F80003C007F80003C007F80003C007F80003C007F80003C007F80003C007F80003C007F800N03C007F80003C007F80003C007F80003C007F80003C007F80003C007F80003C007F80003C0FFFFNC07FFEFFFFC07FFEFFFFC07FFE>39 34 -2 0 44]85 dc[<0FE03F801FFCFF803FFEFF807F07FCN00FE03FC00FC01FC00FC01FC00FC01FC007E01FC007F01FC001FE1FC000FFFFC0001FFFC000001MFC001C01FC003E01FC007F01FC007F03F8007F07F8003FFFF0001FFFC00007FE0000>25 22 -2N0 28]97 dc[<00FE0007FF800FFFC01FC1E03F80707F00707F00007E0000FE0000FE0000FE0000MFE0000FE0000FE00007E01C07E03E07F07F03F07F01F87F00FFFE007FFC000FF00>20 22 -2 0N25]99 dc[<01FC3FF007FF3FF01FFFFFF03F81FF803F007F807E003F807E003F80FE003F80FE00N3F80FE003F80FE003F80FE003F80FE003F80FE003F80FE003F807E003F807F003F803F003F803FNC0FF801FFFFF8007FFBF8001FC3F8000003F8000003F8000003F8000003F8000003F8000003F80N00003F8000003F8000003F8000003F800001FF800001FF800001FF80>28 35 -2 0 32]100 dc[M<00FF0003FFC00FFFF01FC0F03F80787F00387F0000FE0000FE0000FE0000FE0000FFFFF8FFFFNF8FFFFF8FE01F87E01F87F01F03F03F01F87E00FFFE007FF8000FE00>21 22 -2 0 26]101 dc[M21 35 -2 0 18]102 dc[M<00FFC00007FFF8001FFFFE003F807F007E001F80FC000FC0FC000FC0FC000FC0FC000FC07E00N3FC03FFFFF801FFFFF800FFFFF001FFFFE001FFFFC001FFFE0001E0000001C0000001CFE00000FNFF80000FFFE0001F83F0001F01F0003F01F8003F01F8003F01F8003F01F8003F01F9001F01F380N1F83F7C00FFFFFC003FFBF8000FE0F00>26 33 -1 11 29]103 dc[29 35 -2 0 32]104 dc[13 36 -2 0 16]105 dc[13 35 -2 0 16]108 dc[45 22 -2 0 48]109 dc[29 22 -2 0 32M]110 dc[<00FF0007FFE00FFFF01F81F83F00FC7F00FE7E007EFE007FFE007FFE007FFE007FFEN007FFE007FFE007F7E007E7E007E7E007E3F00FC1F81F80FFFF007FFE000FF00>24 22 -2 0 29M]111 dc[28 32 -1 10 32]112 dc[21 22 -1 0 24]114 dc[18 22 -2 0 23]115 dc[<01F80007FE000FFF000FE7N001FC3801FC3801FC3801FC3801FC3801FC0001FC0001FC0001FC0001FC0001FC0001FC0001FC0N001FC0001FC000FFFF00FFFF00FFFF003FC0000FC00007C00007C00003C00003C00001C00001C0M0001C00001C000>17 32 -1 0 22]116 dc[<01FE1FF807FF9FF80FFFDFF81FC0FFC01FC03FC0N1FC03FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FLC01FC01FC01FC01FC01FC01FC01FC01FC0FFC0FFC0FFC0FFC0FFC0FFC0>29 22 -2 0 32]117Ndc[<1F0000003FC000007FE00000F0F00000E0780000FE380000FE3C00007C1C0000001C000000N0E0000000E0000001F0000001F0000003F8000003F8000007FC000007FC000007FC00000FFE000N00FEE00001FEF00001FC700003FC780003F8380003F8380007F81C0007F01C000FF01E000FE00EN00FFFC3FE0FFFC3FE0FFFC3FE0>27 32 -1 10 30]121 dc dfe /fd df[23 2N-4 -8 31]0 dc dfe /fe df[30 2 -4 -11 39]0 dc[24 24 -7 0 39]2 dc[32 34 -3 1 39]6 dc[<03F0000FFC001C0E003807N00700380600180E001C0C000C0C000C0C000C0C000C0C000C0C000C0E001C06001807003803807M001C0E000FFC0003F000>18 20 -3 -2 25]14 dc[<800007E080001FF080003FF8C000781CC0M01E00E6003C00670078003381E00031FFC00010FF8000107E00001>32 11 -3 -7 39]24 dc[<NFFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000000000000000000N0000000000800007E080001FF080003FF8C000781CC001E00E6003C00670078003381E00031FFCN00010FF8000107E00001>32 22 -3 -1 39]39 dc dfe /ff df[32 24 -2 0 32]78 dc[<0FC03FF07038F008E000E000F000F000F00070007838N3C3C1E3C07F801F0>14 15 -2 0 18]99 dc[<78F0FFFCEF8EF783F783678103C003C003C003CEMC1EFC1EF61E73FBE1F1C>16 15 -3 0 23]120 dc[<1F00003FC00079E00078F0003878001078N00003C0007FC000FFC001E3E003C1E003C1E003C1E001E0F001E0F001E0F000F0F00CF0780CF07N806707803F07801E0380>17 22 -2 7 20]121 dc dfe /fg df[<07C000001FF0000038380000N701E0000700F0000F0070000F0078000F003C000F003C000F003C0007801E0007801E0007801E0M003C01E0003C01E0001E01E0000F83C00007FFFF8003FFFF8001FFFFC0007FFF80>26 21 -2 0N28]27 dc[<78FCFCFCFC78>6 6 -4 0 14]58 dc[18 49 -3 12 25]61 dc[49 34 -2 0 48]77 dc[40 34 -2 0 40]78 dc[28 34 -3 0 31]83 dc[<0F81E01FE7F03C7718781F0C780F0CF80F0CF80786F807N84F80780F807807C03C07C03C07C03C03C03C03E01E01E01E00F01E00703E003C7F001FEF0007CN60>23 21 -2 0 26]97 dc[<6000F000F003F80078038C0078078600780783007803C3003C03C1N803C03C1003C01E0003C01E0001E00F0001E00F0001E00F0001E00F0000F0078000F0078000F80N78000FC0780007F0F00007BFE000078FC0000780000003C0000003C0000003C0000003C0000001LE0000001E0000001E0000001E0000000F0000000F000000FF000000FF0000000F80000>25 35N-2 0 29]104 dc[<3C1F007E3FC06370E0F1E030F9E018F9E01878F00C38F00800F00000F00000N7800007800007800007830603C78603C7C303C7C303E3C1C3F1C0FF3F803E0F0>22 21 -2 0 28M]120 dc[<1F80003FE000707800783C007C1E007C0F003C07000007800003C00003C001F3C003NFFC00787E00F03E00F01E00F01E00F00F00F00F00F00F00F00F007807807807807807803C078C3MC03CC1E03CC1E03C61E03C31E01E1FC01E0F800C>23 31 -1 10 24]121 dc dfe /fh df[<0FNC01FE03870787870387038F03CF03CF03CF03CF03CF03CF03CF03CF03CF03C7038703870383870N1FE00780>14 22 -2 0 20]48 dc[12 22 -3 0 20]49 dc[14 22N-2 0 20]50 dc dfe /fi df[<7FF1FFE07FF1FFE007803C0007803C0007803C0007803C000780N3C0007803C0007803C0007803C0007803C0007803C0007803C0007803C0007803C0007803C0007N803C0007803C0007803C00FFFFFFE0FFFFFFE007803C0007803C0007803C0007803C0007803C00N07803C0007807C000780FC1E03C0FC3F03C0FE3F01E07F3F00F83F9F003FF3FE0007E0FC>32 35N0 0 29]11 dc[<7FF1FFC07FF1FFC007803C0007803C0007803C0007803C0007803C0007803C00N07803C0007803C0007803C0007803C0007803C0007803C0007803C0007803C0007803C0007803CN0007807C00FFFFFC00FFFFFC000780000007800000078000000780000007800000078030000780L78000780FC0003C0FC0003C0FC0001E07C0000F83800003FF0000007E000>26 35 0 0 28]12Ndc[<7FF1FFC07FF1FFC007803C0007803C0007803C0007803C0007803C0007803C0007803C0007N803C0007803C0007803C0007803C0007803C0007803C0007803C0007803C0007803C0007803C00NFFFFFC00FFFFFC0007803C0007803C0007803C0007803C0007803C0007803C0007803C0007807CM0003C0FC0003C0FC0001E0FC0000F87C00003FFC000007EC00>26 35 0 0 28]13 dc[<7FF0FFNC7FF7FF0FFC7FF07801E00F007801E00F007801E00F007801E00F007801E00F007801E00F00780N1E00F007801E00F007801E00F007801E00F007801E00F007801E00F007801E00F007801E00F007N801E00F007801E00F007801E01F0FFFFFFFFF0FFFFFFFFF007801E000007801E000007801E0000N07801E000007801E000007801E00C007807E01E007807E03F003C07F03F003C07F03F001E03F81MF000781FE0E0003FF8FFC00007F01F80>40 35 0 0 42]14 dc[<78FCFCFCFC78000000000030M303030307878787878787878787878FCFCFCFCFCFCFC78>6 35 -4 0 14]33 dc[<601800701CN00300C001806001C07000C03000C03000601800601800601807E1F80FE3F80FE3F80FC3F00FC3FN00781E00>17 16 -2 -19 25]34 dc[<0C00001E000E00003F000600007180070000E180038001NE0C0018001C0C001C001C06000E003C060006003C060007003C060003803C060001803C060001CN03C060000E03C060000601C060000701C0C0000381E0C0000180E1800001C071800000C03F0007N80E01E001FC07000001C60300000387038000070301C000070300C0000F0180E0000F018070000NF018030000F018038000F01801C000F01800C000F01810E000F01BFFF000703FC7F000703C0078N003870003C001C60000C001FC0000E000780000600>35 40 -3 3 42]37 dc[<03F801F8000FFEN07FE003F079F07007E01FC03007C00780180FC00F00180F801F80000F803CC0000F807C60000F8N0F860000781F030000381E0180001C3E0180000C3C00C0000678006000037800600001F0003000N00F000380001F0007C0001F003FFC001F803FFC001EC00000003C600000003C700000003C30000N0003C180000003C1C0000003C0C0000003C0C0000003C0C0000001C0C0000001C180000000E180N0000007F000000001E000000>34 35 -2 0 39]38 dc[<607030181C0C0C0606067EFEFEFCFC78M>7 16 -4 -19 14]39 dc[<0030006000C001800380070006000E000E001C001C003800380038N007800700070007000F000F000F000F000F000F000F000F000F000F000F000F000F000F0007000M7000700078003800380038001C001C000E000E00060007000380018000C000600030>12 50 -3M13 19]40 dc[12 50 -3 13 19]41Ndc[<00018000000180000001800000018000000180000001800000018000000180000001800000N018000000180000001800000018000000180000001800000018000FFFFFFFFFFFFFFFF00018000N000180000001800000018000000180000001800000018000000180000001800000018000000180N000001800000018000000180000001800000018000>32 34 -3 5 39]43 dc[<607030181C0C0CN0606067EFEFEFCFC78>7 16 -4 10 14]44 dc[12 3 -1 -9 17]45 dc[<78FCNFCFCFC78>6 6 -4 0 14]46 dc[<01F80007FE000F0F001E07803C03C03C03C07801E07801E078N01E0F801F0F801F0F801F0F801F0F801F0F801F0F801F0F801F0F801F0F801F0F801F0F801F0F8N01F0F801F07801E07801E07801E03C03C03C03C01E07800F0F0007FE0001F800>20 32 -2 0 25N]48 dc[<7FFF807FFF8001E00001E00001E00001E00001E00001E00001E00001E00001E00001E0N0001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E0N0001E00001E000FDE000FFE00003E00000E000006000>17 32 -3 0 25]49 dc[20 32 -2 0 25]50 dc[<03F8001FFE003C0F807807C07C07C0FEN03E0FE03F0FE03F07C03F07C03F00003F00003E00003E00007C0000780000F0003F80003FC0000N3E00000F00000F800007C01807C03E07E07E03E07F03E07E07E07E07C03C07C01C0F800FFE0003NF800>20 32 -2 0 25]51 dc[<00FFFC00FFFC0007800007800007800007800007800007800007N80FFFFFCFFFFFCE007806007803007803807801C07800C078006078007078003078001878001C7M8000C780006780007780003780001F80001F80000F80000780000380000380>22 32 -1 0 25]M52 dc[<03F0000FFE001C0F003007806003C0F803E0FC01E0FC01F0FC01F07C01F03801F00001NF00001F00001E00001E01803C01C03C01E07801BFE0018F8001800001800001800001800001800N001FE0001FFC001FFE001FFF001FFF801E03C0100040>20 32 -2 0 25]53 dc[<01F80007FE00N0F07001E03801C03C03C01E03801E07801F07801F07801F0F801F0F801F0F801F0F801F0FC01E0NFC01E0FE03C0FE0380FBFF00F9FE007800007800007800003C03C03C07E01C07E01E07E00E07E0N0703E003C1C000FF80003E00>20 32 -2 0 25]54 dc[<03C00007E00007E00007E00007E00007NE00007E00007E00003E00003E00003E00003E00001E00001E00001E00000F00000F00000700000N7000003000001800001800000C00C00600C00300C00300E001806000C07FFFE07FFFE07FFFF07FNFFF0700000600000>20 34 -3 0 25]55 dc[<01F8000FFE001E07803801C07000E0700060E000N70E00070E00070E000F0E000F07001F07007E0381FE01C3FC00FFF8003FF0007FC000FFE001FEFM003F83803F01C07C01C07800E07000E07000E07000E03001C01803C00E078007FF0001F800>20N32 -2 0 25]56 dc[<07E0001FF800383C003C0E007E07007E07807E03C07E03C03C03E00001E0N0001E00001F007F9F00FFDF01C07F03C07F07803F07803F0F801F0F801F0F801F0F801F0F801E0NF801E0F801E07801E07803C03C03C01C03800F0F0007FE0001F800>20 32 -2 0 25]57 dc[<78MFCFCFCFC7800000000000000000078FCFCFCFC78>6 21 -4 0 14]58 dc[<4060303018181C0CN0C0C7CFCFCFCF87000000000000000000078FCFCFCFC78>6 31 -4 10 14]59 dc[32 12 -3 -6 39]61 dc[<03C00007E00007E00007E00007E00003C0000000000000N0000000000000000000001800001800001800001800001800001800001C00000C00000E00000E0N00007000007800003E00001F00301F00780F80FC0F80FC0F80FC0F80F80F80600F00381E001FFCN0007F000>17 35 -3 0 24]63 dc[32 34 -2N0 37]65 dc[29 34 -2 0 35]66 dc[<0007F0N00003FFC0000FC070001F0018003C000C0078000600F8000601F0000303E0000303E0000187E00N00187C0000187C000018FC000000FC000000FC000000FC000000FC000000FC000000FC000000FCN0000187C0000187C0000187E0000383E0000383E0000381F0000780F000078078000F803C001F8N01F0037800FC0E38003FFC180007F008>29 34 -3 0 36]67 dc[32 34 -2 0 38]68 dc[30N34 -2 0 34]69 dc[28 34 -2 0 33]70 dc[32 34 -3 0 39]71 dc[32 34 -2 0 37]72 dc[15 34 -1 0 18]73 dc[<07E0001FF800783E007C1F00FE1F00FE0FN80FE0F807C0F80380F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000FN80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000FN8007FFF807FFF8>21 34 -1 0 26]74 dc[34 34 -2 0 39N]75 dc[26 34 -2 0 31]76 dc[41 34 -2 0 46]77 dc[32 34 -2N0 37]78 dc[<000FF000007FFE0000F81F0003E007C007C003E00F8001F01F8001F81F0000F83FN0000FC3E00007C7E00007E7E00007E7C00003EFC00003FFC00003FFC00003FFC00003FFC00003FNFC00003FFC00003FFC00003F7C00003E7C00003E7E00007E3E00007C3E00007C1F0000F81F0000NF80F8001F007C003E003E007C000F81F00007FFE00000FF000>32 34 -3 0 39]79 dc[28 34 -2 0 34]80 dc[<000000F0000001FC000003FCN000003FE000007FE000007FF00000787000007030000060100000601000FFC01007FFE0000FC1FN0003EC0FC007CC1BE00F8E31F01F07E0F81F03C0F83E00007C3E00007C7E00007E7C00003E7C00N003EFC00003FFC00003FFC00003FFC00003FFC00003FFC00003FFC00003FFC00003F7C00003E7EN00007E7E00007E3E00007C3E00007C1F0000F81F0000F80F8001F007C003E003E007C000F81F00M007FFE00000FF000>32 44 -3 10 39]81 dc[34 34 -2N0 37]82 dc[<80FE00C7FF80FF03C0F801E0F000E0E00070E00070C00078C00078C00078000078N0000F80000F80001F0000FF000FFE007FFE00FFFC01FFF003FFC007FC0007E0000F80000F80000MF00030F00030F00030F000707000707800F03801F01E07700FFE3003F810>21 34 -3 0 28]83Ndc[<03FFFF8003FFFF800007C0000007C0000007C0000007C0000007C0000007C0000007C00000N07C0000007C0000007C0000007C0000007C0000007C0000007C0000007C0000007C0000007C000N0007C0000007C0000007C000C007C006C007C006C007C006C007C006E007C00EE007C00E6007C0N0C6007C00C7007C01C7C07C07C7FFFFFFC7FFFFFFC>31 34 -2 0 36]84 dc[<0007F000001FFCN00003C0E0000F0030000E0018001E0018003E000C003C000C007C0006007C0006007C0006007C0N006007C0006007C0006007C0006007C0006007C0006007C0006007C0006007C0006007C0006007NC0006007C0006007C0006007C0006007C0006007C0006007C0006007C0006007C0006007C00060N07C001F8FFFE0FFFFFFE0FFF>32 34 -2 0 37]85 dc[<0000C000000001E000000001E0000000N01E000000003F000000003F000000003F000000007D800000007D80000000FDC0000000F8C0000N000F8C0000001F8E0000001F060000001F060000003E030000003E030000003E030000007C0180N00007C01800000FC01C00000F800C00000F800C00001F800600001F000600001F000600003E000M300003E000300003E000300007C000180007C00018000FC0003E00FFFC01FFC0FFFC01FFC0>34N34 -1 0 37]86 dc[<00030000C00000070000E00000078001E00000078001E000000F8001F000N000FC003F000000FC003F000001FC003F800001FE007F800001F6007D800001F6007D800003E60N07CC00003E300F8C00003E300F8C00007C300F8600007C181F0600007C181F060000F8181F0300N00F81C3F030000F80C3E030001F80C3E038001F00E7E018001F0067C018001F0067C018003E006N7C00C003E003F800C003E003F800C007C003F8006007C001F0006007C001F000600F8001F00070N0FC003F000F8FFFC3F=o2~ HCOMPRESS.BCKy[HCOMPRESS.DOC]PAPER.PS;1N|lFF07FFFFFC3FFF07FF>48 34 -1 0 51]87 dc[24 34 -3 0 30]90 dc[<3C0F007E1F807E1F80FE3F80FE3FM80FC3F00C03000C03000C03000601800601800701C00300C001806001C07000C0300>17 16 -5M-19 25]92 dc[<3C7E7EFEFEFCC0C0C060607030181C0C>7 16 -3 -19 14]96 dc[<0FC1E03FNF3F87C3FDC7C0F8CF8078CF8078CF8078CF807807C07803E07801F07800FFF8003FF8000078018N07803C07807E07807E0F007E1E003FFC000FF000>22 21 -2 0 25]97 dc[<0C1F800E7FE00EE0NF00F80780F003C0F003E0F001E0F001F0F001F0F001F0F001F0F001F0F001F0F001F0F001E0F00N1E0F003C0F803C0FE0F80F7FE00F0FC00F00000F00000F00000F00000F00000F00000F00000F00N000F00000F00001F0000FF0000FF00000F0000>24 35 -1 0 28]98 dc[<01F80007FE000F8300N1E01803C00C07C00C07C0000F80000F80000F80000F80000F80000F80000F800007806007C0F00N3C1F801E1F800F1F8007FF0001FC00>18 21 -2 0 22]99 dc[<03F0FF07FCFF1F07F83C01F03CN00F07800F07800F0F800F0F800F0F800F0F800F0F800F0F800F0F800F07800F07C00F03C00F01EN01F00F07F007FEF001F8F00000F00000F00000F00000F00000F00000F00000F00000F00000F000M00F00001F0000FF0000FF00000F0>24 35 -2 0 28]100 dc[<00FC0007FF000F83801E00C03CN00607C0060780000F80000F80000F80000F80000F80000FFFFE0FFFFE07801E07C03E03C03C01EM03C00F0F8007FF0001FC00>19 21 -1 0 22]101 dc[<7FFC007FFC0007800007800007800007N800007800007800007800007800007800007800007800007800007800007800007800007800007N8000FFF800FFF800078000078000078000078000078000078000078000078780078FC003CFC001NCFC000E7C0007F80001F00>18 35 0 0 15]102 dc[<01FE000FFFC01E01E0380070700038E000N1CE0001CE0001CE0001C70003C7800F83FFFF81FFFF01FFFC03FFF0038000038000030000033F8N001FFE001E0F003C07803C07807C07C07C07C07C07C07C07C03C07803C07BC1E0FBC0FFFFC03F8N78>22 32 -1 11 25]103 dc[25 35N-1 0 28]104 dc[11N34 0 0 13]105 dc[<1F807FE078F0FC78FC38FC3C783C003C003C003C003C003C003C003C003CN003C003C003C003C003C003C003C003C003C003C003C003C007C03FC03FC003C00000000000000M00000000000000007800FC00FC00FC00FC0078>14 44 3 10 15]106 dc[23 35 -1 0 26]107 dc[12 35 0 0 13]108 dc[40 21 -1 0 43]109 dc[25 21 -1 0 28]110 dc[<00FC0007FF800F03C01E01E03C00F07C00F8780078F8007CF800M7CF8007CF8007CF8007CF8007CF8007C7800787800783C00F01E01E00F03C007FF8000FC00>22M21 -1 0 25]111 dc[24 31 -1 10 28]112 dc[<001FNFE001FFE0001E00001E00001E00001E00001E00001E00001E00001E003F1E00FF9E01F0FE03E03NE03C03E07C01E07C01E0F801E0F801E0F801E0F801E0F801E0F801E0F801E07C01E07C01E03C03NE01E03E00F0EE007FCE001F060>23 31 -2 10 26]113 dc[17 21 -1 0 20]114 dc[<87E0FFF8F83CF00CE00EE00EC00EC01E00M7E07FC1FF83FF07FE0FC00F000E00CE00C601C703C3FFC0FCC>15 21 -2 0 20]115 dc[<01E0N03F007980F0C0F0C0F0C0F0C0F0C0F0C0F000F000F000F000F000F000F000F000F000F00FFF8FFMF83F001F000F000700070007000300030003000300>14 31 -1 0 19]116 dc[<01FC7F8003FEN7F800783FC000F01F8000F00F8000F0078000F0078000F0078000F0078000F0078000F0078000FN0078000F0078000F0078000F0078000F0078000F0078001F00F800FF07F800FF07F8000F007800M>25 21 -1 0 28]117 dc[<003800003800007C00007C00007C0000FE0000F60000F60001E300N01E30001E30003C18003C18007C1C00780C00780C00F00600F00601F00F8FFE3FEFFE3FE>23 21N-1 0 26]118 dc[<00700700000070070000007007000000F80F800000F80F800000F80F800001NEC1EC00001EC1EC00001EC1CC00003C63C600003C63C600003C638600007837830000783783000L07837030000F01F018000F01F018000F01E01C001F01E03E00FFCFFCFF80FFCFFCFF80>33 21N-1 0 36]119 dc[25 21 0 0 26]120 dc[<3E00007F0000E38000C0C000FCC0N00FC6000786000007000003000003000003800003800007C00007C00007C0000FE0000F60000F6N0001E30001E30001E30003C18003C18007C1C00780C00780C00F00600F00601F00F8FFE3FEFFE3NFE>23 31 -1 10 26]121 dc[18N21 -1 0 22]122 dc[24 2 0 -12 25]123 dc[49 2 0 -12 50]124 dc[<7038F87CFCFCFCFCF87C7038>14 6 -5 -28 25]127 dc dfeend %%EndProlog %%BeginSetup%%Feature: *Resolution 300 TeXDict begin @letter %%EndSetup %%Page: 1 1K bop 130 50 a fa(High-P)n(erformance)24 b(Compression)g(of)f(Astronomical)hN(Images)783 173 y fb(Ric)o(hard)16 b(L.)g(White)241 249 y(Join)o(t)h(Institut\Ne)h(for)e(Lab)q(oratory)g(Astroph)o(ysics,)g(Univ)o(ersit)o(y)h(of)g(Colorado)N566 308 y(Campus)d(Bo)o(x)j(440,)f(Boulder,)g(CO)h(80309)935 368 y(and)611 428Ny(Space)g(T)l(elescop)q(e)g(Science)g(Institute)475 488 y(3700)f(San)g(Martin)Jh(Driv)o(e,)f(Baltimore,)h(MD)g(21218)828 563 y(rlw@stsci.edu)845 687 y fcM(Summary)0 794 y fi(Astronomical)j(images)g(ha)o(v)o(e)f(some)g(rather)h(un)oN(usual)f(c)o(haracteristics)i(that)g(mak)o(e)e(man)o(y)f(existing)0 854 y(ima\Nge)g(compression)e(tec)o(hniques)i(either)h(ine\013ectiv)o(e)i(or)d(inapplica\Nble.)30 b(A)18 b(t)o(ypical)i(image)e(consists)0 913 y(of)f(a)f(nearly)h(\015\Nat)f(bac)o(kground)f(sprinkled)h(with)i(p)q(oin)o(t)e(sources)g(and)f(o)q(cca\Msional)j(extended)e(sources.)0 973 y(The)h(images)e(are)i(often)g(noisy)l(,)fM(so)h(that)g(lossless)g(compression)d(do)q(es)j(not)g(w)o(ork)f(v)o(ery)g(w)oN(ell;)i(further-)0 1033 y(more,)k(the)h(images)e(are)h(usually)i(sub)s(jected)Le(to)h(stringen)o(t)f(quan)o(titativ)o(e)j(analysis,)f(so)f(an)o(y)f(lossy)0J1093 y(compression)16 b(metho)q(d)g(m)o(ust)g(b)q(e)i(pro)o(v)o(en)f(not)hN(to)g(discard)f(useful)i(information,)e(but)h(m)o(ust)e(instead)0 1153 y(disc\Nard)e(only)h(the)f(noise.)21 b(Finally)l(,)c(the)d(images)f(can)h(b)q(e)h(ext\Mremely)f(large.)22 b(F)l(or)13 b(example,)h(the)g(Space)0 1212 y(T)l(elescop)Jq(e)g(Science)f(Institute)h(has)e(digitized)j(photographic)d(plates)h(co)oN(v)o(ering)g(the)g(en)o(tire)g(sky)l(,)g(gener-)0 1272 y(ating)h(1500)e(image\Ls)g(eac)o(h)h(ha)o(ving)f(14000)t fe(\002)t fi(14000)g(16-bit)h(pixels.)22 bM(Sev)o(eral)13 b(astronomical)f(groups)f(are)0 1332 y(no)o(w)k(constructing)hM(cameras)e(with)j(mosaics)e(of)h(large)h(CCDs)f(\(eac)o(h)g(2048)9 b fe(\002)Mh fi(2048)16 b(or)g(larger\);)g(these)0 1392 y(instrumen)o(ts)h(will)22 b(b)qN(e)e(used)f(in)h(pro)s(jects)f(that)h(generate)f(data)h(at)g(a)f(rate)h(excee\Lding)g(100)g(MBytes)0 1451 y(ev)o(ery)d(5)f(min)o(utes)f(for)h(man)o(y)f(y)oN(ears.)100 1527 y(An)e(e\013ectiv)o(e)h(tec)o(hnique)g(for)e(image)g(compress\Lion)f(ma)o(y)g(b)q(e)i(based)f(on)g(the)h(H-transform)d(\(F)l(ritze)0 1587 yLfb(et)19 b(al)p fi(.)g(1977\).)27 b(The)18 b(metho)q(d)f(that)i(w)o(e)f(ha)oM(v)o(e)f(dev)o(elop)q(ed)i(can)f(b)q(e)h(used)e(for)h(either)h(lossless)g(or)Lf(lossy)0 1647 y(compression.)h(The)c(digitized)i(sky)e(surv)o(ey)g(images)fN(can)g(b)q(e)h(compressed)d(b)o(y)j(at)g(least)h(a)f(factor)g(of)g(10)0 1706 yN(with)h(no)g(noticeable)h(losses)e(in)h(the)g(astrometric)f(and)f(photometric)Mh(prop)q(erties)g(of)h(the)g(compressed)0 1766 y(images.)31 b(The)20 b(metho)Kq(d)f(has)g(b)q(een)h(designed)g(to)g(b)q(e)h(computationally)g(e\016cien)oJ(t:)29 b(compression)18 b(or)0 1826 y(decompression)11 b(of)i(a)g(512)t feL(\002)t fi(512)h(image)e(requires)i(only)g(4)f(seconds)f(on)h(a)g(Sun)f(SP)lL(AR)o(Cstation)h(1.)21 b(The)0 1886 y(algorithm)d(uses)g(only)h(in)o(teger)gN(arithmetic,)g(so)f(it)i(is)f(completely)g(rev)o(ersible)g(in)g(its)h(lossles\Js)f(mo)q(de,)0 1945 y(and)d(it)i(could)f(easily)h(b)q(e)f(implemen)o(ted)dJ(in)j(hardw)o(are)e(for)h(space)g(applications.)773 2069 y fc(1.)25 b(In)nM(tro)r(duction)0 2176 y fi(Astronomical)15 b(images)f(consist)h(largely)h(of)Nf(empt)o(y)f(sky)l(.)22 b(Compression)12 b(of)j(suc)o(h)f(images)g(can)h(redu\Kce)0 2236 y(the)h(v)o(olume)e(of)h(data)h(that)f(it)i(is)f(necessary)e(to)iN(store)f(\(an)g(imp)q(ortan)o(t)f(consideration)i(for)f(large)g(scale)0 2295 yM(digital)f(sky)f(surv)o(eys\))e(and)g(can)h(shorten)f(the)h(time)g(required)fM(to)i(transmit)d(images)h(\(useful)i(for)e(remote)0 2355 y(observing)16 b(or)Ng(remote)f(access)i(to)g(data)f(arc)o(hiv)o(es.\))100 2431 y(Data)22 b(compre\Mssion)e(metho)q(ds)g(can)i(b)q(e)g(classi\014ed)h(as)e(either)i(\\lossless")fN(\(meaning)f(that)i(the)0 2491 y(original)16 b(data)f(can)g(b)q(e)g(reconstru\Ncted)f(exactly)j(from)d(the)h(compressed)d(data\))j(or)g(\\lossy")g(\(meaning)M0 2550 y(that)i(the)g(uncompressed)d(image)i(is)h(not)g(exactly)i(the)e(same)Me(as)i(the)g(original.\))25 b(Astronomers)14 b(often)0 2610 y(insist)i(that)gN(they)g(can)f(accept)g(only)h(lossless)g(compression,)d(in)i(part)g(b)q(ecaus\Ne)g(of)h(conserv)m(atism,)e(and)0 2670 y(in)j(part)g(b)q(ecause)f(the)h(famil\Kiar)h(lossy)f(compression)d(metho)q(ds)h(sacri\014ce)i(some)e(information)h(that)i(is)g eop %%Page: 2 2N bop 0 50 a fi(needed)13 b(for)g(accurate)g(analysis)i(of)e(image)g(data.)21 bN(Ho)o(w)o(ev)o(er,)13 b(since)h(all)h(astronomical)d(images)h(con)o(tain)0 110Ny(noise,)i(whic)o(h)g(is)g(inheren)o(tly)g(incompressible,)f(lossy)h(compress\Lion)d(metho)q(ds)h(pro)q(duce)h(m)o(uc)o(h)d(b)q(etter)0 169 y(compression)jN(results.)100 245 y(A)19 b(simple)f(example)g(ma)o(y)f(mak)o(e)g(this)i(clear\K.)29 b(One)18 b(of)h(the)f(simplest)h(data)f(compression)e(tec)o(h-)0 305 yN(niques)g(is)h(run-length)e(co)q(ding,)h(in)h(whic)o(h)f(runs)e(of)i(consecut\Miv)o(e)h(pixels)g(ha)o(ving)f(the)g(same)e(v)m(alue)j(are)0 365 y(compressed)Nf(b)o(y)j(storing)g(the)h(pixel)h(v)m(alue)f(and)f(the)g(rep)q(etition)i(fact\Nor.)30 b(This)19 b(metho)q(d)f(is)i(used)e(in)0 424 y(the)j(standard)f(compre\Lssion)f(sc)o(heme)g(for)i(facsimile)h(transmissions.)34 b(Unfortunately)l(,)M23 b(it)f(is)g(quite)0 484 y(ine\013ectiv)o(e)h(for)e(lossless)h(compression)Nd(of)i(astronomical)g(images)f(b)q(ecause)h(ev)o(en)g(though)f(the)i(sky)0 544My(is)d fb(nearly)h fi(constan)o(t,)f(the)g(noise)g(in)g(the)h(sky)f(ensures)eN(that)j(only)f(v)o(ery)g(short)f(runs)g(of)h(equal)h(pixels)0 604 y(o)q(ccur.)Kh(The)16 b(ob)o(vious)f(w)o(a)o(y)g(to)h(mak)o(e)e(run-length)g(co)q(ding)iN(more)e(e\013ectiv)o(e)j(is)f(to)g(force)f(the)h(sky)g(to)g(b)q(e)0 664 y(exa\Nctly)j(constan)o(t)e(b)o(y)g(setting)h(all)h(pixels)f(b)q(elo)o(w)g(a)f(thres\Mhold)g(\(c)o(hosen)f(to)i(b)q(e)f(just)g(ab)q(o)o(v)o(e)g(the)g(sky\))0 723 yK(to)f(the)g(mean)e(sky)j(v)m(alue.)22 b(Ho)o(w)o(ev)o(er,)16 b(then)f(one)hM(has)f(lost)i(an)o(y)e(information)g(ab)q(out)h(ob)s(jects)g(close)h(to)0 783Jy(the)e(detection)i(limit.)23 b(One)15 b(has)f(also)i(lost)g(information)eJ(ab)q(out)h(lo)q(cal)j(v)m(ariations)e(in)g(the)f(sky)h(brigh)o(t-)0 843 yM(ness,)k(whic)o(h)f(sev)o(erely)i(limits)g(the)f(accuracy)f(of)h(photometry)eK(and)h(astrometry)f(on)i(fain)o(t)g(ob)s(jects.)0 903 y(W)l(orse,)f(there)gM(ma)o(y)e(b)q(e)i(extended,)h(lo)o(w)f(surface)f(brigh)o(tness)g(ob)s(jects)hM(that)g(are)g(not)g(detectable)h(in)0 962 y(a)e(single)h(pixel)h(but)e(that)hJ(are)e(easily)j(detected)f(when)f(the)g(image)g(is)g(smo)q(othed)f(o)o(v)oN(er)g(a)h(n)o(um)o(b)q(er)d(of)0 1022 y(pixels;)h(suc)o(h)c(fain)o(t)i(struct\Mures)f(are)g(irretriev)m(ably)i(lost)g(when)e(the)g(image)g(is)h(thresholded)Nf(to)h(impro)o(v)o(e)0 1082 y(compression.)717 1205 y fc(2.)25 b(The)19 b(H-t\Kransform)0 1313 y fi(F)l(ritze)k fb(et)f(al)p fi(.)h(\(1977;)i(see)d(also)hL(Ric)o(h)o(ter)f(1978)g(and)f(Capaccioli)k fb(et)e(al)p fi(.)g(1988\))f(ha)oL(v)o(e)f(dev)o(elop)q(ed)i(a)0 1373 y(m)o(uc)o(h)d(b)q(etter)j(compression)cL(metho)q(d)i(for)h(astronomical)g(images)f(based)h(on)g(what)g(they)h(call)hL(the)0 1433 y fb(H-transform)15 b fi(of)i(the)h(image.)23 b(A)18 b(similar)fN(transform)e(called)k(the)e(S-transform)d(has)j(also)g(b)q(een)h(used)0 1492 yJ(for)e(image)g(compression)f(\(Blume)h(&)h(F)l(and)e(1989\).)22 b(The)17 bM(H-transform)c(is)18 b(a)e(t)o(w)o(o-dimensional)g(gen-)0 1552 y(eralization)Lg(of)f(the)f(Haar)g(transform)d(\(Haar)k(1910\).)21 b(The)14 b(H-transform)dK(is)k(calculated)h(for)e(an)g(image)0 1612 y(of)j(size)g(2)176 1594 y ff(N)J225 1612 y fe(\002)11 b fi(2)300 1594 y ff(N)354 1612 y fi(as)16 b(follo)oM(ws:)50 1720 y fe(\016)25 b fi(Divide)19 b(the)e(image)f(up)h(in)o(to)g(blo)qJ(c)o(ks)h(of)f(2)11 b fe(\002)g fi(2)17 b(pixels.)25 b(Call)19 b(the)e(4)gM(pixels)i(in)e(a)g(blo)q(c)o(k)h fg(a)1794 1727 y fh(00)1837 1720 y fi(,)f fgJ(a)1894 1727 y fh(10)1936 1720 y fi(,)100 1779 y fg(a)126 1786 y fh(01)168L1779 y fi(,)g(and)e fg(a)321 1786 y fh(11)364 1779 y fi(.)50 1855 y fe(\016)J25 b fi(F)l(or)15 b(eac)o(h)h(blo)q(c)o(k)i(compute)d(4)h(co)q(e\016cien)oN(ts:)645 1981 y fg(h)674 1988 y fh(0)710 1981 y fi(=)d(\()p fg(a)807 1988 y fhN(11)861 1981 y fi(+)e fg(a)937 1988 y fh(10)991 1981 y fi(+)g fg(a)1067 1988 yMfh(01)1120 1981 y fi(+)g fg(a)1196 1988 y fh(00)1239 1981 y fi(\))p fg(=)p fiL(2)642 2056 y fg(h)671 2063 y ff(x)710 2056 y fi(=)i(\()p fg(a)807 2063 y fhJ(11)861 2056 y fi(+)e fg(a)937 2063 y fh(10)991 2056 y fe(\000)g fg(a)1067M2063 y fh(01)1120 2056 y fe(\000)g fg(a)1196 2063 y fh(00)1239 2056 y fi(\))pKfg(=)p fi(2)643 2130 y fg(h)672 2137 y ff(y)710 2130 y fi(=)i(\()p fg(a)807L2137 y fh(11)861 2130 y fe(\000)e fg(a)937 2137 y fh(10)991 2130 y fi(+)g fgM(a)1067 2137 y fh(01)1120 2130 y fe(\000)g fg(a)1196 2137 y fh(00)1239 2130 yMfi(\))p fg(=)p fi(2)647 2205 y fg(h)676 2212 y ff(c)710 2205 y fi(=)i(\()p fgL(a)807 2212 y fh(11)861 2205 y fe(\000)e fg(a)937 2212 y fh(10)991 2205 y feM(\000)g fg(a)1067 2212 y fh(01)1120 2205 y fi(+)g fg(a)1196 2212 y fh(00)1239M2205 y fi(\))p fg(=)p fi(2)50 2323 y fe(\016)25 b fi(Construct)15 b(a)h(2)398N2305 y ff(N)t fd(\000)p fh(1)497 2323 y fe(\002)10 b fi(2)571 2305 y ff(N)t fdM(\000)p fh(1)676 2323 y fi(image)15 b(from)g(the)h fg(h)1051 2330 y fh(0)1089J2323 y fi(v)m(alues)h(for)f(eac)o(h)g(2)10 b fe(\002)g fi(2)16 b(blo)q(c)oL(k.)23 b(Divide)18 b(that)100 2383 y(image)f(up)g(in)o(to)h(2)12 b fe(\002)fNfi(2)18 b(blo)q(c)o(ks)g(and)f(rep)q(eat)h(the)g(ab)q(o)o(v)o(e)g(calculation\N.)27 b(Rep)q(eat)18 b(this)h(pro)q(cess)e fg(N)100 2443 y fi(times,)e(reducin\Jg)f(the)i(image)f(in)g(size)h(b)o(y)f(a)h(factor)f(of)g(2)h(at)f(eac)o(h)gN(step,)g(un)o(til)i(only)f(one)f fg(h)1801 2450 y fh(0)1838 2443 y fi(v)m(alu\Me)100 2503 y(remains.)0 2610 y(This)20 b(calculation)i(can)d(b)q(e)h(easily)iL(in)o(v)o(erted)d(to)h(reco)o(v)o(er)f(the)h(original)h(image)e(from)f(its)jN(transform.)0 2670 y(The)15 b(transform)e(is)j(exactly)h(rev)o(ersible)f(usin\Mg)f(in)o(teger)h(arithmetic)g(if)g(one)f(do)q(es)h(not)f(divide)i(b)o(y)e(2)g (for)g eop %%Page: 3 3N bop 0 50 a fi(the)18 b(\014rst)f(set)g(of)h(co)q(e\016cien)o(ts.)26 b(It)17 bK(is)i(straigh)o(tforw)o(ard)c(to)j(extend)g(the)g(de\014nition)g(of)g(the)gN(transform)0 110 y(so)f(that)g(it)i(can)e(b)q(e)g(computed)e(for)i(non-square)Je(images)h(that)i(do)f(not)g(ha)o(v)o(e)f(sides)h(that)h(are)f(p)q(o)o(w)oM(ers)0 169 y(of)g(2.)22 b(The)16 b(H-transform)e(can)j(b)q(e)g(p)q(erformed)dN(in)j(place)h(in)f(memor)o(y)d(and)i(is)h(v)o(ery)g(fast)g(to)g(compute,)0 229Ny(requiring)g(ab)q(out)g(16)p fg(M)458 211 y fh(2)480 229 y fg(=)p fi(3)g(\(i\Ln)o(teger\))g(additions)h(for)e(a)g fg(M)h fe(\002)11 b fg(M)22 b fi(image.)K100 303 y(The)c(H-transform)e(is)j(a)f(simple)g(2-dimensional)g(w)o(a)o(v)oL(elet)h(transform.)25 b(It)19 b(has)f(sev)o(eral)h(adv)m(an-)0 363 y(tages)iL(o)o(v)o(er)f(some)f(other)i(w)o(a)o(v)o(elet)g(transforms)d(that)j(ha)o(v)oK(e)f(b)q(een)h(applied)h(to)f(image)f(compression)0 423 y(\()p fb(e.g.)p fiK(,)15 b(Daub)q(ec)o(hies)g(1988\).)21 b(First,)15 b(the)g(transform)d(can)jN(b)q(e)g(p)q(erformed)d(en)o(tirely)k(with)g(in)o(teger)f(arith-)0 482 y(meti\Jc,)g(making)f(it)i(exactly)h(rev)o(ersible.)22 b(Consequen)o(tly)15 b(it)hN(can)f(b)q(e)g(used)f(for)h(either)g(lossless)g(or)g(lossy)0 542 y(compressio\Mn)h(\(as)j(indicated)h(b)q(elo)o(w\))f(and)f(one)h(do)q(es)f(not)h(need)f(a)hN(sp)q(ecial)h(tec)o(hnique)f(for)f(the)h(case)0 602 y(of)e(lossless)g(compres\Jsion)d(\(as)i(w)o(as)g(required,)g fb(e.g.)p fi(,)h(,)f(for)g(the)h(JPEG)fM(compression)e(standard.\))100 676 y(A)g(second)g(ma)s(jor)e(adv)m(an)o(tage)Lh(is)i(that)f(the)h(H-transform)c(is)k(a)f(nativ)o(ely)i(2-dimensional)d(w)oM(a)o(v)o(elet)0 736 y(transform.)18 b(The)12 b(standard)f(1-dimensional)h(w)oK(a)o(v)o(elet)h(transforms)c(are)j(extended)h(to)f(t)o(w)o(o)g(dimensions)0J795 y(b)o(y)19 b(transforming)f(the)i(image)f(\014rst)f(along)i(the)g(ro)oM(ws,)f(then)h(along)g(the)g(columns.)29 b(Unfortunately)l(,)0 855 y(this)15 bL(generates)f(man)o(y)e(w)o(a)o(v)o(elet)j(co)q(e\016cien)o(ts)g(that)g(are)fM(high)h(frequency)f(\(hence)h(lo)q(calized\))i(in)e(the)g fg(x)p fi(-)0 915 yJ(direction)h(but)f(lo)o(w)g(frequency)g(\(hence)g(global\))h(in)f(the)g fgM(y)r fi(-direction.)23 b(Suc)o(h)13 b(co)q(e\016cien)o(ts)j(are)e(coun)o(ter)M0 975 y(to)i(the)h(philosoph)o(y)f(of)g(the)h(w)o(a)o(v)o(elet)f(transform:)jM(high-frequency)d(basis)g(functions)h(should)e(b)q(e)i(con-)0 1034 y(\014ned)Li(to)g(a)g(relativ)o(ely)k(small)c(area)f(of)i(the)g(image.)29 b(Discarding)N20 b(these)f(mixed-scale)g(terms,)f(whic)o(h)0 1094 y(ma)o(y)i(b)q(e)i(neglig\Nible)j(compared)19 b(to)j(the)g(noise,)h(generates)e(v)o(ery)h(ob)s(jectionab\Kle)h(artifacts)g(around)0 1154 y(p)q(oin)o(t)c(sources)f(and)g(edges)g(in)iJ(the)f(image.)28 b(The)18 b(H-transform,)f(on)h(the)h(other)g(hand,)f(is)hM(a)g(fully)h(2-)0 1214 y(dimensional)e(w)o(a)o(v)o(elet)g(transform,)d(with)kN(all)g(high)f(frequency)g(terms)e(b)q(eing)j(completely)f(lo)q(calized.)0 1274Ky(It)f(is)g(consequen)o(tly)g(more)e(suitable)i(for)g(image)f(compression)eJ(and)i(pro)q(duces)f(few)o(er)h(artifacts.)100 1347 y(A)11 b(p)q(ossible)hJ(disadv)m(an)o(tage)f(of)g(the)g(H-transform)e(is)i(that)h(other)e(w)o(a)oL(v)o(elet)i(transforms)c(tak)o(e)j(b)q(etter)0 1407 y(adv)m(an)o(tage)k(of)gM(the)h(con)o(tin)o(uit)o(y)g(of)f(pixel)i(v)m(alues)f(within)h(images,)d(so)hJ(that)g(they)h(can)f(pro)q(duce)f(higher)0 1467 y(compressions)h(for)j(v)oN(ery)g(smo)q(oth)e(images.)26 b(Ho)o(w)o(ev)o(er,)17 b(for)h(astromical)f(ima\Mges)g(\(whic)o(h)i(are)e(mostly)0 1527 y(\015at)12 b(sky)g(sprinkled)h(with)gN(p)q(oin)o(t)f(sources\))f(the)i(smo)q(othness)c(built)14 b(in)o(to)e(higher-\Korder)e(transforms)f(can)0 1587 y(actually)20 b(reduce)d(the)g(e\013ectiv)oJ(eness)i(of)f(compression,)d(b)q(ecause)i(one)h(m)o(ust)d(k)o(eep)j(more)dN(co)q(e\016cien)o(ts)0 1646 y(to)i(describ)q(e)g(eac)o(h)f(p)q(oin)o(t)h(sour\Mce.)475 1763 y fc(3.)25 b(Compression)17 b(Using)h(the)i(H-transform)0 1865 yNfi(If)d(the)g(image)g(is)g(nearly)g(noiseless,)h(the)f(H-transform)d(is)k(som\Kewhat)d(easier)i(to)g(compress)d(than)j(the)0 1924 y(original)f(image)e(b)qM(ecause)h(the)g(di\013erences)f(of)h(adjacen)o(t)g(pixels)h(\(as)e(computed)fM(in)i(the)g(H-transform\))0 1984 y(tend)j(to)h(b)q(e)g(smaller)e(than)i(the)fJ(original)i(pixel)g(v)m(alues)f(for)f(smo)q(oth)f(images.)27 b(Consequen)oJ(tly)18 b(few)o(er)0 2044 y(bits)h(are)f(required)g(to)h(store)f(the)g(v)mN(alues)h(of)g(the)g(H-transform)c(co)q(e\016cien)o(ts)k(than)f(are)g(required)Mg(for)0 2104 y(the)h(original)i(image.)28 b(F)l(or)18 b(v)o(ery)h(smo)q(oth)fJ(images)g(the)h(pixel)i(v)m(alues)f(ma)o(y)d(b)q(e)i(constan)o(t)g(o)o(v)oK(er)f(large)0 2164 y(regions,)e(leading)i(to)f(transform)c(co)q(e\016cien)oK(ts)18 b(that)e(are)h(zero)f(o)o(v)o(er)g(large)g(areas.)100 2237 y(Noisy)iJ(images)e(still)k(do)d(not)h(compress)c(w)o(ell)19 b(when)e(transformed,)dK(though.)24 b(Supp)q(ose)16 b(there)i(is)0 2297 y(noise)h fg(\033)i fi(in)fM(eac)o(h)e(pixel)j(of)e(the)g(original)i(image.)28 b(Then)18 b(from)f(simple)Mi(propagation)f(of)h(errors,)f(the)0 2357 y(noise)h(in)g(eac)o(h)g(of)g(the)gM(H-transform)d(co)q(e\016cien)o(ts)j(is)g(also)h fg(\033)r fi(.)29 b(T)l(o)18Mb(compress)e(noisy)j(images,)g(divide)0 2417 y(eac)o(h)f(co)q(e\016cien)o(t)iM(b)o(y)f fg(S)s(\033)r fi(,)g(where)f fg(S)i fe(\030)d fi(1)i(is)g(c)o(hosen)Nf(according)h(to)g(ho)o(w)f(m)o(uc)o(h)e(loss)j(is)g(acceptable.)0 2477 y(Thi\Ls)f(reduces)f(the)h(noise)g(in)h(the)f(transform)d(to)j(0)p fg(:)p fi(5)p fgL(=S)s fi(,)g(so)f(that)h(large)h(p)q(ortions)e(of)i(the)f(transform)0 2536 yL(are)e(zero)g(\(or)h(nearly)g(zero\))f(and)g(the)h(transform)d(is)j(highly)hJ(compressible.)100 2610 y(Wh)o(y)e(is)i(this)g(b)q(etter)f(than)g(simply)gL(thresholding)g(the)g(original)h(image?)k(As)c(discussed)e(ab)q(o)o(v)o(e,)0N2670 y(if)h(w)o(e)e(simply)h(divide)h(the)f(image)f(b)o(y)g fg(\033)j fi(then)Le(w)o(e)g(lose)g(all)h(information)e(on)h(ob)s(jects)f(that)h(are)g(within)geop %%Page: 4 4M bop 0 50 a fi(1)p fg(\033)19 b fi(of)e(sky)g(in)h(a)f fb(single)g fi(pixel,)Li(but)e(that)g(are)f(detectable)j(b)o(y)d(a)o(v)o(eraging)g(a)h fb(blo)q(c)oM(k)h fi(of)f(pixels.)24 b(On)17 b(the)0 110 y(other)g(hand,)f(in)i(dividing)hN(the)f(H-transform)d(b)o(y)i fg(\033)r fi(,)g(w)o(e)g(preserv)o(e)g(the)g(inf\Kormation)g(on)g(an)o(y)g(ob)s(ject)0 169 y(that)f(is)g(detectable)h(b)o(y)eN(summ)o(ing)e(a)j(blo)q(c)o(k)g(of)g(pixels!)23 b(The)15 b(quan)o(tized)h(H-t\Jransform)d(preserv)o(es)h(the)0 229 y(mean)f(of)j(the)f(image)g(for)f(ev)oM(ery)i(blo)q(c)o(k)g(of)f(pixels)h(ha)o(ving)g(a)f(mean)e(signi\014can)o(tly)Mk(di\013eren)o(t)e(than)g(that)0 289 y(of)i(neigh)o(b)q(oring)f(blo)q(c)o(ks)Nh(of)g(pixels.)100 362 y(As)j(an)f(example,)i(Figure)f(1)g(sho)o(ws)e(a)i(128)L13 b fe(\002)h fi(128)19 b(section)i(\(3)p fg(:)p fi(6)14 b fe(\002)f fi(3)pMfg(:)p fi(6)20 b(arcmin\))f(from)f(a)i(digi-)0 422 y(tized)f(v)o(ersion)f(of)Kh(the)f(P)o(alomar)f(Observ)m(atory{National)i(Geographic)f(So)q(ciet)o(y)iL(Sky)f(Surv)o(ey)e(plate)0 482 y(con)o(taining)h(the)f(Coma)f(cluster)h(of)gL(galaxies.)26 b(Figures)16 b(2,)h(3,)g(and)g(4)g(sho)o(w)f(the)h(resulting)hN(image)e(for)0 541 y fg(S)22 b fe(')d fi(0)p fg(:)p fi(5,)i(1,)f(and)g(2.)32 bJ(These)20 b(images)f(are)g(compressed)e(b)o(y)j(factors)g(of)g(10,)g(20,)hJ(and)e(60)h(using)g(the)0 601 y(co)q(ding)f(sc)o(heme)d(describ)q(ed)i(b)qM(elo)o(w.)28 b(In)19 b(all)h(cases)d(a)i(logarithmic)g(gra)o(y)e(scale)i(is)gM(used)f(to)h(sho)o(w)e(the)0 661 y(maxim)o(um)f(detail)22 b(in)f(the)f(image)Ng(near)f(the)i(sky)f(bac)o(kground)e(lev)o(el;)24 b(the)d(noise)f(is)h(clearl\Ky)h(visible)0 721 y(in)e(Figure)g(1.)31 b(The)19 b(image)g(compressed)e(b)oN(y)i(a)h(factor)g(of)g(10)f(is)h(hardly)g(distinguishable)h(from)d(the)0 781 yL(original.)43 b(In)22 b(quan)o(tizing)i(the)g(H-transform)c(w)o(e)j(ha)o(v)oK(e)f(adaptiv)o(ely)j(\014ltered)e(the)g(original)i(image)0 840 y(b)o(y)19 bN(discarding)g(information)g(on)g(some)e(scales)j(and)e(k)o(eeping)i(informati\Jon)f(on)g(other)f(scales.)31 b(This)0 900 y(adaptiv)o(e)14 b(\014ltering)iN(is)e(most)f(apparen)o(t)f(for)i(high)g(compression)e(factors)h(\(Fig.)i(4\),)Mg(where)e(the)h(sky)h(has)0 960 y(b)q(een)i(smo)q(othed)d(o)o(v)o(er)i(large)Mh(areas)f(while)i(the)f(images)e(of)i(stars)f(ha)o(v)o(e)f(hardly)i(b)q(een)gM(a\013ected.)100 1033 y(The)k(adaptiv)o(e)h(\014ltering)g(is,)h(in)f(itself,)Jj(of)d(considerable)f(in)o(terest)h(as)f(an)g(analytical)j(to)q(ol)f(for)0K1093 y(images)g(\(Capaccioli)j fb(et)e(al)p fi(.)g(1988\).)43 b(F)l(or)22 bL(example,)j(one)e(can)h(use)f(the)g(adaptiv)o(e)h(smo)q(othing)f(of)0 1153 yM(the)c(H-transform)d(to)j(smo)q(oth)e(the)i(sky)g(without)h(a\013ecting)g(ob)Ns(jects)f(detected)g(ab)q(o)o(v)o(e)f(the)h(\(lo)q(call)q(y)0 1213 y(determin\Ned\))13 b(sky;)i(then)g(an)f(accurate)g(sky)g(v)m(alue)i(can)e(b)q(e)g(determ\Mined)f(b)o(y)h(reference)g(to)g(an)o(y)g(nearb)o(y)0 1272 y(pixel.)100 1346 yL(The)e(blo)q(c)o(kiness)i(that)f(is)g(visible)i(in)f(Figure)e(4)h(is)g(the)gK(result)g(of)g(di\013erence)g(co)q(e\016cien)o(ts)g(b)q(eing)h(set)0 1405 yJ(to)f(zero)f(o)o(v)o(er)g(large)h(areas,)f(so)h(that)g(blo)q(c)o(ks)g(of)fL(pixels)i(are)f(replaced)f(b)o(y)h(their)g(a)o(v)o(erages.)19 b(It)13 b(is)gK(p)q(ossible)0 1465 y(to)21 b(eliminate)g(the)g(blo)q(c)o(ks)g(b)o(y)f(an)gL(appropriate)g(\014ltering)h(of)g(the)f(image.)33 b(A)21 b(simple)f(but)g(e\M\013ectiv)o(e)0 1525 y(\014lter)f(can)f(b)q(e)g(deriv)o(ed)g(b)o(y)g(simply)gM(adjusting)g(the)h(H-transform)c(co)q(e\016cien)o(ts)k(as)f(the)g(transform)eM(is)0 1585 y(in)o(v)o(erted)i(to)h(pro)q(duce)e(a)h(smo)q(oth)f(image;)h(as)gJ(long)g(as)g(c)o(hanges)f(in)h(the)h(co)q(e\016cien)o(ts)g(are)e(limited)jJ(to)0 1644 y fe(\006)p fg(S)s(\033)r(=)p fi(2,)c(the)g(resulting)i(image)eN(will)j(still)g(b)q(e)e(consisten)o(t)f(with)i(the)e(thresholded)g(H-transfor\Jm.)728 1758 y fc(4.)25 b(E\016cien)n(t)20 b(Co)r(ding)0 1858 y fi(The)14 bK(quan)o(tized)h(H-transform)c(has)j(a)g(rather)f(p)q(eculiar)j(structure.)kL(Not)15 b(only)g(are)e(large)i(areas)e(of)i(the)0 1918 y(transform)c(image)jM(zero,)g(but)g(the)h(non-zero)d(v)m(alues)j(are)f(strongly)g(concen)o(trated)Jg(in)h(the)f(lo)o(w)o(er-order)0 1978 y(co)q(e\016cien)o(ts.)28 b(The)18 bJ(b)q(est)h(approac)o(h)d(w)o(e)i(ha)o(v)o(e)g(found)f(to)i(co)q(de)g(the)fJ(co)q(e\016cien)o(t)h(v)m(alues)h(e\016cien)o(tly)g(is)0 2038 y(quadtree)eM(co)q(ding)h(of)f(eac)o(h)g(bitplane)h(of)f(the)h(transform)c(arra)o(y)l(.)25Nb(Quadtree)18 b(co)q(ding)g(has)g(b)q(een)g(used)0 2097 y(for)i(man)o(y)e(pur\Jp)q(oses)h(\(see)h(Samet)f(1984)h(for)g(a)g(review\);)j(the)d(particular)hN(form)d(w)o(e)i(are)g(using)g(w)o(as)0 2157 y(suggested)c(b)o(y)g(Huang)g(and)Kg(Bijaoui)i(\(1991\))f(for)f(image)g(compression.)50 2257 y fe(\016)25 b fiM(Divide)16 b(the)f(bitplane)h(up)e(in)o(to)h(4)g(quadran)o(ts.)20 b(F)l(or)13Kb(eac)o(h)h(quadran)o(t)g(co)q(de)h(a)f(`1')h(if)h(there)e(are)h(an)o(y)100M2317 y(1-bits)h(in)h(the)g(quadran)o(t,)e(else)j(co)q(de)e(a)h(`0'.)50 2390 yKfe(\016)25 b fi(Sub)q(divide)12 b(eac)o(h)f(quadran)o(t)f(that)i(is)g(not)gM(all)h(zero)e(in)o(to)h(4)f(more)f(pieces)i(and)f(co)q(de)h(them)e(similarly)Ml(.)100 2450 y(Con)o(tin)o(ue)16 b(un)o(til)h(one)g(is)g(do)o(wn)e(to)i(the)gM(lev)o(el)h(of)f(individual)i(pixels.)0 2550 y(This)14 b(co)q(ding)h(\(whic)oN(h)f(Huang)f(and)g(Bijauoi)j(call)g(\\hierarc)o(hic)d(4-bit)i(one")e(co)q(din\Ng\))i(is)g(ob)o(viously)f(v)o(ery)0 2610 y(w)o(ell)j(suited)e(to)h(the)g(H-tr\Lansform)c(image)j(b)q(ecause)g(successiv)o(ely)h(lo)o(w)o(er)f(orders)f(of)hN(the)h(H-transform)0 2670 y(co)q(e\016cien)o(ts)h(are)f(lo)q(cated)i(in)f(suc\?cessiv)o(ely)h(divided)g(quadran)o(ts)d(of)h(the)h(image.)g eop %%Page: 5 5K bop 100 50 a fi(W)l(e)25 b(follo)o(w)h(the)f(quadtree)g(co)q(ding)h(with)gK(a)f(\014xed)f(Hu\013man)g(co)q(ding)h(that)h(uses)e(3)h(bits)g(for)0 110 yM(quadtree)14 b(v)m(alues)g(that)g(are)g(common)c(\()p fb(e.g.)p fi(,)k(0001,)Mg(0010,)g(0100,)f(and)g(1000\))h(and)f(uses)g(4)h(or)f(5)h(bits)g(for)0 169 yN(less)g(common)d(v)m(alues.)21 b(This)14 b(reduces)f(the)h(\014nal)g(compress\Ned)d(\014le)j(size)h(b)o(y)f(ab)q(out)f(10%)g(at)i(little)i(com-)0 229 y(puta\Ktional)g(cost.)k(Sligh)o(tly)d(b)q(etter)e(compression)d(can)i(b)q(e)h(ac)oN(hiev)o(ed)f(b)o(y)g(follo)o(wing)i(quadtree)e(co)q(ding)0 289 y(with)j(arith\Lmetic)f(co)q(ding)h(\(Witten,)h(Bell,)h(and)c(Cleary)i(1987\),)f(but)g(the)gJ(CPU)h(costs)e(of)i(arithmetic)0 349 y(co)q(ding)k(are)f(not,)h(in)g(our)fL(view,)j(justi\014ed)d(for)h(3{4%)e(b)q(etter)i(compression.)34 b(W)l(e)22 bN(ha)o(v)o(e)f(also)g(tried)0 408 y(using)16 b(arithmetic)g(co)q(ding)h(direct\Mly)h(on)d(the)i(H-transform,)c(with)k(v)m(arious)f(con)o(texts)g(of)g(neigh)oN(b)q(oring)0 468 y(pixels,)i(but)f(\014nd)f(it)i(to)f(b)q(e)g(b)q(oth)g(compu\Ktationally)h(ine\016cien)o(t)g(and)e(not)h(signi\014can)o(tly)h(b)q(etter)fL(than)0 528 y(quadtree)f(co)q(ding.)100 601 y(F)l(or)c(completely)j(random)cN(bitplanes,)16 b(quadtree)d(co)q(ding)i(can)e(actually)j(use)e(more)e(storage)Jh(than)0 660 y(simply)f(writing)i(the)f(bitplane)h(directly;)h(in)e(that)gM(case)g(w)o(e)f(just)g(dump)f(the)h(bitplane)i(with)f(no)g(co)q(ding.)100 733My(Note)19 b(that)g(b)o(y)f(co)q(ding)h(the)f(transform)e(one)i(bitplane)i(at)Lf(a)f(time,)h(the)f(compressed)e(data)i(can)0 793 y(b)q(e)g(view)o(ed)g(as)fJ(an)g(incremen)o(tal)g(description)h(of)f(the)h(image.)24 b(One)17 b(can)gM(initial)q(ly)k(transmit)16 b(a)i(crude)0 852 y(represen)o(tation)g(of)h(the)Jg(image)f(using)g(only)i(the)e(small)h(amoun)o(t)d(of)j(data)g(that)g(is)gM(required)f(for)h(the)0 912 y(sparsely)g(p)q(opulated,)h(most)d(signi\014can)Ko(t)j(bit)g(planes.)29 b(Then)19 b(the)g(lo)o(w)o(er)g(bit)h(planes)f(can)gN(b)q(e)g(added)0 972 y(one)c(b)o(y)g(one)g(un)o(til)i(the)f(desired)f(accurac\Ly)g(is)h(required.)21 b(This)16 b(could)g(b)q(e)f(useful,)h(for)f(example,)gM(if)i(the)0 1032 y(data)f(is)i(to)e(b)q(e)h(retriev)o(ed)g(from)e(a)h(remote)Mg(database)f(|)i(one)f(could)h(examine)f(the)h(crude)f(v)o(ersion)g(of)0 1091Jy(the)f(image)g(\(retriev)o(ed)g(v)o(ery)g(quic)o(kly\))j(and)c(ab)q(ort)hK(the)g(transmission)f(of)h(the)g(rest)g(of)g(the)h(data)f(if)h(the)0 1151 yK(image)g(is)h(judged)f(to)h(b)q(e)g(unin)o(teresting.)128 1262 y fc(5.)25 bN(Astrometric)19 b(and)f(Photometric)h(Prop)r(erties)f(of)g(Compressed)g(Image\Ls)0 1360 y fi(Astronomical)11 b(images)g(are)h(not)g(simply)f(sub)s(jected)gK(to)i(visual)g(examination,)f(but)g(are)f(also)i(sub)s(jected)0 1420 y(to)hK(careful)f(quan)o(titativ)o(e)i(analysis.)22 b(F)l(or)12 b(example,)h(for)gM(the)h(image)e(in)i(Figure)f(1)g(one)g(w)o(ould)g(t)o(ypically)0 1479 y(lik)oN(e)22 b(to)f(do)f(astrometric)f(\(p)q(ositional\))24 b(measurem)o(en)n(ts)18 bM(of)i(ob)s(jects)h(to)f(an)g(accuracy)h(m)o(uc)o(h)c(b)q(etter)0 1539 y(than)M22 b(1)g(pixel,)j(photometric)d(\(brigh)o(tness\))f(measurem)o(en)o(ts)e(of)jN(ob)s(jects)g(to)h(an)f(accuracy)g(limited)0 1599 y(only)g(b)o(y)e(the)h(dete\Jctor)g(resp)q(onse)f(and)g(the)h(noise,)h(and)e(accurate)g(measurem)o(en)oN(ts)e(of)j(the)g(surface)0 1659 y(brigh)o(tness)15 b(of)i(extended)g(sources.)M100 1731 y(W)l(e)e(ha)o(v)o(e)f(done)g(some)f(exp)q(erimen)o(ts)h(to)h(study)Mg(the)g(degradation)f(of)h(astrometry)e(and)h(photom-)0 1791 y(etry)22 b(on)fN(the)h(compressed)c(images)j(compared)e(to)i(the)h(original)h(images)d(\(Whit\Je,)25 b(P)o(ostman,)20 b(and)0 1851 y(Lattand'~ HCOMPRESS.BCKy[HCOMPRESS.DOC]PAPER.PS;1N wzi)k(1991\).)39 b(Ev)o(en)22 bK(the)h(most)d(highly)k(compressed)19 b(images)j(ha)o(v)o(e)f(v)o(ery)h(go)qK(o)q(d)h(photometric)0 1911 y(prop)q(erties)c(for)g(b)q(oth)g(p)q(oin)o(t)hM(sources)e(and)g(extended)i(sources;)f(indeed,)h(photometry)d(of)j(extended)0J1970 y(ob)s(jects)h(can)g(b)q(e)g(impro)o(v)o(ed)e(b)o(y)i(the)g(adaptiv)oJ(e)h(\014ltering)g(of)f(the)g(H-transform)e(\(Cappacioli)k fb(et)e(al)p fiK(.)0 2030 y(1988\).)28 b(Astrometry)18 b(is)h(hardly)g(a\013ected)g(b)o(y)fL(the)h(compression)d(for)j(mo)q(dest)e(compression)f(factors)0 2090 y(\(up)cM(to)h(ab)q(out)f(a)h(factor)f(of)h(20)f(for)g(our)f(digitized)k(photographic)Jd(plates\),)i(but)e(do)q(es)g(b)q(egin)h(to)g(degrade)0 2150 y(for)j(the)hM(most)e(highly)j(compressed)13 b(images.)100 2222 y(These)23 b(results)h(are)Jg(based)f(on)g(tests)h(carried)g(out)g(with)h(to)q(ols)g(optimized)f(for)fK(the)i(original)0 2282 y(images;)14 b(it)h(is)g(lik)o(ely)i(the)d(b)q(est)gN(results)g(will)j(b)q(e)d(obtained)g(for)g(highly)h(compressed)c(images)i(onl\Jy)i(with)0 2342 y(analysis)k(to)q(ols)h(sp)q(eci\014cally)h(adapted)d(to)hN(the)g(p)q(eculiar)h(noise)e(c)o(haracteristics)h(of)g(the)g(compressed)0 2402Ly(images.)782 2512 y fc(6.)25 b(Conclusions)0 2610 y fi(In)18 b(order)f(to)iM(construct)f(the)h(Guide)f(Star)g(Catalog)i(for)e(use)g(in)h(p)q(oin)o(ting)gN(the)g(Hubble)f(Space)g(T)l(ele-)0 2670 y(scop)q(e,)c(the)h(Space)e(T)l(elesc\Nop)q(e)i(Science)g(Institute)g(scanned)e(and)h(digitized)i(wide-\014eld)f(pho\tographic)g eop %%Page: 6 6J bop 0 50 a fi(plates)18 b(co)o(v)o(ering)g(the)g(en)o(tire)g(sky)l(.)25 bM(The)18 b(digitized)i(plates)e(are)f(of)h(great)g(utilit)o(y)l(,)i(but)e(to)gJ(date)g(it)h(has)0 110 y(b)q(een)i(imp)q(ossible)g(to)g(distribute)g(the)gJ(scans)f(b)q(ecause)h(of)g(the)g(massiv)o(e)e(v)o(olume)h(of)h(data)f(in)oK(v)o(olv)o(ed)0 169 y(\(a)d(total)i(of)e(ab)q(out)g(600)g(Gb)o(ytes\).)24 bJ(Using)18 b(the)f(compression)e(tec)o(hniques)i(describ)q(ed)g(in)h(this)gN(pap)q(er,)0 229 y(w)o(e)h(plan)g(to)g(distribute)g(our)f(digital)k(sky)d(sur\Kv)o(ey)f(on)g(CD-R)o(OMs;)g(ab)q(out)h(100)g(CD-R)o(OMs)d(will)22 b(b)q(e)0N289 y(required)16 b(if)i(the)f(surv)o(ey)f(is)h(compressed)c(b)o(y)j(a)h(fact\Mor)g(of)f(10.)100 364 y(The)21 b(algorithm)g(describ)q(ed)h(in)g(this)g(pap)qK(er)f(has)g(b)q(een)g(sho)o(wn)f(to)i(b)q(e)g(capable)g(of)g(pro)q(ducing)0K423 y(highly)f(compressed)c(images)i(that)h(are)f(v)o(ery)h(faithful)i(to)eJ(the)g(original.)33 b(Algorithms)19 b(designed)h(to)0 483 y(w)o(ork)d(on)hK(the)g(original)h(images)e(can)g(giv)o(e)i(comparable)d(results)h(on)h(ob)sN(ject)g(detection,)h(astrometry)l(,)0 543 y(and)j(photometry)g(when)h(applied)Jh(to)f(the)h(images)e(compressed)e(b)o(y)j(a)g(factor)g(of)g(10)g(or)g(p)qN(ossibly)0 603 y(more.)g(F)l(urther)15 b(exp)q(erimen)o(ts)i(will)i(determine)Je(more)e(precisely)k(just)e(what)h(errors)d(are)i(in)o(tro)q(duced)0 663 yN(in)e(the)g(compressed)d(data;)j(it)h(is)g(p)q(ossible)f(that)g(certain)h(kin\Lds)f(of)g(analysis)g(will)j(giv)o(e)d(more)e(accurate)0 722 y(results)h(on)gN(the)h(compressed)c(data)k(than)f(on)g(the)h(original)g(b)q(ecause)g(of)f(the)Nh(adaptiv)o(e)g(\014ltering)g(of)g(the)0 782 y(H-transform)f(\(Capaccioli)19 bLfb(et)e(al)p fi(.)g(1988\).)100 857 y(This)i(compression)e(algorithm)i(can)gM(b)q(e)g(applied)i(to)e(an)o(y)g(image,)g(not)g(just)h(to)f(digitized)j(pho-)K0 917 y(tographic)c(plates.)29 b(Exp)q(erimen)o(ts)17 b(on)h(CCD)h(images)eM(indicate)j(that)f(lossless)g(compression)d(factors)0 976 y(of)j(3{30)g(can)hM(b)q(e)f(ac)o(hiev)o(ed)g(dep)q(ending)h(on)f(the)g(CCD)g(c)o(haracteristics)Kh(\()p fb(e.g.)p fi(,)f(the)h(readout)f(noise\).)0 1036 y(A)g(sligh)o(tly)hN(mo)q(di\014ed)d(algorithm)g(customized)g(to)i(the)f(noise)g(c)o(haracteristi\Mcs)h(of)f(the)h(CCD)f(will)i(do)0 1096 y(b)q(etter.)j(This)16 b(application)jJ(will)g(b)q(e)e(explored)f(in)h(detail)i(in)e(the)g(future.)100 1171 y(W)lN(e)26 b(gratefully)j(ac)o(kno)o(wledge)d(gran)o(t)g(from)f(NA)o(GW-2166)h(fro\Nm)f(the)i(Science)g(Op)q(erations)0 1230 y(Branc)o(h)17 b(of)i(NASA)g(headqua\Krters)e(whic)o(h)i(supp)q(orted)e(this)i(w)o(ork.)27 b(The)19 b(Space)f(T)lJ(elescop)q(e)h(Science)0 1290 y(Institute)f(is)f(op)q(erated)f(b)o(y)g(A)oK(URA)h(with)h(funding)e(from)f(NASA)i(and)f(ESA.)831 1410 y fc(References)0J1514 y fi(Blume,)h(H.,)g(and)g(F)l(and,)f(A.)i(1989,)f fb(SPIE)g(V)l(ol.)hJ(1091,)f(Medical)i(Imaging)d(I)q(I)q(I:)i(Image)e(Capture)h(and)100 1574 yL(Displa)o(y)p fi(,)g(p.)f(2.)0 1634 y(Capaccioli,)e(M.,)e(Held,)h(E.)f(V.,)hL(Lorenz,)f(H.,)g(Ric)o(h)o(ter,)g(G.)g(M.,)g(and)f(Ziener,)i(R.)f(1988,)g fbJ(Astronomisc)o(he)100 1694 y(Nac)o(hric)o(h)o(ten)p fi(,)j fc(309)p fi(,)hM(69.)0 1753 y(Daub)q(ec)o(hies,)g(I.)h(1988,)f fb(Comm.)d(Pure)j(and)g(Appl.)Lh(Math.)p fi(,)f fc(41)p fi(,)f(909.)0 1813 y(F)l(ritze,)25 b(K.,)f(Lange,)gM(M.,)g(M\177)-25 b(ostl,)25 b(G.,)f(Oleak,)i(H.,)e(and)g(Ric)o(h)o(ter,)g(G.)Nh(M.)f(1977,)g fb(Astronomisc)o(he)100 1873 y(Nac)o(hric)o(h)o(ten)p fi(,)15 bLfc(298)p fi(,)h(189.)0 1933 y(Haar,)g(A.)h(1910,)f fb(Math.)g(Ann.)g fc(69)pNfi(,)g(331.)0 1993 y(Huang,)g(L,)h(and)e(Bijaoui,)k(A.)d(1991,)g fb(Exp)q(eri\Mmen)o(tal)h(Astronom)o(y)p fi(,)d fc(1)p fi(,)i(311.)0 2052 y(Ric)o(h)o(ter,)Jg(G.)h(M.)f(1978,)g fb(Astronomisc)o(he)e(Nac)o(hric)o(h)o(ten)p fi(,)i fcN(299)p fi(,)f(283.)0 2112 y(Samet,)g(H.)i(1984,)f fb(A)o(CM)g(Computing)f(Sur\Nv)o(eys)p fi(,)h fc(16)p fi(,)f(187.)0 2172 y(White,)g(R.)f(L.,)g(P)o(ostman,)Je(M.,)h(and)h(Lattanzi,)h(M.)f(1991,)f(in)i fb(Pro)q(ceedings)f(of)g(the)hN(Edin)o(burgh)d(Meet-)100 2232 y(ing)17 b(on)f(Digital)j(Sky)e(Surv)o(eys)p fiJ(,)e(in)i(press.)0 2291 y(Witten,)i(I.)d(H.,)i(Radford,)d(M.)i(N.,)g(and)fM(Cleary)l(,)h(J.)g(G.)g(1987,)g fb(Comm)n(un)o(ications)f(of)h(the)g(A)o(CM)p)fi(,)g fc(30)p fi(,)100 2351 y(520.)g eop %%Trailer end%%EOF*[HCOMPRESS.DOC]PAPER.TEX;1+,.*/ 4T*) -y0123KPWO+562S7\!8\]]49GHJR,% Paper for NASA workshop at DCC '92 meetingJ% This version has figures removed so that file is small enough to include-% with the distribution version of hcompress.% R. White, 18 March 1992%\magnification\magstep1 %\input psfig\tolerance=5000%#\footline={\hfil} \headline={\hfil}\parskip=\smallskipamount"\font\bigbf=cmbx10 scaled\magstep1 \font\smallsl=cmsl10 at 10truept%.\def\etal{{\sl et al}.} % et al. in italics,\def\eg{{\sl e.g.},\ } % e.g. in italics\def\as/{\hbox{\tt"}}G\def\section#1\par{\bigbreak\centerline{\bf #1}\nobreak\medskip\nobreak \noindent }\def\bull{\item{$\bullet$} }\def\bulla{\item{$\circ$} }\def\ht/{H-transform}%G\centerline{\bigbf High-Performance Compression of Astronomical Images}\bigskip!\centerline{\sl Richard L. White} \smallskipT\centerline{\sl Joint Institute for Laboratory Astrophysics, University of Colorado}2\centerline{\sl Campus Box 440, Boulder, CO 80309}\centerline{\sl and}2\centerline{\sl Space Telescope Science Institute};\centerline{\sl 3700 San Martin Drive, Baltimore, MD 21218} \smallskip\centerline{\sl rlw@stsci.edu}\bigskip\section SummaryFAstronomical images have some rather unusual characteristics that make@many existing image compression techniques either ineffective orCinapplicable. A typical image consists of a nearly flat backgroundBsprinkled with point sources and occasional extended sources. TheGimages are often noisy, so that lossless compression does not work very@well; furthermore, the images are usually subjected to stringentEquantitative analysis, so any lossy compression method must be provenDnot to discard useful information, but must instead discard only theEnoise. Finally, the images can be extremely large. For example, theCSpace Telescope Science Institute has digitized photographic plates;covering the entire sky, generating 1500 images each havingF$14000\times14000$ 16-bit pixels. Several astronomical groups are nowFconstructing cameras with mosaics of large CCDs (each $2048\times2048$Dor larger); these instruments will be used in projects that generateCdata at a rate exceeding 100~MBytes every 5 minutes for many years.EAn effective technique for image compression may be based on the \ht/D(Fritze \etal\ 1977). The method that we have developed can be usedCfor either lossless or lossy compression. The digitized sky surveyFimages can be compressed by at least a factor of 10 with no noticeableFlosses in the astrometric and photometric properties of the compressedFimages. The method has been designed to be computationally efficient:Fcompression or decompression of a $512\times512$ image requires only 4Aseconds on a Sun SPARCstation~1. The algorithm uses only integerGarithmetic, so it is completely reversible in its lossless mode, and it?could easily be implemented in hardware for space applications.\section 1. IntroductionFAstronomical images consist largely of empty sky. Compression of suchFimages can reduce the volume of data that it is necessary to store (anDimportant consideration for large scale digital sky surveys) and can?shorten the time required to transmit images (useful for remote-observing or remote access to data archives.)AData compression methods can be classified as either ``lossless''E(meaning that the original data can be reconstructed exactly from theEcompressed data) or ``lossy'' (meaning that the uncompressed image isEnot exactly the same as the original.) Astronomers often insist that=they can accept only lossless compression, in part because of@conservatism, and in part because the familiar lossy compression>methods sacrifice some information that is needed for accurateGanalysis of image data. However, since all astronomical images containDnoise, which is inherently incompressible, lossy compression methods(produce much better compression results.?A simple example may make this clear. One of the simplest data=compression techniques is run-length coding, in which runs ofFconsecutive pixels having the same value are compressed by storing theBpixel value and the repetition factor. This method is used in the8standard compression scheme for facsimile transmissions.BUnfortunately, it is quite ineffective for lossless compression of?astronomical images because even though the sky is {\sl nearly}Cconstant, the noise in the sky ensures that only very short runs ofCequal pixels occur. The obvious way to make run-length coding moreCeffective is to force the sky to be exactly constant by setting allFpixels below a threshold (chosen to be just above the sky) to the meanDsky value. However, then one has lost any information about objectsBclose to the detection limit. One has also lost information aboutAlocal variations in the sky brightness, which severely limits theEaccuracy of photometry and astrometry on faint objects. Worse, thereGmay be extended, low surface brightness objects that are not detectable@in a single pixel but that are easily detected when the image is;smoothed over a number of pixels; such faint structures are;irretrievably lost when the image is thresholded to improve compression.\section 2. The \ht/FFritze \etal\ (1977; see also Richter 1978 and Capaccioli \etal\ 1988)Ghave developed a much better compression method for astronomical images?based on what they call the {\sl \ht/} of the image. A similar=transform called the S-transform has also been used for image@compression (Blume \& Fand 1989). The \ht/ is a two-dimensional>generalization of the Haar transform (Haar 1910). The \ht/ is;calculated for an image of size $2^N\times 2^N$ as follows:\medskipF\bulla Divide the image up into blocks of $2\times2$ pixels. Call the?4 pixels in a block $a_{00}$, $a_{10}$, $a_{01}$, and $a_{11}$.-\bulla For each block compute 4 coefficients: $$\eqalign{)h_0 &= (a_{11}+a_{10}+a_{01}+a_{00})/2\cr)h_x &= (a_{11}+a_{10}-a_{01}-a_{00})/2\cr)h_y &= (a_{11}-a_{10}+a_{01}-a_{00})/2\cr)h_c &= (a_{11}-a_{10}-a_{01}+a_{00})/2\cr}$$F\bulla Construct a $2^{N-1}\times 2^{N-1}$ image from the $h_0$ valuesGfor each $2\times2$ block. Divide that image up into $2\times2$ blocksAand repeat the above calculation. Repeat this process $N$ times,Dreducing the image in size by a factor of 2 at each step, until onlyone $h_0$ value remains.\medskip \noindentEThis calculation can be easily inverted to recover the original imageFfrom its transform. The transform is exactly reversible using integer;arithmetic if one does not divide by 2 for the first set ofDcoefficients. It is straightforward to extend the definition of theFtransform so that it can be computed for non-square images that do notDhave sides that are powers of 2. The \ht/ can be performed in place@in memory and is very fast to compute, requiring about $16M^2/3$,(integer) additions for a $M\times M$ image.EThe \ht/ is a simple 2-dimensional wavelet transform. It has severalGadvantages over some other wavelet transforms that have been applied toEimage compression (\eg Daubechies 1988). First, the transform can be=performed entirely with integer arithmetic, making it exactlyEreversible. Consequently it can be used for either lossless or lossy@compression (as indicated below) and one does not need a specialEtechnique for the case of lossless compression (as was required, \eg,#for the JPEG compression standard.)EA second major advantage is that the \ht/ is a natively 2-dimensionalEwavelet transform. The standard 1-dimensional wavelet transforms areDextended to two dimensions by transforming the image first along theArows, then along the columns. Unfortunately, this generates manyEwavelet coefficients that are high frequency (hence localized) in theD$x$-direction but low frequency (hence global) in the $y$-direction.>Such coefficients are counter to the philosophy of the waveletBtransform: high-frequency basis functions should be confined to aArelatively small area of the image. Discarding these mixed-scaleDterms, which may be negligible compared to the noise, generates veryDobjectionable artifacts around point sources and edges in the image.=The \ht/, on the other hand, is a fully 2-dimensional waveletDtransform, with all high frequency terms being completely localized.CIt is consequently more suitable for image compression and producesfewer artifacts.DA possible disadvantage of the \ht/ is that other wavelet transformsFtake better advantage of the continuity of pixel values within images,Dso that they can produce higher compressions for very smooth images.CHowever, for astromical images (which are mostly flat sky sprinkledEwith point sources) the smoothness built into higher-order transformsFcan actually reduce the effectiveness of compression, because one must5keep more coefficients to describe each point source.&\section 3. Compression Using the \ht/@If the image is nearly noiseless, the \ht/ is somewhat easier toDcompress than the original image because the differences of adjacentEpixels (as computed in the \ht/) tend to be smaller than the originalEpixel values for smooth images. Consequently fewer bits are requiredFto store the values of the \ht/ coefficients than are required for the?original image. For very smooth images the pixel values may beCconstant over large regions, leading to transform coefficients thatare zero over large areas.ANoisy images still do not compress well when transformed, though.DSuppose there is noise $\sigma$ in each pixel of the original image.EThen from simple propagation of errors, the noise in each of the \ht/Ecoefficients is also $\sigma$. To compress noisy images, divide eachCcoefficient by $S\sigma$, where $S\sim1$ is chosen according to howDmuch loss is acceptable. This reduces the noise in the transform toD$0.5/S$, so that large portions of the transform are zero (or nearly/zero) and the transform is highly compressible.CWhy is this better than simply thresholding the original image? AsGdiscussed above, if we simply divide the image by $\sigma$ then we loseEall information on objects that are within $1\sigma$ of sky in a {\slDsingle} pixel, but that are detectable by averaging a {\sl block} of@pixels. On the other hand, in dividing the \ht/ by $\sigma$, weFpreserve the information on any object that is detectable by summing aDblock of pixels! The quantized \ht/ preserves the mean of the imageDfor every block of pixels having a mean significantly different than%that of neighboring blocks of pixels.6As an example, Figure 1 shows a $128\times128$ section?($3.6\times3.6$~arcmin) from a digitized version of the Palomar9Observatory--National Geographic Society Sky Survey plate(containing the Coma cluster of galaxies.&Figures 2, 3, and 4 show the resultingCimage for $S \simeq 0.5$, 1, and 2. These images are compressed byDfactors of 10, 20, and 60 using the coding scheme described below. HIn all cases a logarithmic gray scale is used to show the maximum detail@in the image near the sky background level; the noise is clearlyvisible in Figure~1. TheEimage compressed by a factor of 10 is hardly distinguishable from theAoriginal. In quantizing the \ht/ we have adaptively filtered theCoriginal image by discarding information on some scales and keepingFinformation on other scales. This adaptive filtering is most apparentFfor high compression factors (Fig.~4), where the sky has been smoothedEover large areas while the images of stars have hardly been affected. %\topinsert%\tabskip=0pt plus1fil3%\halign to\hsize{&\hbox to3.2truein{\hss #\hss}\cr(%\psfig{figure=orig.ps,width=3.8truein}&)%\psfig{figure=x10.ps,width=3.8truein}\cr7%{\smallsl Figure 1. Original image of Coma cluster.}&@%{\smallsl Figure 2. Result of compression by factor of 10.}\cr%\noalign{\medskip}'%\psfig{figure=x20.ps,width=3.8truein}&)%\psfig{figure=x50.ps,width=3.8truein}\cr>%{\smallsl Figure 3. Result of compression by factor of 20.}&@%{\smallsl Figure 4. Result of compression by factor of 60.}\cr%} %\endinsertDThe adaptive filtering is, in itself, of considerable interest as anFanalytical tool for images (Capaccioli \etal\ 1988). For example, oneDcan use the adaptive smoothing of the \ht/ to smooth the sky withoutFaffecting objects detected above the (locally determined) sky; then anFaccurate sky value can be determined by reference to any nearby pixel.FThe blockiness that is visible in Figure~4 is the result of differenceBcoefficients being set to zero over large areas, so that blocks ofGpixels are replaced by their averages. It is possible to eliminate the>blocks by an appropriate filtering of the image. A simple but<effective filter can be derived by simply adjusting the \ht/Dcoefficients as the transform is inverted to produce a smooth image;Fas long as changes in the coefficients are limited to $\pm S\sigma/2$,Athe resulting image will still be consistent with the thresholded\ht/.\section 4. Efficient CodingGThe quantized \ht/ has a rather peculiar structure. Not only are largeGareas of the transform image zero, but the non-zero values are stronglyCconcentrated in the lower-order coefficients. The best approach weAhave found to code the coefficient values efficiently is quadtreeDcoding of each bitplane of the transform array. Quadtree coding has>been used for many purposes (see Samet 1984 for a review); theFparticular form we are using was suggested by Huang and Bijaoui (1991)for image compression.\medskipG\bulla Divide the bitplane up into 4 quadrants. For each quadrant code?a `1' if there are any 1-bits in the quadrant, else code a `0'.F\bulla Subdivide each quadrant that is not all zero into 4 more piecesDand code them similarly. Continue until one is down to the level ofindividual pixels.\medskip \noindentBThis coding (which Huang and Bijauoi call ``hierarchic 4-bit one''?coding) is obviously very well suited to the \ht/ image becauseAsuccessively lower orders of the \ht/ coefficients are located in,successively divided quadrants of the image.EWe follow the quadtree coding with a fixed Huffman coding that uses 3Cbits for quadtree values that are common (\eg 0001, 0010, 0100, andD1000) and uses 4 or 5 bits for less common values. This reduces theFfinal compressed file size by about 10\% at little computational cost.ASlightly better compression can be achieved by following quadtreeFcoding with arithmetic coding (Witten, Bell, and Cleary 1987), but theBCPU costs of arithmetic coding are not, in our view, justified forF3--4\% better compression. We have also tried using arithmetic codingdirectly on the \ht/,>with various contexts of neighboring pixels, but find it to beBboth computationally inefficient and not significantly better thanquadtree coding.FFor completely random bitplanes, quadtree coding can actually use moreBstorage than simply writing the bitplane directly; in that case we&just dump the bitplane with no coding.HNote that by coding the transform one bitplane at a time, the compressedGdata can be viewed as an incremental description of the image. One canEinitially transmit a crude representation of the image using only theFsmall amount of data that is required for the sparsely populated, mostFsignificant bit planes. Then the lower bit planes can be added one byFone until the desired accuracy is required. This could be useful, forFexample, if the data is to be retrieved from a remote database --- oneEcould examine the crude version of the image (retrieved very quickly)Band abort the transmission of the rest of the data if the image isjudged to be uninteresting.G\section 5. Astrometric and Photometric Properties of Compressed ImagesCAstronomical images are not simply subjected to visual examination,Fbut are also subjected to careful quantitative analysis. For example,Dfor the image in Figure~1 one would typically like to do astrometricD(positional) measurements of objects to an accuracy much better thanH1 pixel, photometric (brightness) measurements of objects to an accuracyAlimited only by the detector response and the noise, and accurate;measurements of the surface brightness of extended sources.HWe have done some experiments to study the degradation of astrometry andKphotometry on the compressed images compared to the original images (White,NPostman, and Lattanzi 1991). Even the most highly compressed images have veryHgood photometric properties for both point sources and extended sources;Findeed, photometry of extended objects can be improved by the adaptiveLfiltering of the H-transform (Cappacioli \etal\ 1988). Astrometry is hardlyIaffected by the compression for modest compression factors (up to about aRfactor of 20 for our digitized photographic plates), but does begin to degrade for"the most highly compressed images.EThese results are based on tests carried out with tools optimized forGthe original images; it is likely the best results will be obtained forFhighly compressed images only with analysis tools specifically adapted?to the peculiar noise characteristics of the compressed images.\section 6. ConclusionsDIn order to construct the Guide Star Catalog for use in pointing theEHubble Space Telescope, the Space Telescope Science Institute scannedEand digitized wide-field photographic plates covering the entire sky.BThe digitized plates are of great utility, but to date it has beenCimpossible to distribute the scans because of the massive volume ofCdata involved (a total of about 600~Gbytes). Using the compressionEtechniques described in this paper, we plan to distribute our digitalAsky survey on CD-ROMs; about 100 CD-ROMs will be required if the'survey is compressed by a factor of 10.EThe algorithm described in this paper has been shown to be capable of@producing highly compressed images that are very faithful to theForiginal. Algorithms designed to work on the original images can giveGcomparable results on object detection, astrometry, and photometry whenDapplied to the images compressed by a factor of 10 or possibly more.FFurther experiments will determine more precisely just what errors areGintroduced in the compressed data; it is possible that certain kinds ofGanalysis will give more accurate results on the compressed data than onFthe original because of the adaptive filtering of the \ht/ (Capaccioli \etal\ 1988).CThis compression algorithm can be applied to any image, not just toGdigitized photographic plates. Experiments on CCD images indicate thatFlossless compression factors of 3--30 can be achieved depending on theACCD characteristics (\eg the readout noise). A slightly modifiedDalgorithm customized to the noise characteristics of the CCD will doCbetter. This application will be explored in detail in the future.?We gratefully acknowledge grant from NAGW-2166 from the ScienceAOperations Branch of NASA headquarters which supported this work.FThe Space Telescope Science Institute is operated by AURA with fundingfrom NASA and ESA.\section ReferencesR{\parskip=0pt \frenchspacing \advance\leftskip by\parindent \parindent=-\parindent3Blume, H., and Fand, A. 1989, {\sl SPIE Vol. 1091,6Medical Imaging III: Image Capture and Display}, p. 2.GCapaccioli, M., Held, E. V., Lorenz, H., Richter, G. M., and Ziener, R.51988, {\sl Astronomische Nachrichten}, {\bf 309}, 69.EDaubechies, I. 1988, {\sl Comm. Pure and Appl. Math.}, {\bf 41}, 909.GFritze, K., Lange, M., M\"ostl, G., Oleak, H., and Richter, G. M. 1977, {\sl Astronomische Nachrichten},{\bf 298}, 189..Haar, A. 1910, {\sl Math. Ann.} {\bf 69}, 331.LHuang, L, and Bijaoui, A. 1991, {\sl Experimental Astronomy}, {\bf 1}, 311.Richter, G. M. 1978, {\sl Astronomische Nachrichten},{\bf 299}, 283.;Samet, H. 1984, {\sl ACM Computing Surveys}, {\bf 16}, 187.LWhite, R. L., Postman, M., and Lattanzi, M. 1991, in {\sl Proceedings of the7 Edinburgh Meeting on Digital Sky Surveys}, in press.MWitten, I. H., Radford, M. N., and Cleary, J. G. 1987, {\sl Communications ofthe ACM}, {\bf 30}, 520.}\bye*[HCOMPRESS]SOURCE.DIR;1+,./ 4-v0123 KPWO56,\ 728+N49GHJI BIT_INPUT.C BIT_OUTPUT.C'DECODE.Cr DIGITIZE.C  DODECODE.C DOENCODE.C.ENCODE.CG FITSPASS.CH FITSREAD.CIt GETFLAGARG.CGETOPT.C GET_DATA.CHCOMP.C HDECOMP.CHINV.Cu HSMOOTH.CHTRANS.C MAKEFITS.C PUT_DATA.CQREAD.C{QTREE_DECODE.CQTREE_ENCODE.C|QWRITE.C SWAP_BYTES.CC UNDIGITIZE.CT*[HCOMPRESS.SOURCE]BIT_INPUT.C;1+,./ 4@d-0123KPWO567l8lf49GHJ>/* Copyright (c) 1993 Association of Universities for Research= * in Astronomy. All rights reserved. Produced under National@ * Aeronautics and Space Administration Contract No. NAS5-26555. *//* BIT INPUT ROUTINES */#include #include /* THE BIT BUFFER */8static int buffer; /* Bits waiting to be input */?static int bits_to_go; /* Number of bits still in buffer *//* INITIALIZE BIT INPUT */ extern voidstart_inputing_bits(){ /*( * Buffer starts out with no bits in it */ bits_to_go = 0;}/* INPUT A BIT */ extern intinput_bit(infile) FILE *infile;{; if (bits_to_go == 0) { /* Read the next byte if no */: buffer = getc(infile); /* bits are left in buffer */ if (buffer == EOF) { /*2 * end of file is an error for this application */: fprintf(stderr, "input_bit: unexpected end-of-file\n"); exit(-1); } bits_to_go = 8; } /* * Return the next bit */ bits_to_go -= 1;" return((buffer>>bits_to_go) & 1);}#/* INPUT N BITS (N must be <= 8) */ extern intinput_nbits(infile,n) FILE *infile;int n;{int c; if (bits_to_go < n) { /*& * need another byte's worth of bits */ buffer <<= 8; c = getc(infile); if (c == EOF) { /*2 * end of file is an error for this application */< fprintf(stderr, "input_nbits: unexpected end-of-file\n"); exit(-1); } buffer |= c; bits_to_go += 8; } /*! * now pick off the first n bits */ bits_to_go -= n;- return( (buffer>>bits_to_go) & ((1< int bitcount;/* THE BIT BUFFER */8static int buffer; /* Bits buffered for output */>static int bits_to_go; /* Number of bits free in buffer *//* INITIALIZE FOR BIT OUTPUT */ extern voidstart_outputing_bits(){3 buffer o~ HCOMPRESS.BCK' [HCOMPRESS.SOURCE]BIT_OUTPUT.C;1@4-= 0; /* Buffer is empty to start */' bits_to_go = 8; /* with */ bitcount = 0;}/* OUTPUT A BIT */ extern voidoutput_bit(outfile,bit)FILE *outfile;int bit;{4 buffer <<= 1; /* Put bit at end of buffer */ if (bit) buffer |= 1; bits_to_go -= 1;9 if (bits_to_go == 0) { /* Output buffer if it is */3 putc(buffer & 0xff,outfile); /* now full */ bits_to_go = 8; buffer = 0; } bitcount += 1;}$/* OUTPUT N BITS (N must be <= 8) */ extern voidoutput_nbits(outfile,bits,n)FILE *outfile; int bits;int n;{ /* * insert bits at end of buffer */ buffer <<= n;! buffer |= ( bits & ((1<>(-bits_to_go)) & 0xff,outfile); bits_to_go += 8; } bitcount += n;}/* FLUSH OUT THE LAST BITS */ extern voiddone_outputing_bits(outfile)FILE *outfile;{ if(bits_to_go < 8) {# putc(buffer<#include #include 7static char code_magic[2] = { (char)0xDD, (char)0x99 };extern void qread();extern int readint();extern void dodecode();extern void fitspass(); extern void+decode(infile,outfile,a,nx,ny,scale,format)'FILE *infile; /* input file */5FILE *outfile; /* output file (NULL for none) */5int **a; /* address of output array [nx][ny] *//int *nx,*ny; /* size of output array */4int *scale; /* scale factor for digitization */.char **format; /* output file format */( /* (may be changed if empty) */{int nel, sumall, newfits = 0;unsigned char nbitplanes[3];char tmagic[2], line[81]; /*= * File starts either with special 2-byte magic code or with * FITS keyword "SIMPLE =" */' qread(infile, tmagic, sizeof(tmagic)); /* * Check for FITS */! if (strncmp(tmagic,"SI",2)==0) { /*A * read rest of line and make sure the whole keyword is correct */ strncpy(line,"SI",2);/ if ((fgets(&line[2], 79, infile) == NULL) || + (strncmp(line, "SIMPLE =", 9) != 0) ) {( fprintf(stderr, "bad file format\n"); exit(-1); } /*7 * set output format to default "fits" if it is empty */- if ((*format)[0] == '\0') *format = "fits"; /*B * if fits output format and outfile != NULL, write this line toC * outfile and then copy rest of FITS header; else just read past * FITS header. */A if (strcmp(*format, "fits") == 0 && outfile != (FILE *) NULL) { fputs(line,outfile); fitspass(infile,1,outfile); } else { fitspass(infile,0,outfile); } /*> * now read the first two characters again -- this time they * MUST be the magic code! */( qread(infile, tmagic, sizeof(tmagic)); } else { /*5 * set default format to raw if it is not specified */+ if((*format)[0] == '\0') *format = "raw"; /*? * if input format is not FITS but output format is FITS, set= * a flag so we generate a FITS header once we know how big * the image must be. */0 if (strcmp(*format, "fits") == 0) newfits = 1; } /*& * check for correct magic code value */9 if (memcmp(tmagic,code_magic,sizeof(code_magic)) != 0) {' fprintf(stderr, "bad file format\n"); exit(-1); }3 *nx =readint(infile); /* x size of image */3 *ny =readint(infile); /* y size of image */? *scale=readint(infile); /* scale factor for digitization */ /*2 * write the new fits header to outfile if needed */+ if (newfits && (outfile != (FILE *) NULL))+ makefits(outfile,*nx,*ny,16,"INTEGER*2"); /* * allocate memory for array */ nel = (*nx) * (*ny);& *a = (int *) malloc(nel*sizeof(int)); if (*a == (int *) NULL) {3 fprintf(stderr, "decode: insufficient memory\n"); exit(-1); } /* sum of all pixels */ sumall=readint(infile); /* # bits in quadrants */8 qread(infile, (char *) nbitplanes, sizeof(nbitplanes));, dodecode(infile, *a, *nx, *ny, nbitplanes); /*+ * put sum of all pixels back into pixel 0 */ (*a)[0] = sumall;}*[HCOMPRESS.SOURCE]DIGITIZE.C;1+, ./ 4HB-0123KPWO56E7Ng8:g49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */"/* digitize.c digitize H-transform *, * Programmer: R. White Date: 11 March 1991 */#include extern voiddigitize(a,nx,ny,scale)int a[]; int nx,ny; int scale;{ int d, *p; /* * round to multiple of scale */ if (scale <= 1) return; d=(scale+1)/2-1;H for (p=a; p <= &a[nx*ny-1]; p++) *p = ((*p>0) ? (*p+d) : (*p-d))/scale;}*[HCOMPRESS.SOURCE]DODECODE.C;1+,./ 4E-0123KPWO56l|7W8wg49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */D/* dodecode.c Decode stream of characters on infile and return array *: * This version encodes the different quadrants separately *) * Programmer: R. White Date: 9 May 1991 */#include #include 2#define input_nybble(infile) input_nbits(infile,4)extern void qtree_decode();"extern void start_inputing_bits();extern int input_bit();extern int input_nbits(); extern void#dodecode(infile,a,nx,ny,nbitplanes) FILE *infile;0int a[]; /* Array of values to decode */5int nx,ny; /* Array dimensions are [nx][ny] */Eunsigned char nbitplanes[3]; /* Number of bit planes in quadrants */{int i, nel, nx2, ny2; nel = nx*ny; nx2 = (nx+1)/2; ny2 = (ny+1)/2; /* * initialize a to zero */ for (i=0; i:#define output_nybble(outfile,c) output_nbits(outfile,c,4)extern void qtree_encode();#extern void start_outputing_bits();"extern void done_outputing_bits();extern void output_nbits(); extern void$doencode(outfile,a,nx,ny,nbitplanes)0FILE *outfile; /* output data stream */0int a[]; /* Array of values to encode */2int nx,ny; /* Array dimensions [nx][ny] */Eunsigned char nbitplanes[3]; /* Number of bit planes in quadrants */{ int nx2, ny2; nx2 = (nx+1)/2; ny2 = (ny+1)/2; /* * Initialize bit output */ start_outputing_bits(); /*. * write out the bit planes for each quadrant */F qtree_encode(outfile, &a[0], ny, nx2, ny2, nbitplanes[0]);F qtree_encode(outfile, &a[ny2], ny, nx2, ny/2, nbitplanes[1]);F qtree_encode(outfile, &a[ny*nx2], ny, nx/2, ny2, nbitplanes[1]);F qtree_encode(outfile, &a[ny*nx2+ny2], ny, nx/2, ny/2, nbitplanes[2]); /* * Add zero as an EOF symbol */ output_nybble(outfile, 0); done_outputing_bits(outfile);}*[HCOMPRESS.SOURCE]ENCODE.C;1+,G. / 4E :-0123KPWO 56672/8h49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */4/* encode.c encode H-transform and write to outfile *. * Programmer: R. White Date: 2 February 1994 */#include #include #include int verbose; int bitcount;7static char code_magic[2] = { (char)0xDD, (char)0x99 };extern void writeint();extern void qwrite();extern void doencode(); extern voidencode(outfile,a,nx,ny,scale)+FILE *outfile; /* Output file */5int a[]; /* input H-transform array (nx,ny) */2int nx,ny; /* size of H-transform array */5int scale; /* scale factor for digitization */{:int nel, nx2, ny2, i, j, k, q, vmax[3], nsign, bits_to_go;unsigned char nbitplanes[3];unsigned char *signbits; nel = nx*ny; /* * write magic value */1 qwrite(outfile, code_magic, sizeof(code_magic));2 writeint(outfile, nx); /* size of image */ writeint(outfile, ny);@ writeint(outfile, scale); /* scale factor for digitization */ /*? * write first value of A (sum of all pixels -- the only value! * which does not compress well) */ writeint(outfile, a[0]); a[0] = 0; /*< * allocate array for sign bits and save values, 8 per byte */0 signbits = (unsigned char *) malloc((nel+7)/8);* if (signbits == (unsigned char *) NULL) {3 fprintf(stderr, "encode: insufficient memory\n"); exit(-1); } nsign = 0; bits_to_go = 8; signbits[0] = 0; for (i=0; i 0) { /*1 * positive element, put zero at end of buffer */ signbits[nsign] <<= 1; bits_to_go -= 1; } else if (a[i] < 0) { /*& * negative element, shift in a one */ signbits[nsign] <<= 1; signbits[nsign] |= 1; bits_to_go -= 1; /*! * replace a by absolute value */ a[i] = -a[i]; } if (bits_to_go == 0) { /*- * filled up this byte, go to the next one */ bits_to_go = 8; nsign += 1; signbits[nsign] = 0; } } if (bits_to_go != 8) { /* * some bits in last element9 * move bits in last byte to bottom and increment nsign */! signbits[nsign] <<= bits_to_go; nsign += 1; } /*2 * calculate number of bit planes for 3 quadrants *E * quadrant 0=bottom left, 1=bottom right or top left, 2=top right,  */ for (q=0; q<3; q++) { vmax[q] = 0; } /*/ * get maximum absolute value in each quadrant */ nx2 = (nx+1)/2; ny2 = (ny+1)/2; j=0; /* column counter */ k=0; /* row counter */ for (i=0; i=ny2) + (k>=nx2);% if (vmax[q] < a[i]) vmax[q] = a[i]; if (++j >= ny) { j = 0; k += 1; } } /*2 * now calculate number of bits for each quadrant */ for (q = 0; q < 3; q++) {8 nbitplanes[q] = log((float) (vmax[q]+1))/log(2.0)+0.5;+ if ( (vmax[q]+1) > (1< 0) qwrite(outfile, signbits, nsign); if (verbose) { /*) * total number of bits written to file */ i=bitcount+A 8*(nsign+sizeof(code_magic)+sizeof(nbitplanes)+4*sizeof(int));A fprintf(stderr, "%6.3f bits/pixel, compression factor %5.1f\n", ((float) i)/nel, 16.0*nel/((float) i)); } free(signbits);}*[HCOMPRESS.SOURCE]FITSPASS.C;1+,H./ 4G-0123KPWO56,#I7v8iJh49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */B/* fitspass.c Read FITS header from infile and pass it to outfile,= * Adds blank lines to make header a multiple of 36 lines.? * This may exit with error status if some problem is found. *, * Programmer: R. White Date: 16 April 1992 */#include #include #include extern void!fitspass(infile,passthru,outfile) FILE *infile; /* input file */9int passthru; /* non-zero -> copy header to outfile */"FILE *outfile; /* output file */{char line[81]; int i, j; /*G * Note that the SIMPLE line has already been stripped off and written1 * to outfile for FITS files, so we start at i=1 */ for (i = 1; ; i++) {$ if (fgets(line,81,infile)==NULL) {8 fprintf(stderr,"FITS header has no END statement\n"); exit(-1); } if (strlen(line)!=80) {E fprintf(stderr, "Error in FITS header: found embedded newline\n"); exit(-1); }% if (passthru) fputs(line,outfile); ) if (strncmp(line,"END ",4) == 0) break; } /*> * write blank lines to make a multiple of 36 lines in header) * number of lines written so far is i+1 */ if (passthru) {# for (j=0; j<80; j++) line[j]=' '; line[80]='\0';8 for (i = 35 - (i % 36); i>0; i--) fputs(line,outfile); }}*[HCOMPRESS.SOURCE]FITSREAD.C;1+,It. / 4F -0123KPWO 56S78h49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */F/* fitsread.c Read FITS header from infile and (optionally) pass it toD * outfile. Find naxis1 and naxis2 on the way, returning them as * ny and nx.@ * This will exit with error status if image is not 2-D or if; * image has either group parameters or multiple groups. *; * Based on the fitspass program written by Saul Perlmutter *. * Programmer: R. White Date: 16 April 1992 */#include #include #include extern void<fitsread(infile,inname,outfile,nx,ny,passthru,padded,nlterm).FILE *infile; /* input file pointer */,char *inname; /* input file name */0FILE *outfile; /* output file pointer */.int *nx, *ny; /* image is NX x NY */;int passthru; /* non-zero -> copy header to outfile */?int padded; /* non-zero -> header is padded to 2880 bytes */Bint nlterm; /* non-zero -> lines are terminated with newlines */{char line[82];int naxis1, naxis2, val;int i, j, noend, nline; /*' * make sure we find NAXIS1 and NAXIS2 */ naxis1 = 0; naxis2 = 0; noend=1; nline = 81 + (nlterm != 0); while (noend) { /*7 * continue looping until we've read END statement orF * until we've read a multiple of 36 lines past END (if padded != 0) *// for (i=0; (i<36) && (noend || padded); i++) {( if (fgets(line,nline,infile)==NULL) {> fprintf(stderr,"FITS header not complete in %s\n",inname); exit(-1); }/ /* If newline is in buffer, get rid of it */ line[80] = '\0';3 /* Replace line of nulls with line of blanks. */ if (strlen(line)!=80) {0 for (j=strlen(line); j<80; j++) line[j]=' '; } /*B * copy to outfile if passthru != 0 and we have not reached END *// if (passthru && noend) fputs(line,outfile); % if (strncmp(line,"END ",4) == 0) { noend=0;1 } else if (strncmp(line,"NAXIS1 =",9) == 0) {0 if(sscanf(&line[10], " %d", &naxis1) != 1) {@ fprintf(stderr, "Error reading NAXIS1 = %20.20s from %s\n", &line[10], inname); exit(-1); }1 } else if (strncmp(line,"NAXIS2 =",9) == 0) {0 if(sscanf(&line[10], " %d", &naxis2) != 1) {@ fprintf(stderr, "Error reading NAXIS2 = %20.20s from %s\n", &line[10], inname); exit(-1); }1 } else if (strncmp(line,"NAXIS =",9) == 0) {- if(sscanf(&line[10], " %d", &val) != 1) {? fprintf(stderr, "Error reading NAXIS = %20.20s from %s\n", &line[10], inname); exit(-1); } if (val != 2) {A fprintf(stderr, "Not a 2-dimensional image in %s\n",inname); exit(-1); }1 } else if (strncmp(line,"DATATYPE=",9) == 0) {0 if (strncmp(&line[11],"INTEGER*2",9) != 0) {> fprintf(stderr, "Not an INTEGER*2 image in %s\n",inname); exit(-1); }1 } else if (strncmp(line,"PSIZE =",9) == 0) { /* * check PSIZE == 0 */- if(sscanf(&line[10], " %d", &val) != 1) {? fprintf(stderr, "Error reading PSIZE = %20.20s from %s\n", &line[10], inname); exit(-1); } if (val != 0) { fprintf(stderr, = "Image %s has group parameters, I can't compress it\n", inname); exit(-1); }1 } else if (strncmp(line,"GCOUNT =",9) == 0) { /* * check for GCOUNT > 1 */- if(sscanf(&line[10], " %d", &val) != 1) {@ fprintf(stderr, "Error reading GCOUNT = %20.20s from %s\n", &line[10], inname); exit(-1); } if (val > 1) { fprintf(stderr,6 "Image %s has %d groups, I can't compress it\n", inname,val); exit(-1); } } } }" if (naxis1 <= 0 || naxis2 <= 0) { fprintf(stderr,E "Did not find legal values for NAXIS1 and NAXIS2 in %s\n",inname); exit(-1); } *ny = naxis1; *nx = naxis2;} *[HCOMPRESS.SOURCE]GETFLAGARG.C;1+,./ 4@-0123KPWO56.7,a8,f5i49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */@/* EXTRACT BINARY FLAG PARAMETERS FROM COMMAND LINE ARGUMENTS */#include */* returns 1 if flag is present, else 0 */ extern intgetflagarg(argc,argv,flag) int argc; char *argv[];1char flag[]; /* flag (e.g. c for "-c") */{int arg;char *p;! for (arg = 1; arg8i49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. *///* this is a public domain version of getopt */#include #include P#define ERR(ms,cc) if(opterr) {(void) fprintf(stderr,"%s%s%c\n",argv[0],ms,cc);}extern int strcmp();extern char *strchr();int opterr = 1;int optind = 1; int optopt; char *optarg; extern intgetopt(argc, argv, opts) int argc;char **argv, *opts;{static int sp = 1;int c; char *cp; if(sp == 1) {I if(optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') return(EOF);/ else if(strcmp(argv[optind], "--") == NULL) { optind++; return(EOF); } } optopt = c = argv[optind][sp];/ if(c == ':' || (cp=strchr(opts, c)) == NULL) { ERR(": unknown option, -", c);" if(argv[optind][++sp] == '\0') { optind++; sp = 1; } return('?'); } if(*++cp == ':') { if(argv[optind][sp+1] != '\0')" optarg = &argv[optind++][sp+1]; else if(++optind >= argc) {& ERR(": argument missing for -", c); sp = 1; return('?'); } else optarg = argv[optind++]; sp = 1; } else {" if(argv[optind][++sp] == '\0') { sp = 1; optind++; } optarg = NULL; } return(c);}*[HCOMPRESS.SOURCE]GET_DATA.C;1+,. / 4L -0123KPWO 56,7.8̮h49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */?/* get_data.c Read I*2 image data from infile and return as int *G * Format may be raw, net, fits, or hhh. For FITS input format, header * lines get written to outfile. *, * Programmer: R. White Date: 17 April 1992 */#include #include extern int myread();extern int test_swap();extern void swap_bytes();static void get_raw();static void get_fits();static void get_hhh();extern void fitsread(); extern void.get_data(infile,inname,outfile,a,nx,ny,format)/FILE *infile[2]; /* input file pointers */-char *inname[2]; /* input file names */8FILE *outfile; /* output file (only used for FITS) */4int **a; /* pointer to image array (returned) */,int *nx, *ny; /* image is NX x NY */2char *format; /* string giving input format */{! if (strcmp(format,"raw") == 0) {0 get_raw(infile[0], inname[0], a, *nx, *ny, 0);( } else if (strcmp(format,"net") == 0) {0 get_raw(infile[0], inname[0], a, *nx, *ny, 1);) } else if (strcmp(format,"fits") == 0) {5 get_fits(infile[0], inname[0], outfile, a, nx, ny);( } else if (strcmp(format,"hhh") == 0) {% get_hhh(infile, inname, a, nx, ny); } else {; fprintf(stderr, "get_data: unknown format %s\n", format); exit(-1); } /*C * Close files. Note that two files are used only for format hhh.G * infile[0] and infile[1] may point to the same file (usually stdin). */ fclose(infile[0]);L if (strcmp(format,"hhh") == 0 && infile[1] != infile[0]) fclose(infile[1]);} static void#get_raw(infile,inname,a,nx,ny,swap)*FILE *infile; /* input file pointer */(char *inname; /* input file name */2int **a; /* pointer to image array (returned) */(int nx, ny; /* image is NX x NY */5int swap; /* non-zero to swap bytes during input */{ int i, j, k; short *sa; int tswap;, *a = (int *) malloc(nx * ny * sizeof(int)); /*; * read a row at a time to minimize page faulting problems */+ sa = (short *) malloc(ny * sizeof(short));2 if (sa == (short *) NULL || *a == (int *) NULL) {+ fprintf(stderr, "insufficient memory\n"); exit(-1); } /*' * see if byte swapping will be needed */ if (swap) { tswap = test_swap(); } else { tswap = 0; } /* * read rows */ for (i=0; i#include int optind; char *optarg;/*< * a[nx][ny] is the image array (gets allocated in get_data)P * Note that ny 0d\~ HCOMPRESS.BCKCOMPRESS.SOURCE]HCOMP.C;1P^(set by command line parameter -r) is the fast-varying dimension *- * scale is the scale factor for digitization *$ * format describes the input format */ int verbose;static FILE *infile[2];static char *inname[2];static int *a, nx, ny;static int scale;static char *format;extern void get_data();extern void htrans();extern void digitize();extern void encode();extern int getopt();static void hcinit();static void usage();main (argc, argv) int argc; char *argv[];{ /*? * Get command line arguments, open input file(s) if necessary */ hcinit(argc, argv); /*$ * Read data, return address & size* * FITS header will get written to stdout */8 get_data(infile, inname, stdout, &a, &nx, &ny, format); if (verbose) {: fprintf(stderr, "Image size (%d,%d) Scale factor %d\n", ny,nx,scale); } /* * H-transform */ htrans(a,nx,ny); /* * Digitize */ digitize(a,nx,ny,scale); /* * Encode and write to stdout */ encode(stdout,a,nx,ny,scale); free(a); exit(0);} static voidusage(argc,argv) int argc; char *argv[];{A fprintf(stderr, "Usage: %s options [data-file [header-file]]\n", argv[0]);+ fprintf(stderr, " where options = %s\n",B "[-v] [-i raw|net|fits|hhh] [-s scale] [-r rows] [-c columns]"); exit(-1);} /* GET COMMAND LINE ARGUMENTS */ static voidhcinit(argc, argv) int argc; char *argv[];{int c; /* * default values */ nx = -1; ny = -1; verbose = 0; scale = 1024; format = "raw"; /* * get options */4 while ((c = getopt(argc,argv,"vr:c:s:i:")) != -1) { switch (c) { case 'v': /* * verbose flag -v */ verbose = 1; break; case 'r': /* * -r  */& if (sscanf(optarg,"%d",&ny) != 1) {2 fprintf(stderr, "bad row size: %s\n", optarg); usage(argc,argv); } break; case 'c': /* * -c  */& if (sscanf(optarg,"%d",&nx) != 1) {5 fprintf(stderr, "bad column size: %s\n", optarg); usage(argc,argv); } break; case 's': /* * -s  */) if (sscanf(optarg,"%d",&scale) != 1) {/ fprintf(stderr, "bad scale: %s\n", optarg); usage(argc,argv); } break; case 'i': /** * -i = raw, net, fits, or hhh */ format = optarg;$ if (strcmp(format,"raw") != 0 &&! strcmp(format,"net") != 0 &&! strcmp(format,"fits") != 0 &&! strcmp(format,"hhh") != 0) {9 fprintf(stderr, "Illegal input format %s\n", format); usage(argc,argv); } break; case '?': usage(argc,argv); } } /*I * get optional input file names from trailing parameters and open files */ if (optind < argc) { inname[0] = argv[optind++];= if ((infile[0] = fopen(inname[0], "r")) == (FILE *) NULL) {< fprintf(stderr, "Cannot open data file %s\n", inname[0]); exit(-1); } } else { /* * default input is from stdin */ infile[0] = stdin; inname[0] = "stdin"; } /*- * header file is only used for format "hhh" */! if (strcmp(format,"hhh") == 0) { if (optind < argc) { inname[1] = argv[optind++];> if ((infile[1] = fopen(inname[1], "r")) == (FILE *) NULL) {? fprintf(stderr, "Cannot open header file %s\n", inname[1]); exit(-1); } } else { /*/ * default input is from same source as data */ infile[1] = infile[0]; inname[1] = inname[0]; } } /*/ * make sure there are not too many parameters */ if (optind < argc) {A fprintf(stderr, "Too many parameters: %s ...\n", argv[optind]); usage(argc,argv); } /*A * it is an error to specify row or column sizes for fits or hhh * input formats */? if (strcmp(format,"fits") == 0 || strcmp(format,"hhh") == 0) { if (nx != -1 || ny != -1) {E fprintf(stderr, "Cannot specify rows or columns with format %s\n", format); usage(argc,argv); } } else { /*# * default for row, column sizes:' * if one is specified they are equal, * if neither is specified then both = 256 */ if (nx == -1) { if (ny == -1) { nx = 256; ny = 256; } else { nx = ny; } } else if (ny == -1) { ny = nx; } }}*[HCOMPRESS.SOURCE]HDECOMP.C;1+,. / 4L -0123KPWO 567O8o#j49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */C/* hdecomp.c Decompress image file that was compressed using hcomp. *? * This version of the program can produce output in 4 formats: *C * (1) raw: I*2 pixel values with bytes in machine-dependent order,= * i.e. no byte swapping is done on output. Image size may0 * be specified with the -r and -c parameters. *F * (2) net: I*2 pixel values with bytes with bytes in "network" order:F * high byte first, then low byte for each I*2 pixel. Byte-swapping@ * is done on output if needed. Note that this is the same as@ * raw format on some machines (e.g. Suns) but is different onA * others (e.g. VAXes). Files in net format can be transferred@ * from one machine to another without modification, but files * in raw format cannot. *D * (3) fits: FITS format image. Header gives image size. Bytes are * in network order. *L * (4) hhh: This is identical to raw format, but is included for consistency* * with the input formats used by hcomp. *F * The compressed input file may have two different formats, which areG * recognized automatically by the program. If the compressed file wasI * produced from a FITS input file, then the compressed file includes theG * (uncompressed) FITS header at the start of the file, followed by theG * compressed image data. Otherwise the compressed input file contains" * only the compressed image data. *K * If the compressed file has a FITS header, then the default output format8 * is fits. Otherwise the default output format is raw. *, * Programmer: R. White Date: 17 April 1992 */#include #include int optind; char *optarg;/*: * a[nx][ny] is the image array (gets allocated in decode)- * Note that ny is the fast-varying dimension *- * scale is the scale factor for digitization */ int verbose;static int *a, nx, ny;static int scale;static int smooth;static char *format;extern void decode();extern void undigitize();extern void hinv();extern void put_data();extern int getopt();static void get_args();main (argc, argv) int argc; char *argv[];{ /* * Get command line arguments */ get_args(argc, argv); /*F * Read from stdin, passing header through to stdout for FITS format,. * and decode. Returns address, size, scale, * and (possibly) format */0 decode(stdin,stdout,&a,&nx,&ny,&scale,&format); /* * Un-Digitize */ undigitize(a,nx,ny,scale); /* * Inverse H-transform */ hinv(a,nx,ny,smooth,scale); /* * Write data */! put_data(stdout,a,nx,ny,format); free(a); if (verbose) { if (smooth) { fprintf(stderr,I "Image size (%d,%d) Scale factor %d Smoothed Output in %s format\n", ny,nx,scale,format); } else { fprintf(stderr,? "Image size (%d,%d) Scale factor %d Output in %s format\n", ny,nx,scale,format); } } exit(0);} static voidusage(argc,argv) int argc; char *argv[];{ fprintf(stderr,0 "Usage: %s [-v] [-s] [-o raw|net|fits|hhh]\n", argv[0]); exit(-1);} /* GET COMMAND LINE ARGUMENTS */ static voidget_args(argc, argv) int argc; char *argv[];{int c; /* * default values */ verbose = 0; smooth = 0; format = ""; /* * get options *// while ((c = getopt(argc,argv,"vso:")) != -1) { switch (c) { case 'v': /* * verbose flag -v */ verbose = 1; break; case 's': /* * smoothing flag -s */ smooth = 1; break; case 'o': /** * -o = raw, net, fits, or hhh */ format = optarg;$ if (strcmp(format,"raw") != 0 &&! strcmp(format,"net") != 0 &&! strcmp(format,"fits") != 0 &&! strcmp(format,"hhh") != 0) {9 fprintf(stderr, "Illegal input format %s\n", format); usage(argc,argv); } break; case '?': usage(argc,argv); } } /*@ * make sure there aren't any trailing parameters being ignored */ if (optind < argc) {A fprintf(stderr, "Too many parameters: %s ...\n", argv[optind]); usage(argc,argv); }}*[HCOMPRESS.SOURCE]HINV.C;1+,u./ 4D -0123KPWO56 f78cj49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */8/* hinv.c Inverse H-transform of NX x NY integer image *+ * Programmer: R. White Date: 23 July 1993 */#include #include #include static void unshuffle();extern void hsmooth(); extern void hinv(a,nx,ny,smooth,scale)int a[]; int nx,ny;Dint smooth; /* 0 for no smoothing, else smooth during inversion */2int scale; /* used if smoothing is specified */{int nmax, log2n, i, j, k;int nxtop,nytop,nxf,nyf,c;int oddx,oddy;1int shift, bit0, bit1, bit2, mask0, mask1, mask2,< prnd0, prnd1, prnd2, nrnd0, nrnd1, nrnd2, lowbit0, lowbit1;int h0, hx, hy, hc; int s10, s00; int *tmp; /*= * log2n is log2 of max(nx,ny) rounded up to next power of 2 */ nmax = (nx>ny) ? nx : ny;( log2n = log((float) nmax)/log(2.0)+0.5; if ( nmax > (1<> 1; prnd1 = bit1 >> 1; prnd2 = bit2 >> 1; nrnd0 = prnd0 - 1; nrnd1 = prnd1 - 1; nrnd2 = prnd2 - 1; /* * round h0 to multiple of bit2 */7 a[0] = (a[0] + ((a[0] >= 0) ? prnd2 : nrnd2)) & mask2; /* * do log2n expansions *< * We're indexing a as a 2-D array with dimensions (nx,ny). */ nxtop = 1; nytop = 1; nxf = nx; nyf = ny; c = 1<=0; k--) { /*6 * this somewhat cryptic code generates the sequence5 * ntop[k-1] = (ntop[k]+1)/2, where ntop[log2n] = n */ c = c>>1; nxtop = nxtop<<1; nytop = nytop<<1;2 if (nxf <= c) { nxtop -= 1; } else { nxf -= c; }2 if (nyf <= c) { nytop -= 1; } else { nyf -= c; } /*> * double shift and fix nrnd0 (because prnd0=0) on last pass */ if (k == 0) { nrnd0 = 0; shift = 2; } /*; * unshuffle in each dimension to interleave coefficients */ for (i = 0; i= 0) ? prnd1 : nrnd1)) & mask1;4 hy = (hy + ((hy >= 0) ? prnd1 : nrnd1)) & mask1;4 hc = (hc + ((hc >= 0) ? prnd0 : nrnd0)) & mask0; /*$ * propagate bit0 of hc to hx,hy */ lowbit0 = hc & bit0;5 hx = (hx >= 0) ? (hx - lowbit0) : (hx + lowbit0);5 hy = (hy >= 0) ? (hy - lowbit0) : (hy + lowbit0); /*0 * Propagate bits 0 and 1 of hc,hx,hy to h0.; * This could be simplified if we assume h0>0, but then: * the inversion would not be lossless for images with * negative pixels. */$ lowbit1 = (hc ^ hx ^ hy) & bit1; h0 = (h0 >= 0) ? (h0 + lowbit0 - lowbit1)= : (h0 + ((lowbit0 == 0) ? lowbit1 : (lowbit0-lowbit1))); /*% * Divide sums by 2 (4 last time) */, a[s10+1] = (h0 + hx + hy + hc) >> shift;, a[s10 ] = (h0 + hx - hy - hc) >> shift;, a[s00+1] = (h0 - hx + hy - hc) >> shift;, a[s00 ] = (h0 - hx - hy + hc) >> shift; s00 += 2; s10 += 2; } if (oddy) { /*2 * do last element in row if row length is odd * s00+1, s10+1 are off edge */ h0 = a[s00 ]; hx = a[s10 ];7 hx = ((hx >= 0) ? (hx+prnd1) : (hx+nrnd1)) & mask1; lowbit1 = hx & bit1;5 h0 = (h0 >= 0) ? (h0 - lowbit1) : (h0 + lowbit1);" a[s10 ] = (h0 + hx) >> shift;" a[s00 ] = (h0 - hx) >> shift; } } if (oddx) { /*) * do last row if column length is odd * s10, s10+1 are off edge */ s00 = ny*i;& for (j = 0; j= 0) ? (hy+prnd1) : (hy+nrnd1)) & mask1; lowbit1 = hy & bit1;5 h0 = (h0 >= 0) ? (h0 - lowbit1) : (h0 + lowbit1);" a[s00+1] = (h0 + hy) >> shift;" a[s00 ] = (h0 - hy) >> shift; s00 += 2; } if (oddy) { /*? * do corner element if both row and column lengths are odd% * s00+1, s10, s10+1 are off edge */ h0 = a[s00 ]; a[s00 ] = h0 >> shift; } } /*2 * divide all the masks and rounding values by 2 */ bit2 = bit1; bit1 = bit0; bit0 = bit0 >> 1; mask1 = mask0; mask0 = mask0 >> 1; prnd1 = prnd0; prnd0 = prnd0 >> 1; nrnd1 = nrnd0; nrnd0 = prnd0 - 1; } free(tmp);} static voidunshuffle(a,n,n2,tmp)#int a[]; /* array to shuffle */+int n; /* number of elements to shuffle */#int n2; /* second dimension */$int tmp[]; /* scratch storage */{int i; int nhalf;int *p1, *p2, *pt;  /*! * copy 2nd half of array to tmp */ nhalf = (n+1)>>1; pt = tmp;. p1 = &a[n2*nhalf]; /* pointer to a[i] */ for (i=nhalf; i= 0; i--) { *p1 = *p2; p2 -= n2; p1 -= (n2+n2); } /*= * now distribute 2nd half of array (in tmp) to odd elements */ pt = tmp;) p1 = &a[n2]; /* pointer to a[i] */ for (i=1; i#include (#define min(a,b) (((a)<(b)) ? (a) : (b))(#define max(a,b) (((a)>(b)) ? (a) : (b)) extern void hsmooth(a,nxtop,nytop,ny,scale)3int a[]; /* array of H-transform coefficients */9int nxtop,nytop; /* size of coefficient block to use */0int ny; /* actual 1st dimension of array */8int scale; /* truncation scale factor that was used */{ int i, j;-int ny2, s10, s00, diff, dmax, dmin, s, smax;-int hm, h0, hp, hmm, hpm, hmp, hpp, hx2, hy2; int m1,m2; /*A * Maximum change in coefficients is determined by scale factor.B * Since we rounded during division (see digitize.c), the biggest * permitted change is scale/2. */ smax = (scale >> 1); if (smax <= 0) return; ny2 = ny << 1; /*G * We're indexing a as a 2-D array with dimensions (nxtop,ny) of whichE * only (nxtop,nytop) are used. The coefficients on the edge of theC * array are not adjusted (which is why the loops below start at 26 * instead of 0 and end at nxtop-2 instead of nxtop.) */ /* * Adjust x difference hx */! for (i = 2; i=0, dmin<=0. */ if (dmin < dmax) {' diff = max( min(diff, dmax), dmin); /*9 * Compute change in slope limited to range +/- smax.8 * Careful with rounding negative numbers when using * shift for divide by 8. */ s = diff-(a[s10]<<3);& s = (s>=0) ? (s>>3) : ((s+7)>>3) ;" s = max( min(s, smax), -smax); a[s10] = a[s10]+s; } s00 += 2; s10 += 2; } } /* * Adjust y difference hy */ for (i = 0; i=0) ? (s>>3) : ((s+7)>>3) ;" s = max( min(s, smax), -smax); a[s00+1] = a[s00+1]+s; } s00 += 2; s10 += 2; } } /*" * Adjust curvature difference hc */! for (i = 2; i=0, dmin<=0. */ if (dmin < dmax) {' diff = max( min(diff, dmax), dmin); /*9 * Compute change in slope limited to range +/- smax.8 * Careful with rounding negative numbers when using * shift for divide by 64. */ s = diff-(a[s10+1]<<6);' s = (s>=0) ? (s>>6) : ((s+63)>>6) ;" s = max( min(s, smax), -smax); a[s10+1] = a[s10+1]+s; } s00 += 2; s10 += 2; } }}*[HCOMPRESS.SOURCE]HTRANS.C;1+,. / 4A *-0123KPWO 56 7 8 j49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */2/* htrans.c H-transform of NX x NY integer image ** * Programmer: R. White Date: 11 May 1992 */#include #include #include static void shuffle(); extern void htrans(a,nx,ny)int a[]; int nx, ny;{7int nmax, log2n, h0, hx, hy, hc, nxtop, nytop, i, j, k;int oddx, oddy;+int shift, mask, mask2, prnd, prnd2, nrnd2; int s10, s00; int *tmp; /*= * log2n is log2 of max(nx,ny) rounded up to next power of 2 */ nmax = (nx>ny) ? nx : ny;( log2n = log((float) nmax)/log(2.0)+0.5; if ( nmax > (1<> shift;: hx = (a[s10+1] + a[s10] - a[s00+1] - a[s00]) >> shift;: hy = (a[s10+1] - a[s10] + a[s00+1] - a[s00]) >> shift;: hc = (a[s10+1] - a[s10] - a[s00+1] + a[s00]) >> shift; /*? * Throw away the 2 bottom bits of h0, bottom bit of hx,hy.; * To get rounding to be same for positive and negative" * numbers, nrnd2 = prnd2 - 1. */ a[s10+1] = hc;= a[s10 ] = ( (hx>=0) ? (hx+prnd) : hx ) & mask ;= a[s00+1] = ( (hy>=0) ? (hy+prnd) : hy ) & mask ;= a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; s00 += 2; s10 += 2; } if (oddy) { /*2 * do last element in row if row length is odd * s00+1, s10+1 are off edge */( h0 = (a[s10] + a[s00]) << (1-shift);( hx = (a[s10] - a[s00]) << (1-shift);= a[s10 ] = ( (hx>=0) ? (hx+prnd) : hx ) & mask ;= a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; s00 += 1; s10 += 1; } } if (oddx) { /*) * do last row if column length is odd * s10, s10+1 are off edge */ s00 = i*ny;& for (j = 0; j=0) ? (hy+prnd) : hy ) & mask ;= a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; s00 += 2; } if (oddy) { /*? * do corner element if both row and column lengths are odd% * s00+1, s10, s10+1 are off edge */ h0 = a[s00] << (2-shift);= a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; } } /*A * now shuffle in each dimension to group coefficients by order */ for (i = 0; i>1; nytop = (nytop+1)>>1; /** * divisor doubles after first reduction */ shift = 1; /*7 * masks, rounding values double after each iteration */ mask = mask2; prnd = prnd2; mask2 = mask2 << 1; prnd2 = prnd2 << 1; nrnd2 = prnd2 - 1; } free(tmp);} static voidshuffle(a,n,n2,tmp)#int a[]; /* array to shuffle */+int n; /* number of elements to shuffle */#int n2; /* second dimension */$int tmp[]; /* scratch storage */{int i;int *p1, *p2, *pt; /* * copy odd elements to tmp */ pt = tmp; p1 = &a[n2]; for (i=1; i < n; i += 2) { *pt = *p1; pt += 1; p1 += (n2+n2); } /*/ * compress even elements into first half of A */ p1 = &a[n2]; p2 = &a[n2+n2]; for (i=2; i#include extern int'makefits(outfile,nx,ny,bitpix,datatype)FILE *outfile; int nx,ny; int bitpix;char *datatype;{char line[81];int i; fprintf(outfile, "%-80.80s",: "SIMPLE = T /Standard FITS format");1 strcpy(line,"BITPIX = /");$ sprintf(&line[10], "%20d", bitpix); line[30] = ' ';$ fprintf(outfile, "%-80.80s", line); fprintf(outfile, "%-80.80s",4 "NAXIS = 2 /Number of axes");1 strcpy(line,"NAXIS1 = /"); sprintf(&line[10], "%20d", ny); line[30] = ' ';$ fprintf(outfile, "%-80.80s", line);1 strcpy(line,"NAXIS2 = /"); sprintf(&line[10], "%20d", nx); line[30] = ' ';$ fprintf(outfile, "%-80.80s", line);1 strcpy(line,"DATATYPE= /");K sprintf(&line[10], "'%*.*s'", strlen(datatype),strlen(datatype),datatype);! line[12+strlen(datatype)] = ' ';$ fprintf(outfile, "%-80.80s", line);% fprintf(outfile, "%-80.80s", "END"); /*; * pad with blank lines to get multiple of 36 (2880 bytes) */$ for (i=0; i<80; i++) line[i] = ' '; line[80] = '\0';* for (i=7; i<36; i++) fputs(line,outfile);}*[HCOMPRESS.SOURCE]PUT_DATA.C;1+,./ 4D-0123KPWO56LQ7L8L#Vk49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */D/* put_data.c Write int image data to outfile as I*2, swapping bytes * if requested *, * Programmer: R. White Date: 17 April 1992 */#include #include extern int mywrite();extern int test_swap();extern void swap_bytes();static void put_raw();static void put_fits(); extern void put_data(outfile,a,nx,ny,format)$FILE *outfile; /* output file */'int a[]; /* pointer to image array */%int nx,ny; /* image is NX x NY */(char *format; /* output file format */{> if (strcmp(format,"raw") == 0 || strcmp(format,"hhh") == 0) {! put_raw(outfile, a, nx, ny, 0);( } else if (strcmp(format,"net") == 0) {! put_raw(outfile, a, nx, ny, 1);) } else if (strcmp(format,"fits") == 0) { put_fits(outfile, a, nx, ny); } else {; fprintf(stderr, "put_data: unknown format %s\n", format); exit(-1); }} static voidput_raw(outfile,a,nx,ny,swap)FILE *outfile;int a[]; int nx,ny; int swap;{ int i, j, k; short *sa; int tswap; /*' * see if byte-swapping will be needed */ if (swap) { tswap = test_swap(); } else { tswap = 0; } /*< * write a row at a time to minimize page faulting problems */+ sa = (short *) malloc(ny * sizeof(short)); if (sa == (short *) NULL) {+ fprintf(stderr, "insufficient memory\n"); exit(-1); } for (i=0; i 0) { /* * allocate a block of zeros */+ sa = (short *) calloc(n , sizeof(short)); if (sa == (short *) NULL) {, fprintf(stderr, "insufficient memory\n"); exit(-1); }@ if(mywrite(outfile, sa, n*sizeof(short)) != n*sizeof(short)) { perror("put_data"); exit(-1); } free(sa); }}*[HCOMPRESS.SOURCE]QREAD.C;1+,{./ 4D-0123KPWO567, 8,k49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. *//* qread.c Read binary data *, * Programmer: R. White Date: 11 March 1991 */#include #include extern int readint();extern void qread();extern int myread(); extern intreadint(infile) FILE *infile;{int a,i;unsigned char b[4];2 /* Read integer A one byte at a time from infile. *< * This is portable from Vax to Sun since it eliminates the * need for byte-swapping. */4 for (i=0; i<4; i++) qread(infile,(char *) &b[i],1); a = b[0];' for (i=1; i<4; i++) a = (a<<8) + b[i]; return(a);} extern voidqread(infile,a,n) FILE *infile;char *a;int n;{ if(myread(infile, a, n) != n) { perror("qread"); exit(-1); }} extern intmyread(file, buffer, n) FILE *file;char buffer[];int n;{ /*) * read n bytes from file into bufferB * returns number of bytes read (=n) if successful, <=0 if not *6 * this version is for VMS C: each read may return: * fewer than n bytes, so multiple reads may be needed * to fill the buffer. *B * I think this is unnecessary for Sun Unix, but it won't hurt# * either, so I'll leave it in. */ int nread, total;/ /* keep reading until we've read n bytes */ total = 0;D while ( (nread = fread(&buffer[total], 1, n-total, file)) > 0) { total += nread; if (total==n) return(total); }9 /* end-of-file or error occurred if we got to here */ return(nread);}"*[HCOMPRESS.SOURCE]QTREE_DECODE.C;1+,./ 4K-0123KPWO56,u7,8k49GHJ"?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */K/* qtree_decode.c Read stream of codes from infile and construct bit planes< * in quadrant of 2-D array using binary quadtree coding *) * Programmer: R. White Date: 7 May 1991 */#include #include #include 5#define input_nybble(infile) input_nbits(infile,4)extern int input_nbits();extern int input_bit();static void qtree_expand();static void qtree_bitins();static void qtree_copy();static void read_bdirect();static int input_huffman(); extern void+qtree_decode(infile,a,n,nqx,nqy,nbitplanes) FILE *infile;9int a[]; /* a is 2-D array with dimensions (n,n) */.int n; /* length of full row in a */5int nqx; /* partial length of row to decode */4int nqy; /* partial length of column (<=n) */9int nbitplanes; /* number of bitplanes to decode */{int log2n, k, bit, b, nqmax;int nx,ny,nfx,nfy,c;int nqx2, nqy2;unsigned char *scratch; /*? * log2n is log2 of max(nqx,nqy) rounded up to next power of 2 */ nqmax = (nqx>nqy) ? nqx : nqy;) log2n = log((float) nqmax)/log(2.0)+0.5; if (nqmax > (1<= 0; bit--) { /*9 * Was bitplane was quadtree-coded or written directly? */ b = input_nybble(infile); if(b == 0) { /*" * bit map was written directly */0 read_bdirect(infile,a,n,nqx,nqy,scratch,bit); } else if (b != 0xf) {; fprintf(stderr, "qtree_decode: bad format code %x\n",b); exit(-1); } else { /*4 * bitmap was quadtree-coded, do log2n expansions * * read first code */& scratch[0] = input_huffman(infile); /*C * now do log2n expansions, reading codes from file as necessary */ nx = 1; ny = 1; nfx = nqx; nfy = nqy; c = 1<>1; nx = nx<<1; ny = ny<<1;1 if (nfx <= c) { nx -= 1; } else { nfx -= c; }1 if (nfy <= c) { ny -= 1; } else { nfy -= c; }/ qtree_expand(infile,scratch,nx,ny,scratch); } /*A * now copy last set of 4-bit codes to bitplane bit of array a */) qtree_bitins(scratch,nqx,nqy,a,n,bit); } } free(scratch);}/*A * do one quadtree expansion step on array a[(nqx+1)/2,(nqy+1)/2]; * results put into b[nqx,nqy] (which may be the same as a) */ static voidqtree_expand(infile,a,nx,ny,b) FILE *infile;unsigned char a[];int nx;int ny;unsigned char b[];{int i; /*1 * first copy a to b, expanding each 4-bit value */ qtree_copy(a,nx,ny,b,ny); /*> * now read new 4-bit values into b for each non-zero element */! for (i = nx*ny-1; i >= 0; i--) {. if (b[i] != 0) b[i] = input_huffman(infile); }}/*E * copy 4-bit values from a[(nx+1)/2,(ny+1)/2] to b[nx,ny], expanding * each value to 2x2 pixels * a,b may be same array */ static voidqtree_copy(a,nx,ny,b,n)unsigned char a[];int nx;int ny;unsigned char b[];'int n; /* declared y dimension of b */{int i, j, k, nx2, ny2; int s00, s10; /* * first copy 4-bit values to b+ * start at end in case a,b are same array */ nx2 = (nx+1)/2; ny2 = (ny+1)/2;8 k = ny2*(nx2-1)+ny2-1; /* k is index of a[i,j] */ for (i = nx2-1; i >= 0; i--) {9 s00 = 2*(n*i+ny2-1); /* s00 is index of b[2*i,2*j] */ for (j = ny2-1; j >= 0; j--) { b[s00] = a[k]; k -= 1; s00 -= 2; } } /* * now expand each 2x2 block */ for (i = 0; i>1) & 1; b[s00+1] = (b[s00]>>2) & 1; b[s00 ] = (b[s00]>>3) & 1; s00 += 2; s10 += 2; } if (j < ny) { /*- * row size is odd, do last element in row * s00+1, s10+1 are off edge */ b[s10 ] = (b[s00]>>1) & 1; b[s00 ] = (b[s00]>>3) & 1; } } if (i < nx) { /*$ * column size is odd, do last row * s10, s10+1 are off edge */ s00 = n*i; for (j = 0; j>2) & 1; b[s00 ] = (b[s00]>>3) & 1; s00 += 2; } if (j < ny) { /*9 * both row and column size are odd, do corner element$ * s00+1, s10, s10+1 are off edge */ b[s00 ] = (b[s00]>>3) & 1; } }}/*E * Copy 4-bit values from a[(nx+1)/2,(ny+1)/2] to b[nx,ny], expandingA * each value to 2x2 pixels and inserting into bitplane BIT of B.D * A,B may NOT be same array (it wouldn't make sense to be inserting$ * bits into the same array anyway.) */ static voidqtree_bitins(a,nx,ny,b,n,bit)unsigned char a[];int nx;int ny;int b[];'int n; /* declared y dimension of b */int bit;{ int i, j, k; int s00, s10; /* * expand each 2x2 block */. k = 0; /* k is index of a[i/2,j/2] */ for (i = 0; i>1) & 1) << bit;& b[s00+1] |= ((a[k]>>2) & 1) << bit;& b[s00 ] |= ((a[k]>>3) & 1) << bit; s00 += 2; s10 += 2; k += 1; } if (j < ny) { /*- * row size is odd, do last element in row * s00+1, s10+1 are off edge */& b[s10 ] |= ((a[k]>>1) & 1) << bit;& b[s00 ] |= ((a[k]>>3) & 1) << bit; k += 1; } } if (i < nx) { /*$ * column size is odd, do last row * s10, s10+1 are off edge */ s00 = n*i; for (j = 0; j>2) & 1) << bit;& b[s00 ] |= ((a[k]>>3) & 1) << bit; s00 += 2; k += 1; } if (j < ny) { /*9 * both row and column size are odd, do corner element$ * s00+1, s10, s10+1 are off edge */& b[s00 ] |= ((a[k]>>3) & 1) << bit; k += 1; } }} static void,read_bdirect(infile,a,n,nqx,nqy,scratch,bit) FILE *infile;int a[];int n;int nqx;int nqy;unsigned char scratch[];int bit;{int i; /*) * read bit image packed 4 pixels/nybble */2 for (i = 0; i < ((nqx+1)/2) * ((nqy+1)/2); i++) {$ scratch[i] = input_nybble(infile); } /*% * insert in bitplane BIT of image A */' qtree_bitins(scratch,nqx,nqy,a,n,bit);}/*# * Huffman decoding for fixed codes * * Coded values range from 0-15 * * Huffman code values (hex): *" * 3e, 00, 01, 08, 02, 09, 1a, 1b,! * 03, 1c, 0a, 1d, 0b, 1e, 3f, 0c *# * and number of bits in each code: *! * 6, 3, 3, 4, 3, 4, 5, 5, * 3, 5, 4, 5, 4, 5, 6, 4 */ static intinput_huffman(infile) FILE *infile;{int c; /* * get first 3 bits to start */ c = input_nbits(infile,3); if (c < 4) { /* * this is all we need! * return 1,2,4,8 for c=0,1,2,3 */ return(1<#include #include /*6 * Huffman code values and number of bits in each code */static int code[16] = {0 0x3e, 0x00, 0x01, 0x08, 0x02, 0x09, 0x1a, 0x1b,/ 0x03, 0x1c, 0x0a, 0x1d, 0x0b, 0x1e, 0x3f, 0x0c };static int ncode[16] = {- 6, 3, 3, 4, 3, 4, 5, 5,, 3, 5, 4, 5, 4, 5, 6, 4 };/*9 * variables for bit output to buffer when Huffman coding */!static int bitbuffer, bits_to_go;/*@ * macros to write out 4-bit nybble, Huffman code for this value */:#define output_nybble(outfile,c) output_nbits(outfile,c,4)H#define output_huffman(outfile,c) output_nbits(outfile,code[c],ncode[c])extern void output_nbits();static void qtree_onebit();static void qtree_reduce();static int bufcopy();static void write_bdirect(); extern void,qtree_encode(outfile,a,n,nqx,nqy,nbitplanes)FILE *outfile;int a[];3int n; /* physical dimension of row in a */'int nqx; /* length of row */.int nqy; /* length of column (<=n) */:int nbitplanes; /* number of bit planes to output */{9int log2n, i, k, bit, b, bmax, nqmax, nqx2, nqy2, nx, ny; unsigned char *scratch, *buffer; /*? * log2n is log2 of max(nqx,nqy) rounded up to next power of 2 */ nqmax = (nqx>nqy) ? nqx : nqy;) log2n = log((float) nqmax)/log(2.0)+0.5; if (nqmax > (1< * We're indexing A as a 2-D array with dimensions (nqx,nqy).< * Scratch is 2-D with dimensions (nqx/2,nqy/2) rounded up.7 * Buffer is used to store string of codes for output. */, scratch = (unsigned char *) malloc(2*bmax);) buffer = (unsigned char *) malloc(bmax);+ if ((scratch == (unsigned char *) NULL) ||( (buffer == (unsigned char *) NULL)) {9 fprintf(stderr, "qtree_encode: insufficient memory\n"); exit(-1); } /*4 * now encode each bit plane, starting with the top */* for (bit=nbitplanes-1; bit >= 0; bit--) { /* * initial bit buffer */ b = 0; bitbuffer = 0; bits_to_go = 0; /** * on first pass copy A to scratch array */( qtree_onebit(a,n,nqx,nqy,scratch,bit); nx = (nqx+1)>>1; ny = (nqy+1)>>1; /*A * copy non-zero values to output buffer, which will be written * in reverse order */. if (bufcopy(scratch,nx*ny,buffer,&b,bmax)) { /*! * quadtree is expanding data,; * change warning code and just fill buffer with bit-map */2 write_bdirect(outfile,a,n,nqx,nqy,scratch,bit); goto bitplane_done; } /* * do log2n reductions */ for (k = 1; k>1; ny = (ny+1)>>1;/ if (bufcopy(scratch,nx*ny,buffer,&b,bmax)) {3 write_bdirect(outfile,a,n,nqx,nqy,scratch,bit); goto bitplane_done; } } /*% * OK, we've got the code in bufferD * Write quadtree warning code, then write buffer in reverse order */ output_nybble(outfile,0xF); if (b==0) { if (bits_to_go>0) { /* * put out the last few bits */: output_nbits(outfile, bitbuffer & ((1<0) { /* * put out the last few bits */: output_nbits(outfile, bitbuffer & ((1<=0; i--) {& output_nbits(outfile,buffer[i],8); } } bitplane_done: ; } free(buffer); free(scratch);}/*+ * copy non-zero codes from array to buffer */ static intbufcopy(a,n,buffer,b,bmax)unsigned char a[];int n;unsigned char buffer[];int *b; int bmax;{int i; for (i = 0; i < n; i++) { if (a[i] != 0) { /*) * add Huffman code for a[i] to buffer */) bitbuffer |= code[a[i]] << bits_to_go; bits_to_go += ncode[a[i]]; if (bits_to_go >= 8) {" buffer[*b] = bitbuffer & 0xFF; *b += 1; /*, * return warning code if we fill buffer */ if (*b >= bmax) return(1); bitbuffer >>= 8; bits_to_go -= 8; } } } return(0);}/*: * Do first quadtree reduction step on bit BIT of array A. * Results put into B. *  */ static voidqtree_onebit(a,n,nx,ny,b,bit)int a[];int n;int nx;int ny;unsigned char b[];int bit;{ int i, j, k;int b0, b1, b2, b3; int s10, s00; /*+ * use selected bit to get amount to shift */ b0 = 1<> bit; k += 1; s00 += 2; s10 += 2; } if (j < ny) { /*- * row size is odd, do last element in row * s00+1,s10+1 are off edge */ b[k] = ( ((a[s10 ]<<1) & b1)' | ((a[s00 ]<<3) & b3) ) >> bit; k += 1; } } if (i < nx) { /*$ * column size is odd, do last row * s10,s10+1 are off edge */ s00 = n*i; for (j = 0; j> bit; k += 1; s00 += 2; } if (j < ny) { /*9 * both row and column size are odd, do corner element$ * s00+1, s10, s10+1 are off edge */* b[k] = ( ((a[s00 ]<<3) & b3) ) >> bit; k += 1; } }}/*, * do one quadtree reduction step on array a2 * results put into b (which may be the same as a) */ static voidqtree_reduce(a,n,nx,ny,b)unsigned char a[];int n;int nx;int ny;unsigned char b[];{ int i, j, k; int s10, s00;, k = 0; /* k is index of b[i/2,j/2] */ for (i = 0; i#include extern void writeint();extern void qwrite();extern int mywrite(); extern voidwriteint(outfile,a)FILE *outfile;int a;{int i;unsigned char b[4];2 /* Write integer A one byte at a time to outfile. *< * This is portable from Vax to Sun since it eliminates the * need for byte-swapping. */ for (i=3; i>=0; i--) { b[i] = a & 0x000000ff; a >>= 8; }- for (i=0; i<4; i++) qwrite(outfile,&b[i],1);} extern voidqwrite(outfile,a,n)FILE *outfile;char *a;int n;{" if(mywrite(outfile, a, n) != n) { perror("qwrite"); exit(-1); }} extern intmywrite(file, buffer, n) FILE *file;char buffer[];int n;{ /*) * read n bytes from file into bufferB * returns number of bytes read (=n) if successful, <=0 if not */* return ( fwrite(buffer, 1, n, file) );} *[HCOMPRESS.SOURCE]SWAP_BYTES.C;1+,C./ 4@-0123KPWO56G7 8 Ll49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */&/* swap_bytes.c Swap bytes in I*2 data *, * Programmer: R. White Date: 17 April 1992 *//*< * test to see if byte swapping is necessary on this machine */ extern int test_swap(){union { short s; char c[2]; } u; u.c[0] = 0; u.c[1] = 1; return (u.s != 1);}/* * swap bytes in pairs in A */ extern voidswap_bytes(a,n)unsigned char a[];int n;{int i;unsigned char tmp; for (i=0; i < n-1; i += 2) { tmp = a[i]; a[i] = a[i+1]; a[i+1] = tmp; }} *[HCOMPRESS.SOURCE]UNDIGITIZE.C;1+,T./ 4@-0123KPWO56L7,A&8,l49GHJ?/* Copyright (c) 1993 Association of Universities for Research @ * in Astronomy. All rights reserved. Produced under National @ * Aeronautics and Space Administration Contract No. NAS5-26555. */'/* undigitize.c undigitize H-transform *) * Programmer: R. White Date: 9 May 1991 */#include extern voidundigitize(a,nx,ny,scale)int a[]; int nx,ny; int scale;{int *p; /* * multiply by scale */ if (scale <= 1) return;2 for (p=a; p <= &a[nx*ny-1]; p++) *p = (*p)*scale;}*[HCOMPRESS]UNIX.DIR;1+,./ 4-v0123 KPWO56R7 %8 "O49GHJI AAREADME. Y FCOMPRESS.CSH J HCOMPRESS.1 V HCOMPRESS.CSH [HDECOMPRESS.CSH ^ MAKEFILE. S*[HCOMPRESS.UNIX]AAREADME.;1+, Y./ 4L-0123KPWO56,+Y7,}8,JQs49GHJ @ Installation instructions for HCOMPRESS on Unix machines. R. L. White, 20 April 1992CThis directory contains a makefile for building HCOMPRESS on a UnixDmachine and some C-shell scripts to make using the programs a littleGeasier. This makefile has only been tested on Suns and DECStations, so<some small modifications may be required for other machines.Steps for installation:=(1) Copy the contents the contents of this directory into the source directory.D(2) Do "make all" (or just "make") to compile and link the programs.A(3) Edit makefile: change the INSTALLDIR variable to point to theC directory where you want the executables to reside. By defaultG they will go into ${HOME}/bin, i.e. your bin directory. You should4 chose a directory that is included in your path.G(4) Do "make install" to install the programs in your chosen directory.+(5) Do "rehash" to update your hash tables.E(6) There is a man page in the file hcompress.1. It can be installedH in your man directory. The doc directory includes both a plain textD version of the man page (hcompress.txt) and a postscript version (hcompress.ps).CNow the programs should be ready to run. You may want to customizeBthe shell scripts for your applications. Some possible changes to consider:E(1) There are shell scripts to compress multiple files in FITS formatE and in hhh/hhd format. If you usually use some other formats you@ could include in the script a conversion from your format to one of the accepted formats.G(2) The amount of compression is determined by the scale factor, set byK the -s option in the programs. For astronomical images the compressionE is generally limited by the amount of noise in the images and theD scale factor should be about 2 times the RMS noise in the image.D For noiseless images any non-zero scale factor will give up someH information, so the choice of scale factor will be determined by howH much you are willing to lose. A default scale factor of 666 is usedL in the scripts -- this should probably be changed to a value appropriateJ for your typical images. If you like, you could set this default to 0 (lossless compression.);Copyright (c) 1993 Association of Universities for Research:in Astronomy. All rights reserved. Produced under National=Aeronautics and Space Administration Contract No. NAS5-26555.*[HCOMPRESS.UNIX]FCOMPRESS.CSH;1+, J./ 4J-0123KPWO56̅7 28 s49GHJ  #! /bin/cshJ# Shell file to do H-transform image compression for a list of image files2# in FITS format. Files are replaced by .H.#A# Program will compress only I*2 images with no group parameters.)# (A warning is issued for other images.)#G# The default compression scale factor is 666, which is appropriate forI# GASP images (gives about a factor of 10 compression, negligible loss in# information.)#=# Copyright (c) 1993 Association of Universities for Research<# in Astronomy. All rights reserved. Produced under National?# Aeronautics and Space Administration Contract No. NAS5-26555.## R. White, 20 April 1992# set noclobberset shellfile=$0set cdir=`dirname $shellfile`set prgnam=${shellfile:t}#if ($#argv == 0) then> echo "Usage: ${prgnam} [options] files... [options] files..." echo " where options are:"= echo " -s scale to specify the compression scale factor"= echo " -k to keep the uncompressed file (default)"5 echo " -r to remove the uncompressed file" echoG echo "Default compression scale factor is 666 (good for GASP images.)") echo "Compressed files are named *.*.H." exitendif set scale=666set nextscale=0 set remove=0foreach parm ($*) if ($nextscale) then set scale=$parm set nextscale=0 echo Using scale $scale else if ("$parm" == "-s") then set nextscale=1 else if ("$parm" == "-r") then set remove=1 else if ("$parm" == "-k") then set remove=0 else set datafile="$parm" set compfile="${datafile}.H" if (-e $compfile) then. echo "${prgnam}: $compfile already exists" else if (! -e $datafile) then/ echo "${prgnam}: ${datafile}: No such file" else # # do the compression # echo -n "$datafile "0 $cdir/hcomp -v -s $scale -i fits $datafile \ > $compfile if ($status == 0) then if ($remove) then # delete original file /bin/rm $datafile endif elseC echo "${prgnam}: $datafile not compressed: compression error" /bin/rm $compfile endif endif endif endifend*[HCOMPRESS.UNIX]HCOMPRESS.1;1+, V.!/ 4P!-0123KPWO"567 p8 s49GHJ .TH HCOMPRESS 1 "20 April 1992".SH NAMEPhcompress, hdecompress, fcompress, fdecompress \- compress and decompress images .SH SYNOPSIS.HP+.B hcomp -v -i raw\||\|net\||\|fits\||\|hhh.B -s.I scale.B -r.I rows.B -c .I columns(.RI [\ datafile \ [\ headerfile \ ]\ ].HP.B hdecomp -v -s -o .B raw\||\|net\||\|fits\||\|hhh.HP.B hcompress -s.I scale.B -k -r.IR files .\|.\|..RI [\ options \ ].IR files .\|.\|..HP.B fcompress -s.I scale.B -k -r.IR file  ,~ HCOMPRESS.BCK V[HCOMPRESS.UNIX]HCOMPRESS.1;1P! <s .\|.\|..RI [\ options \ ].IR files .\|.\|..HP.B hdecompress -s -u -k -r -o.B raw\||\|net\||\|fits\||\|hhh.IR files .\|.\|..RI [\ options \ ].IR files .\|.\|..HP.B fdecompress -s -u -k -r -o.B raw\||\|net\||\|fits\||\|hhh.IR files .\|.\|..RI [\ options \ ].IR files .\|.\|..SH DESCRIPTION .B hcompressGis an image compression package written to compress the Space Telescope=Science Institute (STScI) Digitized Sky Survey images. It isFwell-suited to the compression of astronomical images, which generally@consist of flat sky sprinkled with point sources (stars) and the2occasional extended source (galaxies and nebulae).Briefly, the method used is:.IP (1)<a wavelet transform called the H-transform (a Haar transform+generalized to two dimensions), followed by.IP (2)=quantization that discards noise in the image while retaining%the signal on all scales, followed by.IP (3).quadtree coding of the quantized coefficients..PPEThe technique gives very good compression for astronomical images andFis fast, requiring about 4 seconds for compression or decompression ofFa 512x512 image on a Sun SPARCstation 1. The calculations are carried9out using integer arithmetic and are entirely reversible.BConsequently, the program can be used for either lossy or losslessBcompression, with no special approach needed for the lossless case0(e.g. there is no need for a file of residuals.)GThese programs can compress 2-byte integer images in a small variety ofJinput formats. The resulting compressed image file is machine-independent9and may be transferred between computers with binary FTP.The executable programs.B hcompand .B hdecomp@are the basic tools for compression and decompression of images.AUsers with images in FITS format will generally find it easier touse the .B fcompressand.B fdecompress0scripts, while users with images in the IRAF and+STSDAS hhh/hhd file formats will prefer the .B hcompressand.B hdecompressscripts.D(FITS is the Flexible Image Transport System, which is the universalstandard for astronomical data.BIRAF is a widely used astronomical data analysis system; STSDAS isBa package of IRAF tasks designed for Hubble Space Telescope data.)DThose who wish to use this compression software for non-astronomicalEimages will probably find these scripts inadequate and are encouragedEto create their own scripts using these as a model. It also would beArather easy to modify the source code so that 8-bit images can beused as input.EIn Unix these programs and scripts can be installed in some directoryfound in your path using the.B make installBcommand. In VMS it is necessary to define symbols pointing to the+directory and the programs by executing the .B @hcompinit command file.2To compress a 2-byte integer image in FITS format,.RS.B fcompress -s.I scale image.fits.RECproduces an output file named image.fits.H (or image.fits_H in VMS)Dwith the compressed image. The input file image.fits is not removed unless the.B -r/option is specified. To decompress this image,.RS.B fdecompress image.fits.H.RE*will create a FITS file called image.fits.The.B -s.I scale,option determines the amount of compression..I Scale== 0 or 1 leads to lossless compression, i.e. the decompressed>image has exactly the same pixel values as the original image.If.I scale>> 1 then the compression is lossy: the decompressed image will.I not$be exactly the same as the original.AFor astronomical images, lossless compression is generally ratherBineffective because the images have a good deal of noise, which is=inherently incompressible. However, if some of this noise is2discarded then the images compress very well. The.I scaleDfactor determines how much of the noise is discarded. We have found that setting.I scaleLto 2 times sigma, the RMS noise in the image, usually results in compressionAby about a factor of 10 (i.e. the compressed image requires about=1.5 bits/pixel), while producing a decompressed image that is=nearly indistinguishable from the original. In fact, the RMS@difference between the decompressed image and the original imageAwill be only about 1/2 sigma. Our experiments indicate that thisFlevel of loss has no noticeable effect on either the visual appearanceKof the image or on quantitative analysis of the image (e.g. measurements of@positions and brightnesses of stars are not adversely affected.).PPUsing a larger value for.I scaleGresults in higher compression at the cost of larger differences betweenEthe compressed and original images. A rough rule of thumb is that if.I scaleEequals N sigma, then the image will compress to about 3/N bits/pixel,Dand the RMS difference between the original and the compressed imageDwill be about N/4 sigma. This crude relationship is inaccurate bothEfor very high compression ratios and for lossless compression, but itDdoes at least give an indication of what to expect of the compressedimages.BFor images in which the noise varies from pixel to pixel (e.g. CCDGimages, where the noise is larger for brighter pixels), the appropriate value for.I scaleEis determined by the RMS noise level in the sky regions of the image.@For images that are essentially noiseless, any lossy compressionCis noticeable under sufficiently close inspection of the image, butHsome loss is nonetheless acceptable for typical applications. Note thatthe quantization scheme used in .B hcompressis .I notIdesigned to give images that appear as much like the original as possibleCto the human eye, but rather is designed to produce images that areCas similar as possible to the original under quantitative analysis.?Thus, our emphasis is on discarding noise without affecting theAsignal rather than on discarding components of the image that areDnot very noticeable to the eye (as may be done, for example, by JPEG6compression.) The resulting compression scheme is not:ideal for typical terrestrial images (though it is still a;reasonably good method for those images), but we believe it,is close to optimal for astronomical images. .SH OPTIONS.HP.B hcomp -v -i .B raw\||\|net\||\|fits\||\|hhh.B -s.I scale.B -r.I rows.B -c .I columns(.RI [\ datafile \ [\ headerfile \ ]\ ].PP.B hcomp/reads an image from the standard input (or from .I datafileand .I headerfile2if specified) and writes a compressed image to thestandard output..RS.TP.B -vHVerbose. A description of the input file and the compression achieved is%written to the standard error output..TP".B -i raw\||\|net\||\|fits\||\|hhhInput format. Choices are:.RS.TP.B raw.Pixel values have 2 bytes in machine-dependent7order, i.e. no byte swapping is done on input. This is(the default format if none is specified..TP.B net-Pixel values have 2 bytes in "network" order:=high byte first, then low byte for each pixel. Byte-swapping:is done on input if needed. Note that this is the same as;raw format on some machines (e.g. Suns) but is different on<others (e.g. VAXes). Files in net format can be transferred;from one machine to another without modification, but filesin raw format cannot..TP.B fitsBFITS (Flexible Image Transport System) format image. Header gives<image size. Bytes are in network order. FITS format is the8universal standard for transport of astronomical images..TP.B hhh9FITS-type header (but without padding lines making header'multiple of 2880 bytes) in a file named.IR rootname.xxh ,with8the pixel values (bytes in machine-dependent order) in adifferent file named.IR rootname.xxd ."No byte-swapping is done on input..RE.TP.BI -s\ scaleAScale factor. Non-negative integer that determines the amount ofcompression. Default is.I scaleA= 1024, which could be wildly inappropriate for your images. Use.I scale@= 0 for lossless compression. See the discussion above for more information..TP.B -rHPixels/row. This is the quickly varying dimension in the file, i.e. theIorder of pixels in the file is all pixels from first row, all pixels fromGsecond row, etc. Note that the size of the image can be specified this way only for.B rawand.B netformat images;.B fitsand.B hhh<format images include a header giving the size of the image.Default value is 256..TP.B -cAPixels/column. This is the slowly varying dimension in the file.Default value is 256..TP .I datafile@Input data file. If not specified the input is read from stdin..TP .I headerfile5Input header file. This is only specified for format .BR hhh ,?in which the header and data are in separate files. It is also<possible to concatenate the header and data files into stdinfor.B hhhformat images..RE.HP.B hdecomp -v -s -o.B raw\||\|net\||\|fits\||\|hhh.PP .B hdecomp;reads a compressed image from the standard input and writes,a decompressed image to the standard output..RS.TP.B -v,Verbose. A description of the output file is%written to the standard error output..TP.B -s<Smoothing flag. At high compressions the decompressed image9begins to appear blocky because of the way information is>discarded. This blockiness is greatly reduced, producing morepleasing images, if the.B -sAflag is specified during decompression. Default is no smoothing..TP".B -o raw\||\|net\||\|fits\||\|hhhOutput format. Default is.B fits/for input files that were in FITS format and is.B raw;for other input file formats. Note that this means that animage that was originally in.B net;format is not, by default, decompressed to the same format.4Other input formats are properly decompressed to thesame format on output..RE.HP.B hcompress -s.I scale.B -k -r.IR files .\|.\|..RI [\ options \ ].IR files .\|.\|..PP .B hcompress compresses one or more images in.B hhh input format..RS.TP.BI -s\ scaleEScale factor. Default in script is 666. Note that this is differentthan the default in .BR hcomp .FYou can modify the script to insert a typical value for your images as the default..TP.B -k0Keep original files after compression (default)..TP.B -r2Remove original files after compression. Only the1data file (\*.hhd) is removed, the header file isretained in any case..TP.IR files .\|.\|.AOne or more hhh/hhd format images to compress. Wild cards may beCused. The names of the data files (not the header files) should beAspecified. Note that one can mix options and file names; optionsGapply only to files that follow them on the command line. For example,Athe removal of the original images may be turned on and off usingthe.B -rand.B -kflags.If .I infile.xxd/is the name of an original image data file, the-resulting compressed image is in a file named.IB infile.xxd .H(or.IB infile.xxd _Hin VMS.).RE.HP.B fcompress -s.I scale.B -k -r.IR files .\|.\|..RI [\ options \ ].IR files .\|.\|..PP .B fcompress compresses one or more images in.B fits input format..RS.TP.BI -s\ scaleScale factor. As for.BR hcompress , the script default value is 666..TP.B -k0Keep original files after compression (default)..TP.B -r(Remove original files after compression..TP.IR files .\|.\|.+One or more FITS format images to compress.If .I infile+is the name of an input FITS file, then theresulting compressedimage is in a file named .IB infile .H(or .IB infile _Hin VMS.).RE.HP.B hdecompress -u -s -k -r -o.B raw\||\|net\||\|fits\||\|hhh.IR files .\|.\|..RI [\ options \ ].IR files .\|.\|..HP.B fdecompress -u -s -k -r -o.B raw\||\|net\||\|fits\||\|hhh.IR files .\|.\|..RI [\ options \ ].IR files .\|.\|..PP6These programs decompress one or more compressed imagefiles..B hdecompressand.B fdecompressCare actually the same program; the two different names are provided2for consistency with the two compression programs, .B hcompressand.BR fcompress ..RS.TP.B -uDisable smoothing (default)..TP.B -sEnable smoothing..TP.B -k9Keep compressed image file after decompression (default)..TP.B -r1Remove compressed image file after decompression..TP".B -o raw\||\|net\||\|fits\||\|hhhOutput format. Default is.B fitsfor files originally in FITS format, and.B rawfor other files. Note that.B rawformat output is correct for.B hhhformat data files..TP.IR files .\|.\|."Names of files to decompress. The.B .H6extension is added to the end of the filename if it is5not explicitly specified. (In VMS the filenames must already have.B _H"on the end of the file extension.) For an input compressed image in .IB infile .H(or .IB infile _Hin VMS)#the output decompressed image is in .IR infile ..RE.SH BUGS@Current input formats include only 16 bit, 2-dimensional images,>though the extension to other formats and to higher dimensionswould be straightforward..PP@FITS extensions such as multiple groups and group parameters are not accepted..PPBFITS header lines are not compressed when they are included in theEcompressed image file. This can significantly affect the compression?achieved for small images with large headers. It does have theBadvantage that the header can be easily examined to determined thecontents of the file..PPFIf a highly inappropriate value is specified for the scale factor, theAimage is vastly overcompressed and much information is lost. TheBcompression program ought to estimate the range of plausible scale<factors from the image statistics and issue a warning of theAuser-supplied value does not appear reasonable. It would also beAuseful to have the program make a good guess for the scale factorif it is not specified..PP%If the wrong size is given (using the.B -rand .B -cparameters) for a.B rawor.B netHformat image, the compression program may fail to read the entire image.CNo error message is issued if the image is actually bigger than thespecified size..PP>On VAXes running VMS, the decompressed image file may not have=the same record format as the original image. This can cause>problems if the software reading the image requires it to have9special characteristics (e.g. fixed record lengths.) The .B modify<program, included with the VMS command files, can be used toBchange the decompressed image files so that they have fixed recordClengths, but it uses an unsupported VMS system routine, SYS$MODIFY,?to make the modification so it is at best a makeshift solution. .SH AUTHOR3Richard L. White, Space Telescope Science Institute;Copyright (c) 1993 Association of Universities for Research:in Astronomy. All rights reserved. Produced under National=Aeronautics and Space Administration Contract No. NAS5-26555..PP:Problems, suggestions, gripes, and praise to rlw@stsci.edu*[HCOMPRESS.UNIX]HCOMPRESS.CSH;1+, [./ 4K-0123KPWO56+ 7l78lr t49GHJ  #! /bin/cshJ# Shell file to do H-transform image compression for a list of image files=# in .hhh, .hhd format. *.hhd files are replaced by *.hhd.H.#A# Program will compress only I*2 images with no group parameters.)# (A warning is issued for other images.)#G# The default compression scale factor is 666, which is appropriate forI# GASP images (gives about a factor of 10 compression, negligible loss in# information.)#=# Copyright (c) 1993 Association of Universities for Research<# in Astronomy. All rights reserved. Produced under National?# Aeronautics and Space Administration Contract No. NAS5-26555.## R. White, 20 April 1992# set noclobberset shellfile=$0set cdir=`dirname $shellfile`set prgnam=${shellfile:t}#if ($#argv == 0) then> echo "Usage: ${prgnam} [options] files... [options] files..." echo " where options are:"= echo " -s scale to specify the compression scale factor"= echo " -k to keep the uncompressed file (default)"5 echo " -r to remove the uncompressed file" echoG echo "Default compression scale factor is 666 (good for GASP images.)"K echo "Specify .hhd extension on files. Compressed files are named *.*.H." exitendif set scale=666set nextscale=0 set remove=0foreach parm ($*) if ($nextscale) then set scale=$parm set nextscale=0 echo Using scale $scale else if ("$parm" == "-s") then set nextscale=1 else if ("$parm" == "-r") then set remove=1 else if ("$parm" == "-k") then set remove=0 else set datafile="$parm" set compfile="${datafile}.H" set dext="${datafile:e}"% set hext="`echo $dext | colrm 3`h"% set headfile="${datafile:r}.$hext". if ("`echo $dext | colrm 1 2`" != "d") then> echo "${prgnam}: ${datafile} does not have .xxd extension" else if (-e $compfile) then. echo "${prgnam}: $compfile already exists" else if (! -e $datafile) then/ echo "${prgnam}: ${datafile}: No such file" else if (! -e $headfile) then/ echo "${prgnam}: ${headfile}: No such file" else # # do the compression # echo -n "$datafile "9 $cdir/hcomp -v -s $scale -i hhh $datafile $headfile \ > $compfile if ($status == 0) then if ($remove) then # delete original file /bin/rm $datafile endif elseC echo "${prgnam}: $datafile not compressed: compression error" /bin/rm $compfile endif endif endif endifend!*[HCOMPRESS.UNIX]HDECOMPRESS.CSH;1+, ^./ 4L-0123KPWO56N7lt8l{Ht49GHJ  #! /bin/cshH# Shell file to do H-transform image de-compression for a list of files.#D# If .H is not explicitly specified on end of compressed file names,# it is added.#D# Files are replaced by uncompressed file with .H removed from name.#=# Copyright (c) 1993 Association of Universities for Research<# in Astronomy. All rights reserved. Produced under National?# Aeronautics and Space Administration Contract No. NAS5-26555.# set noclobberset shellfile=$0set cdir=`dirname $shellfile`set prgnam=${shellfile:t}#if ($#argv == 0) then> echo "Usage: ${prgnam} [options] files... [options] files..." echo " where options are:"# echo " -s to enable smoothing". echo " -u to disable smoothing (default)"5 echo " -k to keep the compressed file (default)"- echo " -r to remove the compressed file"I echo " -o raw | net | fits | hhh to specify the output image format"L echo " The default output format is raw (= hhh) unless the original"H echo " image was FITS format, in which case the default is fits" echo " format." exitendif set remove=0 set smooth set formatset nextformat=0foreach file ($*) if ($nextformat) then set format=$file set nextformat=0 else if ("$file" == "-o") then set nextformat=1 else if ("$file" == "-r") then set remove=1 else if ("$file" == "-k") then set remove=0 else if ("$file" == "-s") then set smooth="-s" else if ("$file" == "-u") then set smooth else if (${file:e} == 'H') then set infile=$file set outfile=${file:r} else set infile=$file.H set outfile=$file endif if (-e $outfile) then. echo "${prgnam}: ${outfile} already exists" else if (! -e $infile) then, echo "${prgnam}: ${infile}: No such file" else echo -n "$outfile " if ($format == "") then1 $cdir/hdecomp -v $smooth < $infile > $outfile else< $cdir/hdecomp -v $smooth -o $format < $infile > $outfile endif if ($status == 0) then if ($remove) then # delete compressed file /bin/rm $infile endif else4 echo "${prgnam}: error, $infile not decompressed /bin/rm $outfile endif endif endifend*[HCOMPRESS.UNIX]MAKEFILE.;1+, S./ 4Nb-0123KPWO56=7ܨ8\|t49GHJ !# makefile for hcompress programs# R. White, 20 April 1992#I# Change INSTALLDIR to point to the directory where you want the programsN# installed. (The default is your own bin directory.) Then do "make install"N# to install the programs. A simple "make" will compile and link the programs/# in this directory, but will not install them.#=# Copyright (c) 1993 Association of Universities for Research<# in Astronomy. All rights reserved. Produced under National?# Aeronautics and Space Administration Contract No. NAS5-26555.#INSTALLDIR = ${HOME}/bin# CFLAGS = -OLIBABBR = hcompLIB = lib${LIBABBR}.aLDFLAGS = -L. -l${LIBABBR} -lmall: hcomp hdecomp* @echo "All programs compiled and linked."clean :" -/bin/rm *.o hcomp hdecomp ${LIB}## Install the programs:(# (1) Move the executables to INSTALLDIRI# (2) Copy the shell scripts to INSTALLDIR, removing the ".csh" extensionA# (3) Create a link from fdecompress to hdecompress in INSTALLDIR#install : hcomp hdecomp) @/bin/mv hcomp ${INSTALLDIR}/hcomp+ @/bin/mv hdecomp ${INSTALLDIR}/hdecomp3 @/bin/cp hcompress.csh ${INSTALLDIR}/hcompress3 @/bin/cp fcompress.csh ${INSTALLDIR}/fcompress5 @/bin/cp hdecompress.csh ${INSTALLDIR}/hdecompress@ @/bin/ln -s ${INSTALLDIR}/hdecompress ${INSTALLDIR}/fdecompress @echo- @echo "All files installed in ${INSTALLDIR}", @echo "Type 'rehash' to update path tables" # library ${LIB}: \ ${LIB}(bit_input.o) \ ${LIB}(bit_output.o) \ ${LIB}(decode.o) \ ${LIB}(digitize.o) \ ${LIB}(dodecode.o) \ ${LIB}(doencode.o) \ ${LIB}(encode.o) \ ${LIB}(fitspass.o) \ ${LIB}(fitsread.o) \ ${LIB}(get_data.o) \ ${LIB}(getopt.o) \ ${LIB}(hinv.o) \ ${LIB}(hsmooth.o) \ ${LIB}(htrans.o) \ ${LIB}(makefits.o) \ ${LIB}(put_data.o) \ ${LIB}(qread.o) \ ${LIB}(qtree_decode.o) \ ${LIB}(qtree_encode.o) \ ${LIB}(qwrite.o) \ ${LIB}(swap_bytes.o) \ ${LIB}(undigitize.o) ranlib ${LIB} @echo Library is up to date.PRECIOUS: ${LIB}# New rules for library entries.c.a: ${CC} -c ${CFLAGS} $< @ar rv ${LIB} $*.o @rm -f $*.o# # executables#hcomp : hcomp.o ${LIB}, ${CC} ${CFLAGS} hcomp.o -o hcomp ${LDFLAGS}hdecomp : hdecomp.o ${LIB}0 ${CC} ${CFLAGS} hdecomp.o -o hdecomp ${LDFLAGS}*[HCOMPRESS]VMS.DIR;1+,./ 4-v0123 KPWO56L78pQ49GHJI AAREADME. U FCOMPRESS.COM X HCOMPINIT.COM i HCOMPRESS.COM WHDECOMPRESS.COM WMAKE.COM MODIFY.C ^*[HCOMPRESS.VMS]AAREADME.;1+, U. / 4N -0123KPWO 56l&7,&8쬲{49GHJ? Installation instructions for HCOMPRESS on VMS machines. R. L. White, 20 April 1992IThis directory contains DCL command files for building HCOMPRESS on a VMSNmachine (VAX) and some DCL command files that make using the programs a littleeasier.Steps for installation:=(1) Copy the contents the contents of this directory into the source directory.0(2) Do "@MAKE" to compile and link the programs.>(3) Run "@HCOMPINIT" to define symbols for the compression and> decompression programs. You can of course include this in@ your LOGIN.COM file so that the symbols get defined wheneverE you login. The programs can be installed in some public location@ by your system manager if they are going to be used by other users on your computer.B(4) Instructions for using these programs are in the doc directoryA in the files hcompress.ps (Postscript file) and hcompress.man (plain text file).CNow the programs should be ready to run. You may want to customizeBthe command files for your applications. Some possible changes to consider:E(1) There are command files to compress multiple files in FITS formatE and in hhh/hhd format. If you usually use some other formats you@ could include in the script a conversion from your format to one of the accepted formats.G(2) The amount of compression is determined by the scale factor, set byK the -s option in the programs. For astronomical images the compressionE is generally limited by the amount of noise in the images and theD scale factor should be about 2 times the RMS noise in the image.D For noiseless images any non-zero scale factor will give up someH information, so the choice of scale factor will be determined by howH much you are willing to lose. A default scale factor of 666 is usedL in the scripts -- this should probably be changed to a value appropriateJ for your typical images. If you like, you could set this default to 0 (lossless compression.)K(3) The MODIFY program can be used to change the format of the decompressedF images from the default STREAMLF to FIXED record format. This mayG be necessary if programs you use to read the image require the file/ to be in a particular format. The usage is " MODIFY FILENAME [ blksiz ]C The default for blksiz is 512 bytes. As written by C, the file! has the following attributes:% Record format: Stream_LF< Record attributes: Carriage return carriage control After being modified, it is:> Record format: Fixed length byte records Record attributes: NoneB MODIFY does not copy the file; instead, it simply modifies the; RMS header of the file using a VMS utility, SYS$MODIFY.C Unfortunately, SYS$MODIFY is unsupported (and undocumented), so< it may fail to work with some future upgrades to the VMS@ operating system. Suggestions for a better way to make this? file modifications (short of major changes to the hcompress source code) are welcome.;Copyright (c) 1993 Association of Universities for Research:in Astronomy. All rights reserved. Produced under National=Aeronautics and Space Administration Contract No. NAS5-26555.*[HCOMPRESS.VMS]FCOMPRESS.COM;1+, X. / 4O X-0123KPWO 56&7Lz'8L{49GHJ $! fcompress.com$!K$! VMS command file to do H-transform image compression for a list of image;$! files in FITS format. Files are replaced by name.ext_H.$!B$! Program will compress only I*2 images with no group parameters.*$! (A warning is issued for other images.)$!H$! The default compression scale factor is 666, which is appropriate forJ$! gasp images (gives about a factor of 10 compression, negligible loss in$! information.)$!>$! Copyright (c) 1993 Association of Universities for Research=$! in Astronomy. All rights reserved. Produced under National@$! Aeronautics and Space Administration Contract No. NAS5-26555.$!$! R. White, 20 April 1992$!I$! determine where this procedure lives (assume that the executable files$! are in this same directory)$!D$ shellfile=f$parse(f$environment("procedure"),,,,"NO_CONCEAL")-"][";$ cdir=f$extract(0,f$locate("]",shellfile),shellfile) + "]"$$ prgnam=f$parse(shellfile,,,"NAME")$!$ echo:=write sys$output$ hc:=$'cdir'hcomp$!$ if p1.eqs.""$ thenC$ echo "Usage: ",prgnam," [options] files... [options] files..." $ echo " where options are:"A$ echo " -s scale to specify the compression scale factor"A$ echo " -k to keep the uncompressed file (default)"9$ echo " -r to remove the uncompressed file" $ echo ""K$ echo "Default compression scale factor is 666 (good for GASP images.)"-$ echo "Compressed files are named *.*_H." $ exit$ endif$! $ scale=666 $ nextscale=0 $ remove=0$ p=1$ ploop:$ parm = p'p*$ if parm.eqs."" then exit ! all done$ if nextscale.eq.1$ then!$ scale=parm ! set scale$ nextscale=0!$ echo "Using scale ", scale$ goto endploop $ endif$ if parm.eqs."-S"$ then+$ nextscale=1 ! next parm is scale$ goto endploop $ endif$ if parm.eqs."-R"$ then,$ remove=1 ! remove original files$ goto endploop $ endif$ if parm.eqs."-K"$ then*$ remove=0 ! keep original files$ goto endploop $ endif$!3$! compress the file(s) specified by this parameterD$! use f$search to allow the use of wildcards in file specifications$!9$ datafile=f$search(parm,1) ! get original file name$ if datafile.eqs.""$ then1$ echo prgnam,": ",datafile,": No such file"$ goto endploop $ endif$!E$! save name of first file to correct the stupid behavior of f$search?$! when the file argument does not contain a wildcard character$!$ firstfile=datafile$ floop:&$ dext=f$parse(datafile,,,"TYPE")$ cext=dext+"_H"J$ compfile=f$parse(cext+";",datafile,,,"SYNTAX_ONLY") ! compress name$!O$! if compressed file already exists, we'll rely on VMS to create a new version$!$!$! perform compression$!$ echo datafile($ define/user sys$output 'compfile'*$ hc -v -s 'scale' -i fits 'datafile'-$ if $status.eq.1 ! check for success $ thenF$ if remove.eq J ![HCOMPRESS.BN_WNLNP@1OMR!{,$r;1Jׯ)6(]G^eLZU<o1(&(;|4drUqp,I$k/G"i/Hby_x+J T\JwR]:E4kip75WGm{hJV "#"z2F "G6(A;J/v ŌŎ(k ],s*~4Lvos OA4~wl[oi}6V* DhtQNeo+-i0'ZvS "{C ILqsf;iDCR4^.h;:_!pT5[Uz&T2IT'l LY;G!(+S&N1Mo.Jr8W6Ntw~eiCR{ho*OuH.o[Vt &!A)m5!UA%ouF3oPz bl@Kg % CB r J]Z. x%fH}7im?n\Z&'\+*jw?qC-kUf\ttv&A\9&gR>|c_4 `jeT]q v-@\,*sL#[*;Zk%rsoJ#N&d=_QV@?\^ b nw9}:eC\\;$9Y<2uW@aB0 y?b$<aUmDZ5)K mmS8vA)H3,T9predE,6D1)g8lBdw\J|oo% =W ,JM57-Z$$7Nq9M(BV^5z[~iq}-J@[$BEDiQO5' :L/]=u0QNDu\Dl4/qF^0 >ZhtLfI'AIxdP_*IP]U+nuuO&@5=F\*,@*&R+baM@.MvjRwBvJZ3/90k0^$iX }S ߡJ&dP6R^,-+%]<R3O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.H+9`9[q1}10UIk5oMMkn~%n~~AN?)s)D3=@r :# +W O  -h@bK ^Sya68NEtOd LDmrKE|sf=j#47?f(&$Q.RI [\ options \ ].IR files .\|.\|..HP.B fcompress -s.I scale.B -k -r.IR file  1Gq~ HCOMPRESS.BCK X[HCOMPRESS.VMS]FCOMPRESS.COM;1O .1 then delete 'datafile' ! delete original file $ elseH$ echo prgnam,": ",datafile," not compressed: compression error"7$ delete 'compfile' ! delete compressed file $ endif $ endfloop:$!$! get next file name$!E$! be careful: f$search returns the same name every time if there are0$! no wildcard characters in the argument (dumb)$! $ datafile=f$search(parm,1) $ if datafile.nes.firstfile $ then,$ if datafile.nes."" then goto floop $ endif$!$! go to next parameter$! $ endploop: $ p = p+1$ goto ploop*[HCOMPRESS.VMS]HCOMPINIT.COM;1+, i./ 4F-0123KPWO56lP"'7,C'8,b|49GHJ$! hcompinit.com$!F$! Initialize VMS symbols for hcompress, hdecompress image compression $! programs.$!>$! Copyright (c) 1993 Association of Universities for Research=$! in Astronomy. All rights reserved. Produced under National@$! Aeronautics and Space Administration Contract No. NAS5-26555.$!$! R. White, 20 April 1992$!F$! Determine where this procedure lives (assume that the command files.$! and executables are in this same directory)$!D$ shellfile=f$parse(f$environment("procedure"),,,,"NO_CONCEAL")-"]["@$ hcompdir==f$extract(0,f$locate("]",shellfile),shellfile) + "]"$!4$! executables are installed as VMS foreign commands$!$ hcomp:==$'hcompdir'hcomp$ hdecomp:==$'hcompdir'hdecomp$ modify:==$'hcompdir'modify$!)$! command files have symbols defined too$!"$ hcompress:==@'hcompdir'hcompress"$ fcompress:==@'hcompdir'fcompress&$ hdecompress:==@'hcompdir'hdecompress&$ fdecompress:==@'hcompdir'hdecompress*[HCOMPRESS.VMS]HCOMPRESS.COM;1+, W. / 4O V-0123KPWO 56 M'7q'8(E|49GHJ$! hcompress.com$!K$! VMS command file to do H-transform image compression for a list of imageD$! files in .hhh, .hhd format. *.hhd files are replaced by *.hhd_H.$!B$! Program will compress only I*2 images with no group parameters.*$! (A warning is issued for other images.)$!H$! The default compression scale factor is 666, which is appropriate forJ$! gasp images (gives about a factor of 10 compression, negligible loss in$! information.)$!>$! Copyright (c) 1993 Association of Universities for Research=$! in Astronomy. All rights reserved. Produced under National@$! Aeronautics and Space Administration Contract No. NAS5-26555.$!$! R. White, 20 April 1992$!I$! determine where this procedure lives (assume that the executable files$! are in this same directory)$!D$ shellfile=f$parse(f$environment("procedure"),,,,"NO_CONCEAL")-"][";$ cdir=f$extract(0,f$locate("]",shellfile),shellfile) + "]"$$ prgnam=f$parse(shellfile,,,"NAME")$!$ echo:=write sys$output$ hc:=$'cdir'hcomp$!$ if p1.eqs.""$ thenC$ echo "Usage: ",prgnam," [options] files... [options] files..." $ echo " where options are:"A$ echo " -s scale to specify the compression scale factor"A$ echo " -k to keep the uncompressed file (default)"9$ echo " -r to remove the uncompressed file" $ echo ""K$ echo "Default compression scale factor is 666 (good for GASP images.)"O$ echo "Specify .hhd extension on files. Compressed files are named *.*_H." $ exit$ endif$! $ scale=666 $ nextscale=0 $ remove=0$ p=1$ ploop:$ parm = p'p*$ if parm.eqs."" then exit ! all done$ if nextscale.eq.1$ then!$ scale=parm ! set scale$ nextscale=0!$ echo "Using scale ", scale$ goto endploop $ endif$ if parm.eqs."-S"$ then+$ nextscale=1 ! next parm is scale$ goto endploop $ endif$ if parm.eqs."-R"$ then,$ remove=1 ! remove original files$ goto endploop $ endif$ if parm.eqs."-K"$ then*$ remove=0 ! keep original files$ goto endploop $ endif$!3$! compress the file(s) specified by this parameterD$! use f$search to allow the use of wildcards in file specifications$!9$ datafile=f$search(parm,1) ! get original file name$ if datafile.eqs.""$ then1$ echo prgnam,": ",datafile,": No such file"$ goto endploop $ endif$!E$! save name of first file to correct the stupid behavior of f$search?$! when the file argument does not contain a wildcard character$!$ firstfile=datafile$ floop:&$ dext=f$parse(datafile,,,"TYPE")#$ hext=f$extract(0,3,dext)+"H"H$ headfile=f$parse(hext+";",datafile,,,"SYNTAX_ONLY") ! header name$ cext=dext+"_H"J$ compfile=f$parse(cext+";",datafile,,,"SYNTAX_ONLY") ! compress name$! $! check that header file existsO$! if compressed file already exists, we'll rely on VMS to create a new version$!%$ if f$extract(3,1,dext).nes."D" $ thenC$ echo prgnam,": ",datafile," does not have .xxd extension"$ goto endfloop $ endif%$ if f$search(headfile,2).eqs."" $ then4$ echo prgnam,": ",headfile,": No such file"$ goto endfloop $ endif$!$! perform compression$!$ echo datafile($ define/user sys$output 'compfile'4$ hc -v -s 'scale' -i hhh 'datafile' 'headfile'-$ if $status.eq.1 ! check for success $ thenF$ if remove.eq.1 then delete 'datafile' ! delete original file $ elseH$ echo prgnam,": ",datafile," not compressed: compression error"7$ delete 'compfile' ! delete compressed file $ endif $ endfloop:$!$! get next file name$!E$! be careful: f$search returns the same name every time if there are0$! no wildcard characters in the argument (dumb)$! $ datafile=f$search(parm,1) $ if datafile.nes.firstfile $ then,$ if datafile.nes."" then goto floop $ endif$!$! go to next parameter$! $ endploop: $ p = p+1$ goto ploop *[HCOMPRESS.VMS]HDECOMPRESS.COM;1+, W. / 4P p-0123KPWO 56,'7,'8, y|49GHJ$! hdecompress.com$!O$! VMS command file to do H-transform image de-compression for a list of files.'$! *.xxx_H files are replaced by *.xxx.$!>$! Copyright (c) 1993 Association of Universities for Research=$! in Astronomy. All rights reserved. Produced under National@$! Aeronautics and Space Administration Contract No. NAS5-26555.$!$! R. White, 20 April 1992$!I$! determine where this procedure lives (assume that the executable files$! are in this same directory)$!D$ shellfile=f$parse(f$environment("procedure"),,,,"NO_CONCEAL")-"][";$ cdir=f$extract(0,f$locate("]",shellfile),shellfile) + "]"$$ prgnam=f$parse(shellfile,,,"NAME")$!$ echo:=write sys$output$ hd:=$'cdir'hdecomp$!$ if p1.eqs.""$ thenC$ echo "Usage: ",prgnam," [options] files... [options] files..." $ echo " where options are:"'$ echo " -s to enable smoothing"2$ echo " -u to disable smoothing (default)"9$ echo " -k to keep the compressed file (default)"1$ echo " -r to remove the compressed file"M$ echo " -o raw | net | fits | hhh to specify the output image format"P$ echo " The default output format is raw (= hhh) unless the original"L$ echo " image was FITS format, in which case the default is fits"$ echo " format." $ echo ""N$ echo " Compressed files are named *.*_H; decompressed are named *.*."P$ echo " _H should be explicitly specified at the end of the file names." $ exit$ endif$! $ remove=0 $ smooth="" $ format=""$ nextformat=0$ p=1$ ploop:$ parm = p'p($ if parm.eqs."" then exit ! all done$ if nextformat.eqs.1$ then($ format=parm ! set output format$ nextformat=0$ goto endploop $ endif$ if parm.eqs."-O"$ then<$ nextformat=1 ! next parameter will be output format$ goto endploop $ endif$ if parm.eqs."-R"$ then*$ remove=1 ! remove original files$ goto endploop $ endif$ if parm.eqs."-K"$ then($ remove=0 ! keep original files$ goto endploop $ endif$ if parm.eqs."-S"$ then$$ smooth="-s" ! smooth images$ goto endploop $ endif$ if parm.eqs."-U"$ then($ smooth="" ! don't smooth images$ goto endploop $ endif$!5$! decompress the file(s) specified by this parameterD$! use f$search to allow the use of wildcards in file specifications$!.$ compfile=f$search(parm,1) ! get file name$ if compfile.eqs.""$ then1$ echo prgnam,": ",compfile,": No such file"$ goto endploop $ endif$!E$! save name of first file to correct the stupid behavior of f$search?$! when the file argument does not contain a wildcard character$!$ firstfile=compfile$ floop:&$ cext=f$parse(compfile,,,"TYPE")$!%$! make sure file name ends with "_H"$!5$ if f$extract(f$length(cext)-2,2,cext).nes."_H" $ thenC$ echo prgnam,": ",compfile,": Filename does not end in _H"$ goto endfloop $ endif$!>$! remove "_H" from end of extension to get original file name$!.$ dext=f$extract(0,f$length(cext)-2,cext)J$ datafile=f$parse(dext+";",compfile,,,"SYNTAX_ONLY") ! original name$!K$! if original file still exists, we'll rely on VMS to create a new version$!$!$! perform decompression$!$ echo datafile$ on warning then continue$ if format.nes."" $ then+$ define/user sys$input 'compfile'+$ define/user sys$output 'datafile'$$ hd -v 'smooth' -o 'format' $ else+$ define/user sys$input 'compfile'+$ define/user sys$output 'datafile'$ hd -v 'smooth' $ endif.$ if $status.eq.1 ! check for success $ thenI$ if remove.eq.1 then delete 'compfile' ! delete compressed file $ else>$ echo prgnam,": error, ",compfile," not decompressed"3$ delete 'datafile' ! delete decomp file $ endif $ endfloop:$!$! get next file name$!E$! be careful: f$search returns the same name every time if there are0$! no wildcard characters in the argument (dumb)$! $ compfile=f$search(parm,1) $ if compfile.nes.firstfile $ then,$ if compfile.nes."" then goto floop $ endif$!$! go to next parameter$! $ endploop: $ p = p+1$ goto ploop*[HCOMPRESS.VMS]MAKE.COM;1+, ./ 4Dd-0123KPWO56l̴'7'8W|49GHJ>$! make.com VMS command file to make hcomp.exe and hdecomp.exe$!>$! Copyright (c) 1993 Association of Universities for Research=$! in Astronomy. All rights reserved. Produced under National@$! Aeronautics and Space Administration Contract No. NAS5-26555.$!$! R. White, 20 April 1992$!$! first make the library$! $ set ver$ cc bit_input$ cc bit_output $ cc decode $ cc digitize $ cc dodecode $ cc doencode $ cc encode $ cc fitspass $ cc fitsread $ cc get_data $ cc getopt $ cc hinv $ cc hsmooth $ cc htrans $ cc makefits $ cc put_data $ cc qread$ cc qtree_decode$ cc qtree_encode $ cc qwrite$ cc swap_bytes$ cc undigitize $ set nover$ delete libhcomp.olb;*$ lib/cre libhcomp - bit_input, - bit_output, - decode, - digitize, - dodecode, - doencode, - encode, - fitspass, - fitsread, - get_data, - getopt, - hinv, - hsmooth, - htrans, - makefits, - put_data, - qread, - qtree_decode, - qtree_encode, - qwrite, - swap_bytes, - undigitize$ delete *.obj;*4$ write sys$output "Library LIBHCOMP is up-to-date."$!$! now make executables$! $ cc hcomp-$ define/user lnk$library sys$library:vaxcrtl$ link hcomp,libhcomp/lib$ delete hcomp.obj;* $ cc hdecomp-$ define/user lnk$library sys$library:vaxcrtl$ link hdecomp,libhcomp/lib$ delete hdecomp.obj;*$!$! make MODIFY$! $ cc modify-$ define/user lnk$library sys$library:vaxcrtl $ link modify$ delete modify.obj;*D$ write sys$output "Executables HCOMP, HDECOMP, and MODIFY created."$ set protect=(o:rwed) *.*;-1$ purge$ exit*[HCOMPRESS.VMS]MODIFY.C;1+, ^. / 4M >-0123KPWO 56l'7̸(88|49GHJK/* modify.c Modify RMS record header for VMS file to turn a stream format9 * file into a fixed-length blksiz-byte format files. */ * Programmer: R. White Date: 22 April 1992 */#include #include static void modify(); static voidusage(){9 fprintf(stderr, "Usage: MODIFY filename [ blksize ]\n"); exit(-1);}main (argc, argv) int argc; char *argv[];{ int arg = 0;char *filename; int blksiz; if (++arg >= argc) usage(); filename = argv[arg]; if (++arg < argc) {. if (sscanf(argv[arg], "%d", &blksiz) != 1) {: fprintf(stderr, "modify: bad blksize %s\n", argv[arg]); usage(); } } else { blksiz = 512; } if (++arg < argc) {D fprintf(stderr, "modify: too many parameters %s...\n", argv[arg]); usage(); } modify(filename, blksiz); exit(0);}=/* Procedure which changes record format to fixed and record = * length to blksiz (parameter) for file filename (parameter) * by modifying file header. *: * As written by C, the file has the following attributes: *# * Record format: Stream_LF: * Record attributes: Carriage return carriage control * * After being modified, it has: *< * Record format: Fixed length byte records * Record attributes: None *I * The binary contents of the file are just fine for fixed length recordsJ * (i.e. there's no extra junk between records). It's convenient to writeI * the file in the default Stream_LF format, though, because then I don't> * have to break up all the records into -byte chunks. *? * Created from a program from Pittsburgh Supercomputer Center. ** * Programmer: R. White Date: 1 April 1988 */#include "#define RME$C_SETRFM 0X00000001 static voidmodify(filename, blksiz)char *filename; long blksiz;{struct FAB myfab = cc$rms_fab; long status;' if (blksiz < 1 || blksiz > 32767) { fprintf(stderr,H "modify: blocksize must be between 1 and 32767 inclusive."); exit(1); }K myfab.fab$b_fac = FAB$M_PUT; /* file access mode = put access */E myfab.fab$l_fop |= FAB$M_ESC; /* escape to allow $modify */M myfab.fab$l_ctx |= RME$C_SETRFM; /* user context (whatever that is) */F myfab.fab$w_ifi = 0; /* internal file identifier */6 myfab.fab$l_fna = filename; /* filename */= myfab.fab$b_fns = strlen(filename); /* filename length */7 if (((status = SYS$OPEN(&myfab, 0, 0)) & 7) != 1) {? fprintf(stderr,"modify: Couldn't open %s\n", filename); exit(status); }; myfab.fab$w_mrs = blksiz; /* record length */A myfab.fab$b_rfm = FAB$C_FIX; /* fixed record format */9 if (((status = SYS$MODIFY(&myfab, 0, 0)) & 7) != 1) {A fprintf(stderr,"modify: Couldn't modify %s\n", filename); exit(status); }8 if (((status = SYS$CLOSE(&myfab, 0, 0)) & 7) != 1) {@ fprintf(stderr,"modify: Couldn't close %s\n", filename); exit(status); }}5 ^~ HCOMPRESS.BCK X[HCOMPRESS.VMS]FCOMPRESS.COM;1O ;.1 then delete 'datafile' ! delete original file $ elseH$ echo prgnam,": ",datafile," not compressed: compression error"7$ delete 'compfile' ! delete compressed file $ endif $ endfloop:$!$! get next file name$!E$! be careful: f$search returns the same name every time if there are0$! no wildcard characters in the argument (dumb)$! $ datafile=f$search(parm,1) $ if datafile.nes.firstfile $ then,$ if datafile.nes."" then goto floop $ endif$!$! go to next parameter$! $ endploop: $ p = p+1$ goto ploop*[HCOMPRESS.VMS]HCOMPINIT.COM;1+, i./ 4F-0123KPWO56lP"'7,C'8,b|49GHJ$! hcompinit.com$!F$! Initialize VMS symbols for hcompress, hdecompress image compression $! programs.$!>$! Copyright (c) 1993 Association of Universities for Research=$! in Astronomy. All rights reserved. Produced under National@$! Aeronautics and Space Administration Contract No. NAS5-26555.$!$! R. White, 20 April 1992$!F$! Determine where this procedure lives (assume that the command files.$! and executables are in this same directory)$!D$ shellfile=f$parse(f$environment("procedure"),,,,"NO_CONCEAL")-"]["@$ hcompdir==f$extract(0,f$locate("]",shellfile),shellfile) + "]"$!4$! executables are installed as VMS foreign commands$!$ hcomp:==$'hcompdir'hcomp$ hdecomp:==$'hcompdir'hdecomp$ modify:==$'hcompdir'modify$!)$! command files have symbols defined too$!"$ hcompress:==@'hcompdir'hcompress"$ fcompress:==@'hcompdir'fcompress&$ hdecompress:==@'hcompdir'hdecompress&$ fdecompress:==@'hcompdir'hdecompress*[HCOMPRESS.VMS]HCOMPRESS.COM;1+, W. / 4O V-0123KPWO 56 M'7q'8(E|49GHJ$! hcompress.com$!K$! VMS command file to do H-transform image compression for a list of imageD$! files in .hhh, .hhd format. *.hhd files are replaced by *.hhd_H.$!B$! Program will compress only I*2 images with no group parameters.*$! (A warning is issued for other images.)$!H$! The default compression scale factor is 666, which is appropriate forJ$! gasp images (gives about a factor of 10 compression, negligible loss in$! information.)$!>$! Copyright (c) 1993 Association of Universities for Research=$! in Astronomy. All rights reserved. Produced under National@$! Aeronautics and Space Administration Contract No. NAS5-26555.$!$! R. White, 20 April 1992$!I$! determine where this procedure lives (assume that the executable files$! are in this same directory)$!D$ shellfile=f$parse(f$environment("procedure"),,,,"NO_CONCEAL")-"][";$ cdir=f$extract(0,f$locate("]",shellfile),shellfile) + "]"$$ prgnam=f$parse(shellfile,,,"NAME")$!$ echo:=write sys$output$ hc:=$'cdir'hcomp$!$ if p1.eqs.""$ thenC$ echo "Usage: ",prgnam," [options] files... [options] files..." $ echo " where options are:"A$ echo " -s scale to specify the compression scale factor"A$ echo " -k to keep the uncompressed file (default)"9$ echo " -r to remove the uncompressed file" $ echo ""K$ echo "Default compression scale factor is 666 (good for GASP images.)"O$ echo "Specify .hhd extension on files. Compressed files are named *.*_H." $ exit$ endif$! $ scale=666 $ nextscale=0 $ remove=0$ p=1$ ploop:$ parm = p'p*$ if parm.eqs."" then exit ! all done$ if nextscale.eq.1$ then!$ scale=parm ! set scale$ nextscale=0!$ echo "Using scale ", scale$ goto endploop $ endif$ if parm.eqs."-S"$ then+$ nextscale=1 ! next parm is scale$ goto endploop $ endif$ if parm.eqs."-R"$ then,$ remove=1 ! remove original files$ goto endploop $ endif$ if parm.eqs."-K"$ then*$ remove=0 ! keep original files$ goto endploop $ endif$!3$! compress the file(s) specified by this parameterD$! use f$search to allow the use of wildcards in file specifications$!9$ datafile=f$search(parm,1) ! get original file name$ if datafile.eqs.""$ then1$ echo prgnam,": ",datafile,": No such file"$ goto endploop $ endif$!E$! save name of first file to correct the stupid behavior of f$search?$! when the file argument does not contain a wildcard character$!$ firstfile=datafile$ floop:&$ dext=f$parse(datafile,,,"TYPE")#$ hext=f$extract(0,3,dext)+"H"H$ headfile=f$parse(hext+";",datafile,,,"SYNTAX_ONLY") ! header name$ cext=dext+"_H"J$ compfile=f$parse(cext+";",datafile,,,"SYNTAX_ONLY") ! compress name$! $! check that header file existsO$! if compressed file already exists, we'll rely on VMS to create a new version$!%$ if f$extract(3,1,dext).nes."D" $ thenC$ echo prgnam,": ",datafile," does not have .xxd extension"$ goto endfloop $ endif%$ if f$search(headfile,2).eqs."" $ then4$ echo prgnam,": ",headfile,": No such file"$ goto endfloop $ endif$!$! perform compression$!$ echo datafile($ define/user sys$output 'compfile'4$ hc -v -s 'scale' -i hhh 'datafile' 'headfile'-$ if $status.eq.1 ! check for success $ thenF$ if remove.eq.1 then delete 'datafile' ! delete original file $ elseH$ echo prgnam,": ",datafile," not compressed: compression error"7$ delete 'compfile' ! delete compressed file $ endif $ endfloop:$!$! get next file name$!E$! be careful: f$search returns the same name every time if there are0$! no wildcard characters in the argument (dumb)$! $ datafile=f$search(parm,1) $ if datafile.nes.firstfile $ then,$ if datafile.nes."" then goto floop $ endif$!$! go to next parameter$! $ endploop: $ p = p+1$ goto ploop *[HCOMPRESS.VMS]HDECOMPRESS.COM;1+, W. / 4P p-0123KPWO 56,'7,'8, y|49GHJ$! hdecompress.com$!O$! VMS command file to do H-transform image de-compression for a list of files.'$! *.xxx_H files are replaced by *.xxx.$!>$! Copyright (c) 1993 Association of Universities for Research=$! in Astronomy. All rights reserved. Produced under National@$! Aeronautics and Space Administration Contract No. NAS5-26555.$!$! R. White, 20 April 1992$!I$! determine where this procedure lives (assume that the executable files$! are in this same directory)$!D$ shellfile=f$parse(f$environment("procedure"),,,,"NO_CONCEAL")-"][";$ cdir=f$extract(0,f$locate("]",shellfile),shellfile) + "]"$$ prgnam=f$parse(shellfile,,,"NAME")$!$ echo:=write sys$output$ hd:=$'cdir'hdecomp$!$ if p1.eqs.""$ thenC$ echo "Usage: ",prgnam," [options] files... [options] files..." $ echo " where options are:"'$ echo " -s to enable smoothing"2$ echo " -u to disable smoothing (default)"9$ echo " -k to keep the compressed file (default)"1$ echo " -r to remove the compressed file"M$ echo " -o raw | net | fits | hhh to specify the output image format"P$ echo " The default output format is raw (= hhh) unless the original"L$ echo " image was FITS format, in which case the default is fits"$ echo " format." $ echo ""N$ echo " Compressed files are named *.*_H; decompressed are named *.*."P$ echo " _H should be explicitly specified at the end of the file names." $ exit$ endif$! $ remove=0 $ smooth="" $ format=""$ nextformat=0$ p=1$ ploop:$ parm = p'p($ if parm.eqs."" then exit ! all done$ if nextformat.eqs.1$ then($ format=parm ! set output format$ nextformat=0$ goto endploop $ endif$ if parm.eqs."-O"$ then<$ nextformat=1 ! next parameter will be output format$ goto endploop $ endif$ if parm.eqs."-R"$ then*$ remove=1 ! remove original files$ goto endploop $ endif$ if parm.eqs."-K"$ then($ remove=0 ! keep original files$ goto endploop $ endif$ if parm.eqs."-S"$ then$$ smooth="-s" ! smooth images$ goto endploop $ endif$ if parm.eqs."-U"$ then($ smooth="" ! don't smooth images$ goto endploop $ endif$!5$! decompress the file(s) specified by this parameterD$! use f$search to allow the use of wildcards in file specifications$!.$ compfile=f$search(parm,1) ! get file name$ if compfile.eqs.""$ then1$ echo prgnam,": ",compfile,": No such file"$ goto endploop $ endif$!E$! save name of first file to correct the stupid behavior of f$search?$! when the file argument does not contain a wildcard character$!$ firstfile=compfile$ floop:&$ cext=f$parse(compfile,,,"TYPE")$!%$! make sure file name ends with "_H"$!5$ if f$extract(f$length(cext)-2,2,cext).nes."_H" $ thenC$ echo prgnam,": ",compfile,": Filename does not end in _H"$ goto endfloop $ endif$!>$! remove "_H" from end of extension to get original file name$!.$ dext=f$extract(0,f$length(cext)-2,cext)J$ datafile=f$parse(dext+";",compfile,,,"SYNTAX_ONLY") ! original name$!K$! if original file still exists, we'll rely on VMS to create a new version$!$!$! perform decompression$!$ echo datafile$ on warning then continue$ if format.nes."" $ then+$ define/user sys$input 'compfile'+$ define/user sys$output 'datafile'$$ hd -v 'smooth' -o 'format' $ else+$ define/user sys$input 'compfile'+$ define/user sys$output 'datafile'$ hd -v 'smooth' $ endif.$ if $status.eq.1 ! check for success $ thenI$ if remove.eq.1 then delete 'compfile' ! delete compressed file $ else>$ echo prgnam,": error, ",compfile," not decompressed"3$ delete 'datafile' ! delete decomp file $ endif $ endfloop:$!$! get next file name$!E$! be careful: f$search returns the same name every time if there are0$! no wildcard characters in the argument (dumb)$! $ compfile=f$search(parm,1) $ if compfile.nes.firstfile $ then,$ if compfile.nes."" then goto floop $ endif$!$! go to next parameter$! $ endploop: $ p = p+1$ goto ploop*[HCOMPRESS.VMS]MAKE.COM;1+, ./ 4Dd-0123KPWO56l̴'7'8W|49GHJ>$! make.com VMS command file to make hcomp.exe and hdecomp.exe$!>$! Copyright (c) 1993 Association of Universities for Research=$! in Astronomy. All rights reserved. Produced under National@$! Aeronautics and Space Administration Contract No. NAS5-26555.$!$! R. White, 20 April 1992$!$! first make the library$! $ set ver$ cc bit_input$ cc bit_output $ cc decode $ cc digitize $ cc dodecode $ cc doencode $ cc encode $ cc fitspass $ cc fitsread $ cc get_data $ cc getopt $ cc hinv $ cc hsmooth $ cc htrans $ cc makefits $ cc put_data $ cc qread$ cc qtree_decode$ cc qtree_encode $ cc qwrite$ cc swap_bytes$ cc undigitize $ set nover$ delete libhcomp.olb;*$ lib/cre libhcomp - bit_input, - bit_output, - decode, - digitize, - dodecode, - doencode, - encode, - fitspass, - fitsread, - get_data, - getopt, - hinv, - hsmooth, - htrans, - makefits, - put_data, - qread, - qtree_decode, - qtree_encode, - qwrite, - swap_bytes, - undigitize$ delete *.obj;*4$ write sys$output "Library LIBHCOMP is up-to-date."$!$! now make executables$! $ cc hcomp-$ define/user lnk$library sys$library:vaxcrtl$ link hcomp,libhcomp/lib$ delete hcomp.obj;* $ cc hdecomp-$ define/user lnk$library sys$library:vaxcrtl$ link hdecomp,libhcomp/lib$ delete hdecomp.obj;*$!$! make MODIFY$! $ cc modify-$ define/user lnk$library sys$library:vaxcrtl $ link modify$ delete modify.obj;*D$ write sys$output "Executables HCOMP, HDECOMP, and MODIFY created."$ set protect=(o:rwed) *.*;-1$ purge$ exit*[HCOMPRESS.VMS]MODIFY.C;1+, ^. / 4M >-0123KPWO 56l'7̸(88|49GHJK/* modify.c Modify RMS record header for VMS file to turn a stream format9 * file into a fixed-length blksiz-byte format files. */ * Programmer: R. White Date: 22 April 1992 */#include #include static void modify(); static voidusage(){9 fprintf(stderr, "Usage: MODIFY filename [ blksize ]\n"); exit(-1);}main (argc, argv) int argc; char *argv[];{ int arg = 0;char *filename; int blksiz; if (++arg >= argc) usage(); filename = argv[arg]; if (++arg < argc) {. if (sscanf(argv[arg], "%d", &blksiz) != 1) {: fprintf(stderr, "modify: bad blksize %s\n", argv[arg]); usage(); } } else { blksiz = 512; } if (++arg < argc) {D fprintf(stderr, "modify: too many parameters %s...\n", argv[arg]); usage(); } modify(filename, blksiz); exit(0);}=/* Procedure which changes record format to fixed and record = * length to blksiz (parameter) for file filename (parameter) * by modifying file header. *: * As written by C, the file has the following attributes: *# * Record format: Stream_LF: * Record attributes: Carriage return carriage control * * After being modified, it has: *< * Record format: Fixed length byte records * Record attributes: None *I * The binary contents of the file are just fine for fixed length recordsJ * (i.e. there's no extra junk between records). It's convenient to writeI * the file in the default Stream_LF format, though, because then I don't> * have to break up all the records into -byte chunks. *? * Created from a program from Pittsburgh Supercomputer Center. ** * Programmer: R. White Date: 1 April 1988 */#include "#define RME$C_SETRFM 0X00000001 static voidmodify(filename, blksiz)char *filename; long blksiz;{struct FAB myfab = cc$rms_fab; long status;' if (blksiz < 1 || blksiz > 32767) { fprintf(stderr,H "modify: blocksize must be between 1 and 32767 inclusive."); exit(1); }K myfab.fab$b_fac = FAB$M_PUT; /* file access mode = put access */E myfab.fab$l_fop |= FAB$M_ESC; /* escape to allow $modify */M myfab.fab$l_ctx |= RME$C_SETRFM; /* user context (whatever that is) */F myfab.fab$w_ifi = 0; /* internal file identifier */6 myfab.fab$l_fna = filename; /* filename */= myfab.fab$b_fns = strlen(filename); /* filename length */7 if (((status = SYS$OPEN(&myfab, 0, 0)) & 7) != 1) {? fprintf(stderr,"modify: Couldn't open %s\n", filename); exit(status); }; myfab.fab$w_mrs = blksiz; /* record length */A myfab.fab$b_rfm = FAB$C_FIX; /* fixed record format */9 if (((status = SYS$MODIFY(&myfab, 0, 0)) & 7) != 1) {A fprintf(stderr,"modify: Couldn't modify %s\n", filename); exit(status); }8 if (((status = SYS$CLOSE(&myfab, 0, 0)) & 7) != 1) {@ fprintf(stderr,"modify: Couldn't close %s\n", filename); exit(status); }}5