Skip to content

Commit

Permalink
Merge pull request #9 from brisvag/fix/optic-group-missing
Browse files Browse the repository at this point in the history
ensure optics grup always exists
  • Loading branch information
brisvag authored Nov 30, 2023
2 parents 52b875a + 6f83795 commit a6105e1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cs2star/cs2star.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
@click.option("--swapxy/--no-swapxy", default=True, help="swap x and y axes")
@click.option("--inverty/--no-inverty", default=False, help="invert y axis")
@click.option("--invertx/--no-invertx", default=False, help="invert x axis")
@click.version_option()
def main(
job_dir,
dest_dir,
Expand Down Expand Up @@ -235,6 +236,8 @@ def main(
cleaning = progress.add_task("Cleaning up micrograph data...", total=3)
# also, optics are changed to 1-based indexing by pyem in parse_cryosparc_2_cs so we match it
# and we do it before the opticgroupname is generated from it
if "rlnOpticsGroup" not in df_mic.columns:
df_mic["rlnOpticsGroup"] = 0
df_mic["rlnOpticsGroup"] += 1
df_mic = pyem.star.check_defaults(df_mic, inplace=True)
progress.update(cleaning, advance=1)
Expand Down

0 comments on commit a6105e1

Please sign in to comment.