!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! This script is intended to be run once with a given Mrtcal version,
! and another time with another Mrtcal version. Each time it will create
! a Class file named according to the GAG_VERSION.
!
! Usage: @ versions-generate-data [name] [/interactive]
!
! Then use the procedure 'versions-compare-data.class' to compare these
! files.
!
! Feature missing: add an option to calibrate only specific data (per
! observing type, or scan, or whatever). For now calibrate everything
! in the current working directory.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
begin procedure generate-comparison-setup
  ! These settings are identical to pipeline-odp.cal
  mset  bookkeeping  space        1024
  !
  mset  calibration  bad          no
  mset  calibration  bandwidth    20.0
  mset  calibration  chopper      strict
  mset  calibration  feedback     set
  mset  calibration  interval     30.0
  mset  calibration  match        0.040
  mset  calibration  mjdinter     yes
  mset  calibration  off          linear  ! For OTF PSW
  mset  calibration  products     linear
  mset  calibration  scan         nearest
  mset  calibration  water        element  ! 1 pwv per calib bandwidth
  !
  mset  output       calibration  associated
  mset  output       chunk        set
  mset  output       integration  *
  mset  output       spectra      yes
  mset  output       usersection  no
  mset  output       weight       no
end procedure generate-comparison-setup
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
parse 0 1 /interactive 0 0
! Setup
define character*512 filename
if (pro%parse%command%narg.eq.1) then
   let filename 'pro%parse%command%arg[1]'".30m"
else
   define char*5 release
   let release `gag_version`
   let filename 'release'".30m"
endif
define logical dopause
let dopause pro%parse%interactive%narg.eq.0
@ generate-comparison-setup
!
! Processing
index build
mfind
mlist
file out 'filename' single /over
if (dopause) pause
pipe
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
