# solve.com  -- take 1 mad dataset and solve it
# version that reads ccp4 mtz data file
#
setenv CCP4_OPEN UNKNOWN
solve <<EOD
logfile solve.logfile            ! write out most information to this file.
resolution 20  3.0               ! you need resolution.  Cell params read
                                 ! from the mtz file.

! get the data from ccp4 file mad_fbar-cad.mtz:
! NOTE:  do not put in FP=FP SIGFP=SIGFP because SOLVE will assume it is MIR!
! Also you can EITHER use labin/hklin  OR readccp4_unmerged but not both.

labin FPH1=FPH1 SIGFPH1=SIGFPH1 DPH1=DPH1 SIGDPH1=SIGDPH1
labin FPH2=FPH2 SIGFPH2=SIGFPH2 DPH2=DPH2 SIGDPH2=SIGDPH2
labin FPH3=FPH3 SIGFPH3=SIGFPH3 DPH3=DPH3 SIGDPH3=SIGDPH3
hklin mad_fbar-cad.mtz
! scaled data is all ready

mad_atom se
lambda 1
label set 1 with 2 se atoms, lambda 1
wavelength .9782                        ! wavelength value
fprimv_mad  -10                         ! f' value at this wavelength
fprprv_mad  3                           ! f doubleprime value
ATOMNAME Se                             ! we're about to enter data on an atom 

lambda 2
wavelength 0.977865
fprimv_mad  -7.5
fprprv_mad  5

lambda 3
wavelength 0.8856
fprimv_mad  -2
fprprv_mad  3.5
nres 80
nanomalous 2
!
analyze_mad
solve
!--------all done----------
EOD