remarks file xtal_maps/diff_map.inp   -- 

       {* Read structure file and coordinates if phases should be computed *}
       {* from a model.  Otherwise, phases have to be read from file       *}
       {* "native.fob" (see below).                                        *}

{===>} structure @../generate/generate.psf end       {*Read structure file.*}

{===>} coor @../xtalrefine/slowcool.pdb                {*Read coordinates. *}

 xrefine 
                                  
{===>}
   a=61.76 b=40.73 c=26.74 alpha=90.0 beta=90.0 gamma=90.0     {*Unit cell.*}

{===>}
   symmetry=(x,y,z)                         {*Symmetry operators for space *}
   symmetry=(-x+1/2,-y,z+1/2)               {*group P212121; notation as in*}
   symmetry=(-x,y+1/2,-z+1/2)               {*Int. Tables.                 *}
   symmetry=(x+1/2,-y+1/2,-z)  
{===>}    
   asymm=( 0<=x<=1/2                          {* Asymmetric unit for maps. *}
      and  0<=y<=1/2
      and  0<=z<=1 )



   SCATter ( chemical C* ) 
      2.31000 20.8439 1.02000 10.2075 1.58860 .568700 .865000 51.6512 .215600
   SCATter ( chemical N* )
      12.2126 .005700 3.13220 9.89330 2.01250 28.9975 1.16630 .582600 -11.529
   SCATter ( chemical O* )
      3.04850 13.2771 2.28680 5.70110 1.54630 .323900 .867000 32.9089 .250800
   SCATter ( chemical S* )
      6.90530 1.46790 5.20340 22.2151 1.43790 .253600 1.58630 56.1720 .866900
   SCATter ( chemical P* )
      6.43450 1.90670 4.17910 27.1570 1.78000 0.52600 1.49080 68.1645 1.11490
   SCATter ( chemical FE* )
      11.1764 4.61470 7.38630 0.30050 3.39480 11.6729 0.07240 38.5566 0.97070
   SCATter ( chemical ZN* )
      11.9719 2.99460 7.38620 0.20310 6.46680 7.08260 1.39400 18.0995
      0.78070

{===>} 
   nreflections=15000        {* Allocate sufficient space for reflections. *}


{===>} 
                                  {* Read native data set, stored in FOBS. *}
   reflection @../xtalrefine/amy.fob end                 
   do (fpart=fobs)    (all)                   {*Store native data in FPART.*}


{===>} {* If a model structure is present, phases can be computed from the *}
       {* structure and stored in Fcalc.  If other phases other should be  *}
       {* used instead remove the following two lines and read the phases  *}
       {* as FCALc using the reflection statement.                         *}           
   resolution  10. 3.0                       {*Resolution range for FCALC. *}
   update

{===>}
                         {* Read data set of other crystal, stored in FOBS.*}
   do (fobs=0.) 
   reflection
        @derivative.fob        
   end

                       {* Compute $k2 scale factor (FPART scaled to FOBS). *}

   scale
      set1=fobs  k1=-1  b1=0
      set2=fpart        b2=0
      selection=(ampl(fobs)>0 and ampl(fpart)>0 and ampl(fcalc)>0 and test=0
{===>}                                    {* Resolution range for scaling. *}
                 and 10 >= d >= 3.) 
   end


                                                {* Compute difference map. *}
   do (map1=ft(  combine( ampl(fobs)-$k2 * ampl(fpart) , phase(fcalc))  ))
                (ampl(fobs)>0 and ampl(fpart)>0 and ampl(fcalc)>0 and test=0
{===>}                                        {* Resolution range for map. *}
                 and 10 >= d >= 3.) 


                                                     {* Write map to file. *}   
   write map 
      from=map1

{===>}            {* If no model is present, the map extension needs to be *}
                  {* explicitly specified using xmin, xmax, ...            *}
      extend=molecule  
      cushion=2.0 
      selection=( all )


{===>}  output=diff_map.map                                  {*Output file.*}

    end                                         {*Map is being computed and*}
                                                {*written to file.         *}

   
end

stop