Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:51

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 
0024     In [13]: evt.rpost_(slice(0,5))
0025     Out[13]: 
0026     A()sliced
0027     A([[[     -65.844,   -7.065, -299.997,    0.1  ],
0028             [ -65.844,   -7.065,  -99.994,    0.767],
0029             [ -65.844,   -7.065,   99.994,    1.905],
0030             [ -65.844,   -7.065,  500.   ,    3.239],
0031             [   0.   ,    0.   ,    0.   ,    0.   ]],
0032 
0033            [[ -33.967,   58.733, -299.997,    0.1  ],
0034             [ -33.967,   58.733,  -99.994,    0.767],
0035             [ -33.967,   58.733,   99.994,    1.889],
0036             [ -33.967,   58.733,  500.   ,    3.223],
0037             [   0.   ,    0.   ,    0.   ,    0.   ]],
0038 
0039            [[  20.02 ,   45.839, -299.997,    0.1  ],
0040             [  20.02 ,   45.839,  -99.994,    0.767],
0041             [  20.02 ,   45.839,   99.994,    1.91 ],
0042             [  20.02 ,   45.839,  500.   ,    3.244],
0043             [   0.   ,    0.   ,    0.   ,    0.   ]],
0044 
0045            ..., 
0046            [[ -51.408,   -2.457, -299.997,    0.1  ],
0047             [ -51.408,   -2.457,  -99.994,    0.767],
0048             [ -51.408,   -2.457,   99.994,    1.921],
0049             [ -51.408,   -2.457,  500.   ,    3.255],
0050             [   0.   ,    0.   ,    0.   ,    0.   ]],
0051 
0052            [[  35.829,   11.765, -299.997,    0.1  ],
0053             [  35.829,   11.765,  -99.994,    0.767],
0054             [  35.829,   11.765,   99.994,    1.863],
0055             [  35.829,   11.765,  500.   ,    3.197],
0056             [   0.   ,    0.   ,    0.   ,    0.   ]],
0057 
0058            [[ -44.527,   76.846, -299.997,    0.1  ],
0059             [ -44.527,   76.846,  -99.994,    0.767],
0060             [ -44.527,   76.846,   99.994,    1.911],
0061             [ -44.527,   76.846,  500.   ,    3.245],
0062             [   0.   ,    0.   ,    0.   ,    0.   ]]])
0063 
0064     In [14]: evt.rpost_(slice(0,5)).shape
0065     Out[14]: (500000, 5, 4)
0066 
0067 
0068 
0069 
0070 
0071 """
0072 import os, sys, logging, numpy as np
0073 log = logging.getLogger(__name__)
0074 
0075 from opticks.ana.base import opticks_main
0076 from opticks.ana.evt import Evt
0077 
0078 if __name__ == '__main__':
0079     args = opticks_main(tag="1",src="torch", det="lens", doc=__doc__)
0080     np.set_printoptions(suppress=True, precision=3)
0081 
0082     evt = Evt(tag=args.tag, src=args.src, det=args.det, seqs=[], args=args)
0083 
0084     log.debug("evt") 
0085     print evt
0086 
0087     log.debug("evt.history_table") 
0088     evt.history_table(slice(0,20))
0089     log.debug("evt.history_table DONE") 
0090        
0091