Skip to content

Commit

Permalink
LIMS-572: Use micronsPerPixel preferably over pixelsPerMicron for gri…
Browse files Browse the repository at this point in the history
…d scan snapshots (#517)

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
  • Loading branch information
ndg63276 and Mark Williams authored Apr 21, 2023
1 parent 4c12f8c commit 09ad866
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/src/Page/DC.php
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ function _null_or($field, $conversion)
# Grid Scan Info
function _grid_info()
{
$info = $this->db->pq("SELECT dc.datacollectiongroupid, dc.datacollectionid, dc.axisstart, p.posx as x, p.posy as y, p.posz as z, g.dx_mm, g.dy_mm, g.steps_x, g.steps_y, g.pixelspermicronx, g.pixelspermicrony, g.snapshot_offsetxpixel, g.snapshot_offsetypixel, g.orientation, g.snaked, DATE_FORMAT(dc.starttime, '%Y%m%d') as startdate
$info = $this->db->pq("SELECT dc.datacollectiongroupid, dc.datacollectionid, dc.axisstart, p.posx as x, p.posy as y, p.posz as z, g.dx_mm, g.dy_mm, g.steps_x, g.steps_y, IFNULL(g.micronsperpixelx,g.pixelspermicronx) as micronsperpixelx, IFNULL(g.micronsperpixely,g.pixelspermicrony) as micronsperpixely, g.snapshot_offsetxpixel, g.snapshot_offsetypixel, g.orientation, g.snaked, DATE_FORMAT(dc.starttime, '%Y%m%d') as startdate
FROM gridinfo g
INNER JOIN datacollection dc on (dc.datacollectionid = g.datacollectionid) or (dc.datacollectiongroupid = g.datacollectiongroupid)
LEFT OUTER JOIN position p ON dc.positionid = p.positionid
Expand Down
4 changes: 2 additions & 2 deletions client/src/js/modules/dc/views/gridplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ define(['jquery', 'marionette',
draw: function() {
if (!this.ctx || !this.gridFetched) return

var bw = 1000*this.grid.get('DX_MM')/Math.abs(this.grid.get('PIXELSPERMICRONX'))
var bh = 1000*this.grid.get('DY_MM')/Math.abs(this.grid.get('PIXELSPERMICRONY'))
var bw = 1000*this.grid.get('DX_MM')/Math.abs(this.grid.get('MICRONSPERPIXELX'))
var bh = 1000*this.grid.get('DY_MM')/Math.abs(this.grid.get('MICRONSPERPIXELY'))

this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)

Expand Down

0 comments on commit 09ad866

Please sign in to comment.