Skip to content

Commit

Permalink
remove empty pulses from timed dataframe, and bring back old behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Jan 6, 2025
1 parent 178c6ea commit 8d9bcd5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/sed/loader/flash/buffer_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def _save_buffer_file(self, paths: dict[str, Path]) -> None:

# timed dataframe
# drop the electron channels and only take rows with the first electronId
df_timed = df[self.fill_channels].loc[:, :, 0]
df_timed = df.dropna(subset=electron_channels)[self.fill_channels].loc[:, :, 0]
dtypes = get_dtypes(self._config, df_timed.columns.values)
df_timed.astype(dtypes).reset_index().to_parquet(paths["timed"])
logger.debug(f"Processed {paths['raw'].stem}")
Expand Down
4 changes: 2 additions & 2 deletions tutorial/10_hextof_workflow_trXPS_bam_correction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"axes = ['energy', 'delayStage']\n",
"ranges = [[-37.5,-27.5], [1446.75,1449.15]]\n",
"bins = [200,40]\n",
"res = sp_44498.compute(bins=bins, axes=axes, ranges=ranges)"
"res = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")"
]
},
{
Expand Down Expand Up @@ -394,7 +394,7 @@
"axes = ['energy', 'delayStage']\n",
"ranges = [[-37.5,-27.5], [-1.5,1.5]]\n",
"bins = [200,60]\n",
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges)"
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@
"axes = ['dldTimeSteps', 'delayStage']\n",
"ranges = [[3900,4200], [-1.5,1.5]]\n",
"bins = [100,60]\n",
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges)\n",
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
"\n",
"fig,ax = plt.subplots(1,2,figsize=(8,3), layout='constrained')\n",
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
Expand Down Expand Up @@ -441,7 +441,7 @@
"axes = ['energy', 'delayStage']\n",
"ranges = [[-37.5,-27.5], [-1.5,1.5]]\n",
"bins = [200,60]\n",
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges)\n",
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
"\n",
"fig,ax = plt.subplots(1,2,figsize=(8,3), layout='constrained')\n",
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorial/9_hextof_workflow_trXPD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"axes = ['energy', 'delayStage']\n",
"ranges = [[-37.5,-27.5], [-1.5,1.5]]\n",
"bins = [200,60]\n",
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges)"
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")"
]
},
{
Expand Down

0 comments on commit 8d9bcd5

Please sign in to comment.