Skip to content

Commit

Permalink
update some minor config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zain-sohail committed Jan 30, 2025
1 parent 69e4595 commit f4fd755
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/sed/config/flash_example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ dataframe:

# metadata collection from scicat
# metadata:
# scicat_url: <URL>
# scicat_token: <TOKEN>
# archiver_url: <URL>

# The nexus collection routine shall be finalized soon for both instruments
nexus:
Expand Down
9 changes: 4 additions & 5 deletions src/sed/config/lab_example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ dataframe:
# format: per_file
# dataset_key: "/uncategorised/FLASH.DIAG/TIMINGINFO/TIME1.BUNCH_FIRST_INDEX.1/time"
# event key
numEvents:
index:
format: per_file
dataset_key: /DLD/NumOfEvents
# detector x position
Expand Down Expand Up @@ -156,11 +156,10 @@ dataframe:

# metadata collection from scicat
# metadata:
# scicat_url: <URL>
# scicat_token: <TOKEN>
# archiver_url: <URL>

# The nexus collection routine shall be finalized soon for both instruments
# nexus:
# reader: "flash"
# reader: "mpes"
# definition: "NXmpes"
# input_files: ["NXmpes_config_HEXTOF_light.json"]
# input_files: ["NXmpes_config-HEXTOF.json"]
4 changes: 2 additions & 2 deletions src/sed/loader/flash/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import numpy as np
import pandas as pd

from sed.core.logging import setup_logging
from sed.loader.flash.utils import get_channels
from sed.loader.flash.utils import InvalidFileError
from sed.core.logging import setup_logging

logger = setup_logging("flash_dataframe_creator")

Expand Down Expand Up @@ -434,7 +434,7 @@ def df_train(self) -> pd.DataFrame:
dataset = self.get_dataset_array(channel)
# Electron and pulse resolved MultiIndex is created. Since this is train data,
# the electron and pulse index is always 0
index = np.cumsum([0, *self.get_dataset_array("numEvents")[:-1]])
index = np.cumsum([0, *self.get_dataset_array("index")[:-1]])
# Auxiliary dataset (which is stored in the same dataset as other DLD channels)
# contains multiple channels inside. Even though they are resolved per train,
# they come in pulse format, so the extra values are sliced and individual channels are
Expand Down
5 changes: 2 additions & 3 deletions src/sed/loader/flash/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ def get_channels(
# Get the available channels excluding 'pulseId'.
available_channels = list(channel_dict.keys())
# pulse alias is an index and should not be included in the list of channels.
# Remove specified channels if they are present in available_channels.
channels_to_remove = ["pulseId", "numEvents"]
for channel in channels_to_remove:
# Remove index channels if they are present in available_channels.
for channel in index_list:
if channel in available_channels:
available_channels.remove(channel)

Expand Down

0 comments on commit f4fd755

Please sign in to comment.