Exemplo n.º 1
0
    def _create_frame_datas_as(self, space_type, \
                particles_time_seq, shells_time_seq=None):
        frame_datas = []

        idx = 0
        for pdata in particles_time_seq:
            sdata, idx = self._interpolate_shell_data(shells_time_seq, pdata,
                                                      idx)

            felem = FrameElem(pdata[0], pdata[1], pdata[2], sdata[1], sdata[2])
            frame_data = FrameData(space_type)
            frame_data.set_start_time(pdata[0])
            frame_data.set_end_time(pdata[0])
            frame_data.append(felem)

            frame_datas.append(frame_data)

        return frame_datas
Exemplo n.º 2
0
    def _create_frame_datas_as(self, space_type, \
                particles_time_seq, shells_time_seq=None):
        frame_datas=[]

        idx = 0
        for pdata in particles_time_seq:
            sdata, idx = self._interpolate_shell_data(
                            shells_time_seq, pdata, idx)

            felem=FrameElem(pdata[0],pdata[1],pdata[2],sdata[1],sdata[2])
            frame_data=FrameData(space_type)
            frame_data.set_start_time(pdata[0])
            frame_data.set_end_time(pdata[0])
            frame_data.append(felem)

            frame_datas.append(frame_data)

        return frame_datas
Exemplo n.º 3
0
    def _create_frame_datas(self, space_type, \
                particles_time_seq, shell_time_seq=None):
        particle_frames = []
        frame_t = []
        expos_t = []

        # check frame_end_time
        if self.settings.frame_end_time == None:
            self.settings.frame_end_time = \
            particles_time_seq[len(particles_time_seq)-1][0]

        # set the frame time(exposure end time) and the exposure start time
        counter = 1
        ignore_dtime = self.settings.frame_interval / 1.0e+5
        while True:
            ft = self.settings.frame_start_time + self.settings.frame_interval * counter

            frame_t.append(ft)
            et = ft - self.settings.exposure_time
            if (et < 0.0): et = 0.0
            expos_t.append(et)
            if (ft >= self.settings.frame_end_time): break
            counter += 1

        # create frame data composed by frame element data
        for step in range(len(frame_t)):
            ft = frame_t[step]
            et = expos_t[step]
            frame_data = FrameData(space_type)
            frame_data.set_start_time(et)
            frame_data.set_end_time(ft)
            felem = None
            last_index = 0
            for index in range(len(particles_time_seq)):
                if index == 0: continue
                st = particles_time_seq[index][0]
                if (et - st <= ignore_dtime and st - ft <= ignore_dtime):
                    st_f = particles_time_seq[index - 1][0]
                    stay_time = min(st - st_f, st - et)
                    norm_stime = stay_time / self.settings.exposure_time

                    pdata = particles_time_seq[index - 1]
                    sdata, d_idx = self._interpolate_shell_data(
                        shell_time_seq, pdata)

                    felem = FrameElem(pdata[0], pdata[1], pdata[2], sdata[1],
                                      sdata[2])
                    felem.set_eval_time(norm_stime)
                    frame_data.append(felem)

                    last_index = index

            # check last data
            if felem is None: continue
            if last_index == 0: continue

            st = particles_time_seq[last_index][0]
            pdata = particles_time_seq[last_index]
            sdata, d_idx = self._interpolate_shell_data(shell_time_seq, pdata)

            felem = FrameElem(pdata[0], pdata[1], pdata[2], sdata[1], sdata[2])
            stay_time = ft - st
            if stay_time > ignore_dtime:
                norm_stime = stay_time / self.settings.exposure_time
                felem.set_eval_time(norm_stime)
                frame_data.append(felem)

            particle_frames.append(frame_data)

        return particle_frames
Exemplo n.º 4
0
    def _create_frame_datas(self, space_type, \
                particles_time_seq, shell_time_seq=None):
        particle_frames=[]
        frame_t=[]
        expos_t=[]

        # check frame_end_time
        if self.settings.frame_end_time == None:
            self.settings.frame_end_time = \
            particles_time_seq[len(particles_time_seq)-1][0]

        # set the frame time(exposure end time) and the exposure start time
        counter=1
        ignore_dtime=self.settings.frame_interval/1.0e+5
        while True:
            ft = self.settings.frame_start_time + self.settings.frame_interval*counter

            frame_t.append(ft)
            et = ft - self.settings.exposure_time
            if(et < 0.0): et = 0.0
            expos_t.append(et)
            if(ft >= self.settings.frame_end_time):break
            counter+=1

        # create frame data composed by frame element data
        for step in range(len(frame_t)):
            ft=frame_t[step]
            et=expos_t[step]
            frame_data=FrameData(space_type)
            frame_data.set_start_time(et)
            frame_data.set_end_time(ft)
            felem=None
            last_index=0
            for index in range(len(particles_time_seq)):
                if index == 0 : continue
                st=particles_time_seq[index][0]
                if(et-st<=ignore_dtime and st-ft<=ignore_dtime):
                    st_f=particles_time_seq[index-1][0]
                    stay_time=min(st-st_f, st-et)
                    norm_stime=stay_time/self.settings.exposure_time

                    pdata=particles_time_seq[index-1]
                    sdata, d_idx=self._interpolate_shell_data(
                            shell_time_seq, pdata)

                    felem=FrameElem(pdata[0],pdata[1],pdata[2],sdata[1],sdata[2])
                    felem.set_eval_time(norm_stime)
                    frame_data.append(felem)

                    last_index=index

            # check last data
            if felem is None: continue
            if last_index == 0: continue

            st=particles_time_seq[last_index][0]
            pdata=particles_time_seq[last_index]
            sdata, d_idx=self._interpolate_shell_data(
                            shell_time_seq, pdata)

            felem=FrameElem(pdata[0],pdata[1],pdata[2],sdata[1],sdata[2])
            stay_time=ft-st
            if stay_time > ignore_dtime:
                norm_stime=stay_time/self.settings.exposure_time
                felem.set_eval_time(norm_stime)
                frame_data.append(felem)

            particle_frames.append(frame_data)

        return particle_frames