3
�|b  ã               @   s    d dl ZddlmZ dd„ ZdS )é    Né   )Úschemac             C   s.  g }�x"| D �]}t j|jƒ}t j|jƒ}t|jƒ}|t|jƒkrJtdƒ‚|d dkr˜t j||ddd… fƒ}|d }t j||d |d	dd
…  fƒ}nTt j||ddd… fƒ}|d |d |d  d  }t j||d |ddd…  fƒ}tj|j	|j
|j|j|j|j|jt|ƒt|ƒƒ	}|j|ƒ qW |S )z
    z!len(spec.freqs) != len(spec.amps)é   r   r   g      à?éþÿÿÿéÿÿÿÿr   r   r   r   r   r   r   r   r   r   )ÚnpÚarrayÚampsÚfreqsÚlenÚ	ExceptionZconcatenater   ZNoiseSpectrumÚperiodZnsamplesÚgainÚshapingÚplaneZwirelenÚconstÚlistÚappend)ÚspectraÚoutÚspecr	   r
   ÚnZnyquist_frequencyÚns© r   ú?/home/yuhw/wc/wire-cell-python/wirecell/sigproc/noise/mirror.pyÚmirror_spectra   s(    
" r   )Únumpyr   Ú r   r   r   r   r   r   Ú<module>   s   