function constellation, epoch, ra, dec ; ; Given a Julian Epoch (Gregorian year & fraction), and the Right ; Ascension (hours) and Declination of a point on the celestial ; sphere, this function returns the official IAU abbreviation of ; the name of the constellation in which the point lies. ; ; B. Knapp, 2001-04-26 ; ; RCS Data: ; ; $Header$ ; ; $Log$ ; ; Print usage? n = n_elements( epoch ) if n eq 0 or n ne n_elements(ra) or n ne n_elements(dec) then begin print, ' ' print, ' Given a Julian Epoch (Gregorian year & fraction), and the' print, ' Right Ascension (hours) and Declination (degrees) of a point' print, ' on the celestial sphere, this function returns the official' print, ' IAU 3-letter abbreviation for the name of the constellation' print, ' in which the point lies. (Scalars or same-length arrays are' print, ' accepted.)' print, ' ' print, ' Usage:' print, ' ' print, ' iau_abbrev = constellation( epoch, ra, dec )' return, ' ' endif ; ; Use 32-bit or 64-bit shareable object library? mbits = ((!version.release ge 5.4) ? !version.memory_bits : 32) dll = getenv('bgkroot')+string(mbits,"('/lib/astron',i2,'.so')") ; ; Prepare arguments and then call the Fortran subroutine epoch_loc = double( epoch ) ra_loc = float( ra ) dec_loc = float( dec ) iau_loc = bytarr( 3, n ) result = call_external( dll, 'constellation_arg_', $ n, epoch_loc, ra_loc, dec_loc, iau_loc ) ; ; Return scalar or array, according to argument epoch if (size( epoch ))[0] eq 0 then $ return, string(iau_loc[*,0]) $ else $ return, string(iau_loc) end