if "&1-".eq."--help-" then
  say "@ sg_constantes "
  say "  Defines basic physical constantes in a structure "
  say "  called  c_%"
  say " "
  say "Also defines basic functions "
  say "  Rayleigh(nu,J)   jun(nu,T)   gauss(T,p,c,w)"
  say "and procedure"
  say "  @ jyperk ReturnVariable  HeaderName"
  say "-----------------------------------------------------------"
  return
endif
!
begin procedure add_global
  if .not.exist(c_%&1) then
    define double c_%&1 /global
    define character string1*16 string2*24 
    string1 = "&1" 
    string2 = "&2" 
    say "Defining " string1 " =" string2 " ! in S.I. units" /format A A16 A A24 A20
    c_%&1 = &2 
  endif
end procedure add_global
!
if .not.exist(c_) then
  define structure c_ /global
  !
  ! Useful functions
  !
  ! exp(h nu / k T) = 1 + h nu / k J
  ! h nu / k T = log(1 + h nu /k J)
  ! T = h nu /K /(log( 1 + h nu / k J)
  define function rayleigh(nu,J) c_%hplanck*nu/c_%kbolt/log(1+c_%hplanck*nu/c_%kbolt/J)
  define function jnu(nu,T) c_%hplanck*nu/c_%kbolt/(exp(c_%hplanck*nu/c_%kbolt/T)-1)
  define function gauss(T,p,c,w)  p*exp(-((T-c)/w*2*sqrt(log(2)))^2)
endif
!
! All in S.I.
!
say "Prefix is c_%"
@ add_global clight 299792458d0  ! m/s conventional
@ add_global kbolt  1.3806488d-23
@ add_global hplanck 6.62606957d-34
@ add_global  amu   1.660538921d-27  
@ add_global stefan 5.670373d-8  
@ add_global hsurk  4.7992434d-11 
@ add_global msun   1.98885d30
@ add_global lsun   3.839d26
@ add_global mjup   1.89813d27
@ add_global mearth 5.9724d24
@ add_global au     149597870700d0 ! m, conventional since IAU XXVII, 2012
@ add_global pc     3.08567758146720d16  ! m idem
@ add_global gnewton  6.67384d-11
@ add_global jansky  1d-26         ! W.m^-2.Hz^-1
@ add_global rsun   696100e3       ! m
@ add_global debye  1D-18    ! in cgs, but works too for line strengths...
!
!
begin procedure jyperk
 if .not.exist(&2) return
 if &2%restfre.eq.0 return
 !
 let &1 2.0*c_%kbolt/c_%jansky*pi*&2%major*&2%minor/(c_%clight/&2%restfre/1d6)^2/4./log(2.0)
end procedure
!
