Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:49:16

0001 #!/usr/bin/env python
0002 #
0003 # Copyright (c) 2019 Opticks Team. All Rights Reserved.
0004 #
0005 # This file is part of Opticks
0006 # (see https://bitbucket.org/simoncblyth/opticks).
0007 #
0008 # Licensed under the Apache License, Version 2.0 (the "License"); 
0009 # you may not use this file except in compliance with the License.  
0010 # You may obtain a copy of the License at
0011 #
0012 #   http://www.apache.org/licenses/LICENSE-2.0
0013 #
0014 # Unless required by applicable law or agreed to in writing, software 
0015 # distributed under the License is distributed on an "AS IS" BASIS, 
0016 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0017 # See the License for the specific language governing permissions and 
0018 # limitations under the License.
0019 #
0020 
0021 """
0022 """
0023 import os, logging, numpy as np
0024 log = logging.getLogger(__name__)
0025 
0026 from opticks.ana.base import opticks_environment
0027 from opticks.ana.evt import Evt
0028 
0029 deg = np.pi/180.
0030 
0031 
0032 if __name__ == '__main__':
0033     pass
0034     logging.basicConfig(level=logging.INFO)
0035     opticks_environment()
0036 
0037     spol, ppol = "5", "6"
0038     g = Evt(tag="-"+spol, det="rainbow", label="S G4")
0039     o = Evt(tag=spol, det="rainbow", label="S Op")
0040 
0041     # check magnitude of polarization
0042     for e in [g,o]: 
0043         mag = np.linalg.norm(e.rpol_(0),2,1)
0044         assert mag.max() < 1.01 and mag.min() > 0.99
0045 
0046 
0047