1# Astro::FITS::Header test harness -*-perl-*- 2 3use strict; 4use Test::More tests => 4; 5 6require_ok( "Astro::FITS::Header" ); 7require_ok( "Astro::FITS::Header::Item" ); 8 9# Read header from DATA block. 10my @raw = <DATA>; 11chomp( @raw ); 12 13# Build the header item. 14my $header = new Astro::FITS::Header( Cards => \@raw ); 15 16### Test bug where multiple headers being removed using a regular 17### expression removed the wrong headers. 18 19# Remove headers that start with CR.. 20$header->removebyname( qr/^CR/ ); 21 22# There should still be a "CTYPE2" header, so retrieve it. 23my @card = $header->itembyname( "CTYPE2" ); 24 25ok( defined $card[0] ); 26is( $card[0]->value, "a2", "CTYPE2 is a2" ); 27 28exit; 29 30__DATA__ 31SIMPLE = T / file does conform to FITS standard 32BITPIX = -32 / number of bits per data pixel 33NAXIS = 3 / number of data axes 34NAXIS1 = 25 / length of data axis 1 35NAXIS2 = 36 / length of data axis 2 36NAXIS3 = 252 / length of data axis 3 37EXTEND = T / FITS dataset may contain extensions 38COMMENT FITS (Flexible Image Transport System) format defined in Astronomy and 39COMMENT Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365. 40COMMENT Contact the NASA Science Office of Standards and Technology for the 41COMMENT FITS Definition document #100 and other FITS information. 42CRVAL1 = -0.07249999791383749 / Axis 1 reference value 43CRPIX1 = 12.5 / Axis 1 pixel value 44CTYPE1 = 'a1 ' / LINEAR 45CRVAL2 = -0.07249999791383743 / Axis 2 reference value 46CRPIX2 = 18.0 / Axis 2 pixel value 47CTYPE2 = 'a2 ' / LINEAR 48CRVAL3 = 1.27557086671004E-6 / Axis 3 reference value 49CRPIX3 = 126.0 / Axis 3 pixel value 50CTYPE3 = 'a3 ' / LAMBDA 51OBJECT = 'galaxy ' / Title of the dataset 52DATE = '2000-12-13T22:44:53' / file creation date (YYYY-MM-DDThh:mm:ss UTC) 53ORIGIN = 'NOAO-IRAF FITS Image Kernel July 1999' / FITS file originator 54BSCALE = 1.0 / True_value = BSCALE * FITS_value + BZERO 55BZERO = 0.0 / True_value = BSCALE * FITS_value + BZERO 56HDUCLAS1= 'NDF ' / Starlink NDF (hierarchical n-dim format) 57HDUCLAS2= 'DATA ' / Array component subclass 58IRAF-TLM= '23:07:26 (27/02/2000)' / Time of last modification 59TELESCOP= 'UKIRT, Mauna Kea, HI' / Telescope name 60INSTRUME= 'CGS4 ' / Instrument 61OBSERVER= 'SMIRF ' / Observer name(s) 62OBSREF = '? ' / Observer reference 63DETECTOR= 'fpa046 ' / Detector array used 64OBSTYPE = 'OBJECT ' / Type of observation 65INTTYPE = 'STARE+NDR' / Type of integration 66MODE = 'ND_STARE' / Observing mode 67GRPNUM = 0 / Number of observation group 68RUN = 54 / Number of run 69EXPOSED = 180 / Total exposure time for integration 70OBJCLASS= 0 / Class of observed object 71CD1_1 = 0.144999980926513672 / Axis rotation and scaling matrix 72CD1_2 = 0.0 / Axis rotation and scaling matrix 73CD1_3 = 0.0 / Axis rotation and scaling matrix 74CD2_1 = 0.0 / Axis rotation and scaling matrix 75CD2_2 = 0.144999980926513672 / Axis rotation and scaling matrix 76CD2_3 = 0.0 / Axis rotation and scaling matrix 77CD3_1 = 0.0 / Axis rotation and scaling matrix 78CD3_2 = 0.0 / Axis rotation and scaling matrix 79CD3_3 = 2.07933226192836E-10 / Axis rotation and scaling matrix 80MEANRA = 10.34629999999999939 / Object RA at equinox (hrs) 81MEANDEC = 20.1186000000000007 / Object Dec at equinox (deg) 82RABASE = 10.34629999999999939 / Offset zero-point RA at equinox (hrs) 83DECBASE = 20.1186000000000007 / Offset zero-point Dec at equinox (deg) 84RAOFF = 0 / Offset RA at equinox (arcsec) 85DECOFF = 0 / Offset Dec at equinox (arcsec) 86DROWS = 178 / No of det. in readout row 87DCOLUMNS= 256 / No of det. in readout column 88DEPERDN = 6 / Electrons per data number 89CLOCK0 = -6.20000000000000018 / ALICE CLOCK0 voltage 90CLOCK1 = -3 / ALICE CLOCK1 voltage 91CLOCK2 = -7.5 / ALICE CLOCK2 voltage 92CLOCK3 = -2.79999999999999982 / ALICE CLOCK3 voltage 93CLOCK4 = -6 / ALICE CLOCK4 voltage 94CLOCK5 = -2 / ALICE CLOCK5 voltage 95CLOCK6 = -7.5 / ALICE CLOCK6 voltage 96VSLEW = 4 / ALICE VSLEW voltage 97VDET = -3.02000000000000002 / ALICE VDET voltage 98DET_BIAS= 0.57999999999999996 / ALICE DET_BIAS voltage 99VDDUC = -3.60000000000000009 / ALICE VDDUC voltage 100VDETGATE= -4.5 / ALICE VDETGATE voltage 101VGG_A = -1.60000000000000009 / ALICE VGG_ACTIVE voltage 102VGG_INA = -1.30000000000000004 / ALICE VGG_INACTIVE voltage 103VDDOUT = -1 / ALICE VDDOUT voltage 104V3 = -2.79999999999999982 / ALICE V3 voltage 105VLCLR = -3 / ALICE VLCLR voltage 106VLD_A = 4 / ALICE VLOAD_ACTIVE voltage 107VLD_INA = 4 / ALICE VLOAD_INACTIVE voltage 108WFREQ = 1 / ALICE waveform state freq. (MHz) 109RESET_DL= 0.200000000000000011 / NDR reset delay (seconds) 110CHOP_DEL= 0.029999998999999999 / Chop delay (seconds) 111READ_INT= 5 / NDR read interval (seconds) 112NEXP_PH = 0 / Exposures in each chop phase 113DEXPTIME= 180 / Exposure time (seconds) 114RDOUT_X1= 1 / Start column of array readout 115RDOUT_X2= 256 / End column of array readout 116RDOUT_Y1= 45 / Start row of array readout 117RDOUT_Y2= 222 / End row of array readout 118CHOPDIFF= T / Main-offset beam value stored 119IF_SHARP= F / Shift & add disabled 120LINEAR = F / Linearisation disabled 121FILTER = 'B1 ' / Combined filter name 122FILTERS = 'B1 ' / Combined filter name 123DETINCR = 1 / Increment (pixels) betw scan positions 124DETNINCR= 2 / Number of scan positions in scan 125WPLANGLE= 0 / IRPOL waveplate angle 126SANGLE = -2.19303900000000018 / Angle of slit 127SLIT = '0ew ' / Name of slit 128SLENGTH = 18 / Length of slit 129SWIDTH = 4 / Width of slit 130DENCBASE= 800 / Zeropoint (steps) of detector translation 131DFOCUS = 1.819309999999999983 / Detector focus position 132GRATING = '150_lpmm' / Name of grating 133GLAMBDA = 1.274947000000000052 / Grating wavelength 134GANGLE = 17.09262000000000015 / Grating wavelength 135GORDER = 3 / Grating order 136GDISP = 0.00020796522 / Grating dispersion 137CLAMBDA = 0 / CVF wavelength 138IRTANGLE= 6.396519999999999762 / Image rotator angle 139LAMP = 'off ' / Name of calibration lamp 140BBTEMP = 0 / Black body temperature 141CALAPER = 0 / Aperture of tungsten-halogen lamp (%) 142THLEVEL = 0 / Level of tungsten-halogen lamp 143IDATE = 19980217 / Date as integer 144OBSNUM = 54 / Number of observation 145NEXP = 1 / Exposures in integration 146AMSTART = 1.334643999999999942 / Airmass at start of obs 147AMEND = 1.320149999999999935 / Airmass at end of obs 148RUTSTART= 8.000171999999999173 / Start time of obs (hrs) 149RUTEND = 8.101883000000000834 / End time of obs (hrs) 150NBADPIX = 32 151END 152