Skip to content
Snippets Groups Projects

[JUNGFRAU][CORRECT] Refactor correction cell and only store corrected datasets

Merged Karim Ahmed requested to merge fix/write_consistent_dataset into master
2 unresolved threads

This MR is related to https://git.xfel.eu/calibration/planning/-/issues/135

Description

By default, all correction notebooks in pycalibration (except for LPD lately) copy all datasets and groups from RAW files to CORR files. Except for the dataset for RAW images. This dataset is overwritten in corrected files with the corrected images.

  1. The number of trains for the corrected data is not the same as RAW data. We exclude trains without data. As a result, there are misalignments between the corrected data and the trains in the corrected file.

This MR fixes this issue by:

  • Using the same concept as the new LPD correction notebook.
  • Not copying all RAW datasets into CORR files.
  • Store actual correct trainIds in INDEX.
  • Store METATDATA
  • Create INSTRUMENT source and store:
    • data.adc (corrected images)
    • data.mask (The bad-pixel mask)
    • data.frameNumber, data.memoryCell, data.gain: same RAW values are stored, but only for the corrected trains.
  1. Updated DataFile.create_metadata() to create METADTAD/dataSources with the ability to be resized. Which is done in the case of adding ROI metadata.
  2. Update Creating INDEX dataset, INSTRUMENT dataset, and CONTROL dataset for ROI.

How Has This Been Tested?

  • Test with changing roi.
  • Test with reference runs.
  • Test with mentioned DOC ticket run.

Relevant Documents (optional)

  • limit_trains = 0

Current Master results drawing MR results drawing

  • limit_trains = 100

Current Master results drawing MR results drawing

Both screenshots are of using h5glance on JNGFR02 corrected files of sequence 17.

  • INSTRUMENT source

    • Number of trains is consistent for memorycell, gain, frameNumber datasets.
    • I didn't create timestamp and trainId datasets. They are already available in INDEX source.
  • RUN source

    • It is not available any more after this MR. (No more copied.)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Style (formatting changes only, no code changes)

Checklist:

  • Add screenshot for before and after this MR

Reviewers

@kluyvert @schmidtp

Edited by Karim Ahmed

Merge request reports

Checking pipeline status.

Approved by

Merged by Karim AhmedKarim Ahmed 2 years ago (Oct 24, 2022 8:48pm UTC)

Merge details

  • Changes merged into master with 7e4e0281.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Karim Ahmed changed the description

    changed the description

  • Karim Ahmed changed the description

    changed the description

  • Karim Ahmed marked the checklist item Test with changing roi. as completed

    marked the checklist item Test with changing roi. as completed

  • Karim Ahmed marked the checklist item Test with reference runs. as completed

    marked the checklist item Test with reference runs. as completed

  • Karim Ahmed marked the checklist item Test with changing roi. as incomplete

    marked the checklist item Test with changing roi. as incomplete

  • Karim Ahmed marked the checklist item Test with mentioned DOC ticket run. as completed

    marked the checklist item Test with mentioned DOC ticket run. as completed

  • Karim Ahmed added 1 commit

    added 1 commit

    • e65abc8c - Enable extending METADATA/dataSources datasets

    Compare with previous version

  • Karim Ahmed marked this merge request as ready

    marked this merge request as ready

  • Karim Ahmed changed the description

    changed the description

  • Karim Ahmed marked the checklist item Test with changing roi. as completed

    marked the checklist item Test with changing roi. as completed

  • Karim Ahmed marked the checklist item Add screenshot for before and after this MR as completed

    marked the checklist item Add screenshot for before and after this MR as completed

  • Karim Ahmed changed milestone to %3.8.0

    changed milestone to %3.8.0

  • Karim Ahmed
  • Karim Ahmed
  • Karim Ahmed
  • Karim Ahmed
  • Karim Ahmed changed title from [JUNGFRAU][CORRECT] Refactorcorrection cell and only store corrected datasets to [JUNGFRAU][CORRECT] Refactor correction cell and only store corrected datasets

    changed title from [JUNGFRAU][CORRECT] Refactorcorrection cell and only store corrected datasets to [JUNGFRAU][CORRECT] Refactor correction cell and only store corrected datasets

  • Karim Ahmed changed the description

    changed the description

  • Karim Ahmed added 1 commit

    added 1 commit

    • 0a64f5a3 - MR comments and update ROI part

    Compare with previous version

  • Karim Ahmed
  • Karim Ahmed changed the description

    changed the description

  • Karim Ahmed
  • Karim Ahmed added 1 commit

    added 1 commit

    • ebfd3860 - style change and replace data_path

    Compare with previous version

  • Karim Ahmed added 1 commit

    added 1 commit

    • fa42674c - remove METATDATA extension for ROI and timestamp shape (1,)

    Compare with previous version

  • Karim Ahmed added 1 commit

    added 1 commit

    • 40b927f6 - remove METATDATA extension for ROI and timestamp shape (1,)

    Compare with previous version

  • Philipp Schmidt approved this merge request

    approved this merge request

  • Philipp Schmidt changed milestone to %3.7.2

    changed milestone to %3.7.2

  • I see this MR has been approved already and I have resolved all discussions. I will be merging in this afternoon if there are no further comments.

    Edited by Karim Ahmed
  • Thank you for the review!

  • merged

  • Karim Ahmed mentioned in commit 7e4e0281

    mentioned in commit 7e4e0281

  • (That comment was meant for !713 (merged) - I clicked on the wrong email to reply to)

  • Karim Ahmed mentioned in merge request !762 (merged)

    mentioned in merge request !762 (merged)

  • Philipp Schmidt mentioned in merge request !764 (merged)

    mentioned in merge request !764 (merged)

  • Please register or sign in to reply
    Loading