Skip to content
Snippets Groups Projects

Draft: fix[Gotthard2][Dark]: Avoid trains with only 0. data

Closed Karim Ahmed requested to merge fix/avoid_trains_with_no_data into master
4 unresolved threads

Description

@mramilli reported that the bad pixels looked a bit weird with all pixels assigned WRONG_GAIN_VALUE for medium or low gain stages.

This was a reason for the presence of some trains in the corresponding runs for these gains which had no data. A reason for this seems to be missing packets.

The fix is to exclude these trains from the dark constants processing.

I have also combined both functions into one functions that process all dark constants.

How Has This Been Tested?

Relevant Documents (optional)

Master.pdf MR.pdf

MR_badpixels_c0_interleaved master_badpixels_c0_interleaved

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

Reviewers

Edited by Karim Ahmed

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
378 378 " context.map(convert_train, dc)\n",
379 379 " step_timer.done_step(\"convert to 10bit\")\n",
380 380 "\n",
381 " def dark_constant_cell_processing(wid, index, gain_and_data):\n",
382 " g, d = gain_and_data\n",
383 "\n",
384 " # Filter out trains with no data. (e.g. missing packets)\n",
385 " nonzero_mask = np.all(d != 0, axis=(1, 2))\n",
  • 404 415 " data_gain = dc[src, \"data.gain\"].ndarray()\n",
    405 416 " even_gain = data_gain[:, 20::2, :]\n",
    406 417 " odd_gain = data_gain[:, 21::2, :]\n",
    407 " raw_g = 3 if gain == 2 else gain\n",
    408 "\n",
    409 " def badpixels_cell(wid, index, g):\n",
    410 " \"\"\"Check if there are wrong bad gain values.\n",
    411 " Indicate pixels with wrong gain value across all trains for each cell.\"\"\"\n",
    412 " badpixels_map[mod][\n",
    413 " np.mean(g, axis=(0, 1)) != raw_g, index, gain\n",
    414 " ] |= BadPixels.WRONG_GAIN_VALUE.value\n",
    415 "\n",
    416 " context.map(badpixels_cell, (even_gain, odd_gain))\n",
    417 418 "\n",
    419 " # Calculate Offset, Noise Maps, and Bad Pixels in one go\n",
    420 " context.map(dark_constant_cell_processing, ((even_gain, even_data), (odd_gain, odd_data)))\n",
  • Karim Ahmed added 1 commit

    added 1 commit

    • 6ff5f1d2 - fix: add some fixes after confirming the source of issue

    Compare with previous version

  • I am closing this MR. We can always go back to it if needed

  • closed

  • Please register or sign in to reply
    Loading