Changeset 13461 for fact


Ignore:
Timestamp:
04/26/12 14:24:02 (13 years ago)
Author:
kraehenb
Message:
Added passing NROI and NPIX to weave.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/sandbox/kraehenb/CalFitsPerformanceWeave.py

    r13452 r13461  
    6161    int singles = 0;
    6262    double threshold = 2.5;
    63     for(int px=0; px<1440; px++) {
    64         lastslice = npcalevent(px*300);
    65         for(int sl=1; sl<300-14; sl++) {
    66             slice = npcalevent(px*300+sl);
     63    for(int px=0; px<npix; px++) {
     64        lastslice = npcalevent(px*nroi);
     65        for(int sl=1; sl<nroi-14; sl++) {
     66            slice = npcalevent(px*nroi+sl);
    6767            if((lastslice<threshold)&&(slice>threshold)) {
    6868                integral = 0;
    6969                for(int l=5; l<15; l++) {
    70                     integral += npcalevent(px*1440+sl+l);
     70                    integral += npcalevent(px*nroi+sl+l);
    7171                }
    7272                c_integrals(singles) = integral;
     
    7979//    std::cout << std::endl << singles << std::endl;
    8080    """
    81     weave.inline(cppcode, ['c_integrals', 'npcalevent'], type_converters=converters.blitz)
     81   
     82    #Passing the caltest object to weave is not possible
     83    #The int() statement is necessary to add additional data type information to the variable (ie. otherwise some things would work in the C-code, other would not)
     84    nroi = int(caltest.nroi)
     85    npix = int(caltest.npix)
     86   
     87    weave.inline(cppcode, ['c_integrals', 'npcalevent','nroi','npix'], type_converters=converters.blitz)
    8288   
    8389#    print "CalFitsPerformanceWeave"
Note: See TracChangeset for help on using the changeset viewer.