pro helios, jdn, carr, lat, lon, p, diam, dist ; ; Given a double-precision Julian date, this procedure returns six ; quantities useful in physical observations of the sun: Carrington ; rotation number (carr), the apparent heliographic latitude and ; longitude of the center of the solar disk in degrees (lat, lon), the ; apparent position angle of the sun's axis of rotation in degrees (p), ; the diameter of the solar disk in arc seconds (diam), and the ; distance from the earth to the sun in A.U. (dist). ; ; The input argument jdn (Julian Day Number, UT) may be a scalar or ; array, and the output arguments will agree in kind. ; ; B. Knapp, 1996-01-31, 1999-06-25, 2001-01-02 ; ; Print usage? if n_params() lt 2 then begin print, ' ' print, ' Given a double-precision Julian date (& fraction), this' print, ' procedure returns six quantities useful in physical' print, ' observations of the Sun: Carrington rotation number (carr),' print, ' the apparent heliographic latitude and longitude of the' print, ' center of the solar disk in degrees (lat, lon), the' print, ' apparent position angle of the Sun''s axis of rotation' print, ' in degrees (p), the diameter of the solar disk in arc' print, ' seconds (diam), and the distance from the Earth to the' print, ' Sun in A.U. (dist).' print, ' ' print, ' The input argument jdn (Julian Day Number, UT) may be a' print, ' scalar or array, and the output arguments will agree in kind.' print, ' ' print, ' helios, jdn, carr, lat, lon, p, diam, dist' print, ' ' 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')") ; ; Define outputs and then call the Fortran subroutine n = n_elements( jdn ) jd_loc = double( jdn ) if n eq 1 then begin carr = 0.d0 lat = 0.d0 lon = 0.d0 p = 0.d0 diam = 0.d0 dist = 0.d0 result = call_external( dll, 'helios_arg_', $ jd_loc[0], carr, lat, lon, p, diam, dist ) endif else begin carr = dblarr( n ) lat = dblarr( n ) lon = dblarr( n ) p = dblarr( n ) diam = dblarr( n ) dist = dblarr( n ) carr_j = 0.d0 lat_j = 0.d0 lon_j = 0.d0 p_j = 0.d0 diam_j = 0.d0 dist_j = 0.d0 for j=0l,n-1 do begin result = call_external( dll, 'helios_arg_', $ jd_loc[j], carr_j, lat_j, lon_j, p_j, diam_j, dist_j ) carr[j] = carr_j lat[j] = lat_j lon[j] = lon_j p[j] = p_j diam[j] = diam_j dist[j] = dist_j endfor endelse ; return end