Example #1
0
            def sum_timeseries():
                results = []
                for itarget, target in enumerate(targets):
                    params = store_ext.make_sum_params(
                        store.cstore,
                        source_coords_arr,
                        source_terms,
                        target.coords5[num.newaxis, :].copy(),
                        scheme,
                        interpolation,
                        nthreads)

                    for weights, irecords in params:
                        neach = irecords.size // dsource.times.size
                        delays2 = num.repeat(dsource.times, neach)
                        r = store_ext.store_sum(
                            store.cstore,
                            irecords,
                            delays2,
                            weights,
                            int(itmin[itarget]),
                            int(nsamples[itarget]))

                        results.append(r)

                return results
Example #2
0
            def sum_timeseries():
                results = []
                for itarget, target in enumerate(targets):
                    params = store_ext.make_sum_params(
                        store.cstore,
                        source_coords_arr,
                        source_terms,
                        target.coords5[num.newaxis, :].copy(),
                        scheme,
                        interpolation,
                        nthreads)

                    for weights, irecords in params:
                        neach = irecords.size // dsource.times.size
                        delays2 = num.repeat(dsource.times, neach)
                        r = store_ext.store_sum(
                            store.cstore,
                            irecords,
                            delays2,
                            weights,
                            int(itmin[itarget]),
                            int(nsamples[itarget]))

                        results.append(r)

                return results
Example #3
0
 def sum_timeseries():
     nsummands = weights.size // ntargets
     res = num.zeros(ntargets)
     for t in range(ntargets):
         sl = slice(t * nsummands, (t + 1) * nsummands)
         r = store_ext.store_sum(cstore, irecords[sl], delays_t[sl],
                                 weights[sl], pos, 1)
         res[t] = r[0]
     return res
Example #4
0
 def sum_timeseries():
     nsummands = weights.size // ntargets
     res = num.zeros(ntargets)
     for t in range(ntargets):
         sl = slice(t*nsummands, (t+1) * nsummands)
         r = store_ext.store_sum(
             cstore, irecords[sl], delays_t[sl],
             weights[sl], pos, 1)
         res[t] = r[0]
     return res
Example #5
0
            def sum_timeseries():
                results = []
                for itarget, target in enumerate(targets):
                    params = store_ext.make_sum_params(
                        store.cstore, source_coords_arr, mts_arr,
                        target.coords5[num.newaxis, :].copy(), 'elastic10',
                        interpolation, nthreads)
                    for weights, irecords in params:
                        d = num.zeros(irecords.shape[0], dtype=num.float32)
                        r = store_ext.store_sum(store.cstore, irecords, d,
                                                weights, int(itmin[itarget]),
                                                int(nsamples[itarget]))
                        results.append(r)

                return results
Example #6
0
    def _sum(self, irecords, delays, weights, itmin, nsamples, decimate,
             implementation, optimization):

        if not self._f_index:
            self.open()

        if optimization == 'enable':
            irecords, delays, weights = self._optimize(
                irecords, delays, weights)
        else:
            assert optimization == 'disable'

        if implementation == 'c' and decimate == 1:
            if delays.size != 0:
                itoffset = int(num.floor(num.min(delays)/self._deltat))
            else:
                itoffset = 0

            if nsamples is None:
                nsamples = -1

            if itmin is None:
                itmin = 0
            else:
                itmin -= itoffset

            try:
                tr = GFTrace(*store_ext.store_sum(
                    self.cstore, irecords.astype(num.uint64),
                    (delays - itoffset*self._deltat).astype(num.float32),
                    weights.astype(num.float32),
                    int(itmin), int(nsamples)))
                tr.itmin += itoffset
                return tr

            except store_ext.StoreExtError, e:
                raise StoreError(str(e))