Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
steinnymir committed Oct 9, 2023
1 parent 30f2829 commit 1c0e0eb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sed/core/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import Union

import dask.dataframe as ddf
import dask.array as dda
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
Expand Down Expand Up @@ -1193,7 +1194,7 @@ def calibrate_delay_axis(
def convert_8s_time(
self,
step_to_tof:float=None,
sector_delays:Sequece[float]=None,
sector_delays:Sequence[float]=None,
) -> None:
"""Converts the 8s time in steps to time in ns and sectorID.
Expand All @@ -1209,17 +1210,18 @@ def convert_8s_time(
if step_to_tof is None:
step_to_tof = self._config["dataframe"]["step_to_tof"]
if sector_delays is None:
sector_delays = self._config["dataframe"].get(["sector_delays"], [0.0] * 8)
sector_delays = self._config["dataframe"].get("sector_delays", [0.0] * 8)

sector_id = self._dataframe["dldTimeSteps"] & 0b111
sector_id = self._dataframe["dldTimeSteps"] % 8
self._dataframe["dldTime"] = (
self._dataframe["dldTimeSteps"] >> 3
self._dataframe["dldTimeSteps"] // 8
)
# convert to ns
self._dataframe["dldTime"] *= step_to_tof
# Apply sector delays in nanoseconds
self._dataframe["dldTime"] -= sector_delays[sector_id]
self._dataframe["dldSectorID"] = sector_id
self._dataframe["dldSectorID"] = sector_id.astype(np.int8)
# Apply sector delays in nanoseconds

self._dataframe["dldTime"] = dda.from_array(sector_delays)[self._dataframe["dldSectorID"].values]

metadata = {}
metadata["applied"] = True
Expand Down

0 comments on commit 1c0e0eb

Please sign in to comment.