+
    E½k%  ã                   óX   € R t ^ RIt ^RIHtHt RR ltR#   ] d    ^ RIHtHt  Li ; i)zCSafer phase-correlation wrapper: reject exactly featureless inputs.N)Úphase_displacementÚaccepted_shiftc                ó|  € \        V \        P                  4      '       dg   \        V\        P                  4      '       dG   V P                  ^8w  g6   V P                  VP                  8w  g   \        V P                  4      ^8  d   \        R4      h\        P                  ! V P                  \        P                  4      '       dŠ   \        P                  ! VP                  \        P                  4      '       dU   \        P                  ! V 4      P                  4       '       d+   \        P                  ! V4      P                  4       '       g   \        R4      h\        P                  ! V 4      ^ 8X  g   \        P                  ! V4      ^ 8X  d	   RRRRRR/# \        W4      p\        WBV4      pRVe   RMR	RVRV/# )
zÓReturn tentative correction or a reason for abstention.

A nonconstant image and a high response do not prove reliable registration;
this only catches the exact no-information case and applies fixed heuristics.
zExpected equal-sized 2D imageszExpected finite numeric inputsÚstatusÚunidentifiable_constantÚestimateNÚ
correctionÚ	tentativeÚheuristic_reject)Ú
isinstanceÚnpÚndarrayÚndimÚshapeÚminÚ
ValueErrorÚ
issubdtypeÚdtypeÚnumberÚisfiniteÚallÚptpr   r   )Ú	referenceÚtargetÚmin_responseÚ	max_shiftr   r   s   &&&&  ÚP/home/mchadwick/src/ansp/diatom-research/diatom_pilot/phase_alignment_checked.pyÚchecked_alignmentr      sÀ  € ô 	�9œRŸZ™Z×(Ò(´
¸6Ä"Ç*Á*×0MÒ0MÐQZ×Q_ÑQ_ÐabÔQbÐfo×fuÑfuÐw}÷  xDñ  xDô  gDô  HKð  LU÷  L[ñ  L[ó  H\ð  ]^ô  H^ô  eoð  pPó  eQð  _QÜ
�Š�i—o‘o¤b§i¡i×0Ò0¼¿ºÀfÇlÁlÔSU×S\ÑS\×8]Ò8]Ôeg×epÒepÐqzÓe{×eÑe÷  fBò  fBô  JL÷  JUò  JUð  V\ó  J]÷  Jañ  Ja÷  Jcò  Jcô  jtð  uUó  jVð  dVÜ‡F‚Fˆ9Ó�qÔœBŸFšF 6›N¨AÔ-°hÐ?XÐYcÐdhÐiuÐvzÐ5{Ð.{Ü
˜YÓ
.€¼.ÈÐ_hÓ:i¨zØ	 Ò!7‘+Ð=OÐPZÐ[cÐdpÐq{Ð|Ð|ó    )gš™™™™™¹?g      @@)Ú__doc__Únumpyr   Úphase_alignmentr   r   ÚImportErrorr   © r   r   Ú<module>r$      s0   ðÙ IÛ ð?ß?ö
}øð ô ?ß>Ñ>ð?ús   ˆ —)¨)