module ram_sizes
  integer(kind=8), parameter :: bytes_per_real = 4
  integer(kind=8), parameter :: kB = 1024
  integer(kind=8), parameter :: MB = 1024**2
  integer(kind=8), parameter :: GB = 1024**3
end module ram_sizes
!
module imbfits_parameters
  !
  real(kind=4), parameter :: bad=-1000.e0
  real(kind=8), parameter :: bad8=-1000.d0
  !
  integer(kind=4), parameter :: code_imbfits_init = 0
  integer(kind=4), parameter :: code_imbfits_started = 1
  integer(kind=4), parameter :: code_imbfits_done = 2
  real(kind=4), parameter :: imbfits_version_min=1.1999  ! Min supported (included)
  real(kind=4), parameter :: imbfits_version_max=3.      ! Max supported (excluded)
  !
  integer(kind=4), parameter :: mhdukinds=8
  integer(kind=4), parameter :: hdu_scan=1           ! HDU Scan identifier
  integer(kind=4), parameter :: hdu_frontend=2       ! HDU Frontend identifier
  integer(kind=4), parameter :: hdu_backend=3        ! HDU Backend identifier
  integer(kind=4), parameter :: hdu_backdata=4       ! HDU BackEndXXX identifier
  integer(kind=4), parameter :: hdu_antslow=5        ! HDU AntennaSlow identifier
  integer(kind=4), parameter :: hdu_antfast=6        ! HDU AntennaFast identifier
  integer(kind=4), parameter :: hdu_subreflector=7   ! HDU Subreflector identifier
  integer(kind=4), parameter :: hdu_derot=8          ! HDU Derotator identifier
  !
  ! Known telescopes
  integer(kind=4), parameter :: telescope_length=12
  integer(kind=4), parameter :: ntelescopes=1
  ! Ad vitam aeternam codes:
  integer(kind=4), parameter :: telescope_unknown=0
  integer(kind=4), parameter :: telescope_iram30m=1
  ! Order must match telescope codes:
  character(len=telescope_length), parameter :: telescopes(0:ntelescopes) =  &
    (/ 'unknown     ','IRAM 30m    ' /)
  !
  ! Known backends
  integer(kind=4), parameter :: backname_length=9
  integer(kind=4), parameter :: nbackends_imbfits=10
  integer(kind=4), parameter :: nbackends_mrtcal=9
  ! Ad vitam aeternam codes:
  integer(kind=4), parameter :: backend_unknown  =0
  integer(kind=4), parameter :: backend_nbc      =1
  integer(kind=4), parameter :: backend_bbc      =2
  integer(kind=4), parameter :: backend_4mhz     =3
  integer(kind=4), parameter :: backend_vespa    =4
  integer(kind=4), parameter :: backend_wilma    =5
  integer(kind=4), parameter :: backend_fts      =6
  integer(kind=4), parameter :: backend_nika1mm  =7
  integer(kind=4), parameter :: backend_nika2mm  =8
  integer(kind=4), parameter :: backend_holo     =9
  ! Used by IMBFITS, do not use for MRTCAL (this code can be modified)
  integer(kind=4), parameter :: backend_continuum=10
  ! Order must match backend codes:
  ! 1) As found in IMBFITS files
  character(len=backname_length), parameter :: backends_imbfits(nbackends_imbfits) =  &
    (/             'NBC      ','BBC      ','4MHZ     ','VESPA    ',  &
       'WILMA    ','FTS      ','NIKA1MM  ','NIKA2MM  ','HOLO     ',  &
       'CONTINUUM'/)
  ! 2) As displayed by MRTCAL
  character(len=backname_length), parameter :: backends_mrtcal(0:nbackends_mrtcal) =  &
    (/ 'UNKNOWN  ','NBC      ','BBC      ','4MHZ     ','VESPA    ',  &
       'WILMA    ','FTS      ','NIKA1MM  ','NIKA2MM  ','HOLO     ' /)
  !
end module imbfits_parameters
