On 29/06/10 18:06, goncalve wrote:
does any one have a script file where we can add a binding key for each of
the current 2foFc and FoFc maps ?


;; fix the problematic standard definition of is-difference-map?
;; (temporary hack)
;;
(define (is-difference-map? imol-map)
  (if (not (valid-map-molecule? imol-map))
      #f
      (= (map-is-difference-map imol-map) 1)))

;; here's the keybinding: Shift S
(add-key-binding "Swap Refinement Maps" "S"
   (let ((local-ref-map #f))
     (lambda ()
       (let ((map-list (map-molecule-list)))
     (if (not local-ref-map)
         (if (not (null? map-list))
         (begin
           (set! local-ref-map (car map-list))
           (set-imol-refinement-map local-ref-map)))
         (let f ((l map-list))
           (cond
        ((null? l) (format #t "Failed to swap maps~%"))
        ((and (is-difference-map? local-ref-map)
              (not (is-difference-map? (car l))))
         (set! local-ref-map (car l))
         (set-imol-refinement-map (car l)))
        ((and (not (is-difference-map? local-ref-map))
              (is-difference-map? (car l)))
         (set! local-ref-map (car l))
         (set-imol-refinement-map (car l)))
        (else
         (f (cdr l))))))))))

Reply via email to