Skip to content

Commit

Permalink
[SCI-10139] Units for CTF Asigmatism and Estimated Defocus
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Preston committed Nov 23, 2021
1 parent 7b4aac0 commit 9c8dfa1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
32 changes: 12 additions & 20 deletions api/src/Page/EM/Ctf.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ public function ctfResult()
c.minDefocus,
c.maxDefocus,
c.defocusStepSize,
c.astigmatism,
c.astigmatism / 10.0 as astigmatism,
c.astigmatismAngle,
c.estimatedResolution,
c.estimatedDefocus,
c.estimatedDefocus / 10000.0 as estimatedDefocus,
c.amplitudeContrast,
c.ccValue,
c.fftTheoreticalFullPath,
c.comments,
c.autoProcProgramId,
m.createdTimeStamp,
mc.imageNumber
FROM CTF c
Expand All @@ -37,7 +35,6 @@ public function ctfResult()
WHERE CONCAT(p.proposalCode, p.proposalNumber) = :1
AND c.autoProcProgramId = :2
AND mc.imageNumber = :3",
// Maybe c.autoProcProgramId should be mc. ?????
array(
$this->arg('prop'),
$this->arg('programId'),
Expand All @@ -51,17 +48,14 @@ public function ctfResult()
}
$row = $rows[0];

$row['fftTheoreticalFullPath'] = file_exists($row['fftTheoreticalFullPath']) ? 1 : 0;

$formatColumns = array(
'astigmatism' => 2,
'astigmatismAngle' => 1,
'estimatedResolution' => 2,
'estimatedDefocus' => 0
);
foreach ($formatColumns as $column => $decimals) {
$row[$column] = number_format($row[$column], $decimals, '.', '');
}
$row['estimatedResolution'] =
number_format($row['estimatedResolution'], 2, '.', '');
$row['astigmatismAngle'] =
number_format($row['astigmatismAngle'], 1, '.', '');
$row['astigmatism'] =
number_format($row['astigmatism'], 4, '.', '');
$row['estimatedDefocus'] =
number_format($row['estimatedDefocus'], 5, '.', '');

$this->_output($row);
}
Expand All @@ -80,7 +74,6 @@ public function ctfImage()
WHERE CONCAT(p.proposalCode, p.proposalNumber) = :1
AND c.autoProcProgramId = :2
AND mc.imageNumber = :3",
// Maybe c.autoProcProgramId should be mc. ?????
array(
$this->arg('prop'),
$this->arg('programId'),
Expand All @@ -102,9 +95,9 @@ public function ctfSummary()
"SELECT
mc.imageNumber,
m.createdTimeStamp,
c.astigmatism,
c.astigmatism / 10.0 as astigmatism,
c.estimatedResolution,
c.estimatedDefocus
c.estimatedDefocus / 10000.0 as estimatedDefocus
FROM CTF c
INNER JOIN AutoProcProgram app ON app.autoProcProgramId = c.autoProcProgramId
INNER JOIN MotionCorrection mc ON mc.motionCorrectionId = c.motionCorrectionId
Expand All @@ -116,7 +109,6 @@ public function ctfSummary()
WHERE CONCAT(p.proposalCode, p.proposalNumber) = :1
AND c.autoProcProgramId = :2
ORDER BY m.createdTimeStamp",
// Maybe c.autoProcProgramId should be mc. ?????
array($this->arg('prop'), $this->arg('programId')),
false
);
Expand Down
8 changes: 2 additions & 6 deletions client/src/js/modules/types/em/ctf-summary/summary-charts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default {
},
'layoutAstigmatism': function() {
return this.plotlyLayout({
'title': 'Å',
'title': 'nm',
'rangemode': 'tozero',
'fixedrange': true,
})
Expand Down Expand Up @@ -185,11 +185,7 @@ export default {
'<br>' + row.createdTimeStamp
)
for (const chart in yAxes) {
yAxes[chart].push(
// the estimatedDefocus chart should be in μm
chart == 'estimatedDefocus' ?
row[chart] / 10000.0 : row[chart]
)
yAxes[chart].push(row[chart])
}
})
Object.freeze(xAxis)
Expand Down
4 changes: 2 additions & 2 deletions client/src/js/modules/types/em/ctf/params.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<parameter-list-item
label="Astigmatism"
:value="ctfEstimation.astigmatism"
unit="Å"
unit="nm"
/>
<parameter-list-item
label="Astigmatism Angle"
Expand All @@ -52,7 +52,7 @@
<parameter-list-item
label="Estimated Defocus"
:value="ctfEstimation.estimatedDefocus"
unit="Å"
unit="μm"
/>
<parameter-list-item
label="Amplitude Contrast"
Expand Down

0 comments on commit 9c8dfa1

Please sign in to comment.