Skip to content

Commit 7eb2aab

Browse files
ndg63276Mark Williamsgfrn
authored
Merge pre-release/2024-R5.3 (and pre-release/2024-R5.2) into master (#882)
* LIMS-1498: Change name of processed data archive (#855) * LIMS-1469: Fix download button on old summary page (#840) * LIMS-1463: Always display Mesh3D data collections as grid scans (#845) * LIMS-1515: Add energy value to data collections (#853) * LIMS-261: Allow download of PDB files (#857) * LIMS-1529: Fix fast ep model viewer (#858) * LIMS-753: Allow LN2 topups as part of dewar history (#856) * LIMS-1530: Add To Queue Fails when Not Completed filter applied (#864) * LIMS-1530: Add To Queue Fails when Not Completed filter applied * LIMS-1552: Remove old jquery (#871) * LIMS-1500: Set the dispatch request email recipients based on the dewar barcode (#848) * LIMS-1458: Fix GitHub warnings (#841) --------- Co-authored-by: Mark Williams <[email protected]> Co-authored-by: Guilherme Francisco <[email protected]>
1 parent 0904d6d commit 7eb2aab

39 files changed

+294
-230
lines changed

api/scripts/mtz2map.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ else
1414
fi
1515
fi
1616

17+
#export CCP4_MASTER=/dls_sw/apps/ccp4/<ccp4 version>
18+
export CCP4_MASTER=$5
19+
export CINCL=$CCP4_MASTER/include
20+
export CLIBD=$CCP4_MASTER/lib/data
21+
22+
export CCP4_SCR=/tmp
23+
export root=$CCP4_MASTER/bin
24+
1725
if [ $3 == 'dimple' -o $3 == 'mrbump' ]; then
1826

1927
if [ -f $4 ]; then
@@ -28,14 +36,6 @@ else
2836
fi
2937
fi
3038

31-
#export CCP4_MASTER=/dls_sw/apps/ccp4/<ccp4 version>
32-
export CCP4_MASTER=$5
33-
export CINCL=$CCP4_MASTER/include
34-
export CLIBD=$CCP4_MASTER/lib/data
35-
36-
export CCP4_SCR=/tmp
37-
export root=$CCP4_MASTER/bin
38-
3939
if [ $3 == 'dimple' ]; then
4040

4141
if $root/mtzinfo $mtz | grep -q PH2FOFCWT; then

api/src/Page/Cell.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ function _beamlines()
274274
$pdb = $this->db->pq("SELECT TO_CHAR(p.pdbdate, 'YYYY') as year, $replace as bl, count(p.pdbentryid) as count
275275
FROM pdbentry p
276276
WHERE p.pdbdate > TO_DATE('2010-05', 'YYYY-MM')
277-
GROUP BY $replace, TO_CHAR(p.pdbdate, 'YYYY')
278-
ORDER BY TO_CHAR(p.pdbdate, 'YYYY')");
277+
GROUP BY bl, year
278+
ORDER BY year, bl");
279279

280280
$isp = $this->db->pq("SELECT TO_CHAR(p.pdbdate, 'YYYY') as year, CASE WHEN p.autoprocprogramid > 0 THEN UPPER(s.beamlinename) ELSE $replace END as bl, count(p.pdbentryid) as count
281281
FROM pdbentry p
@@ -284,8 +284,8 @@ function _beamlines()
284284
INNER JOIN datacollectiongroup dcg ON dcg.datacollectiongroupid = dc.datacollectiongroupid
285285
INNER JOIN blsession s ON s.sessionid = dcg.sessionid
286286
WHERE p.pdbdate > TO_DATE('2010-05', 'YYYY-MM')
287-
GROUP BY CASE WHEN p.autoprocprogramid > 0 THEN UPPER(s.beamlinename) ELSE $replace END, TO_CHAR(p.pdbdate, 'YYYY')
288-
ORDER BY TO_CHAR(p.pdbdate, 'YYYY')");
287+
GROUP BY bl, year
288+
ORDER BY year, bl");
289289

290290
foreach ($pdb as $i => &$s) {
291291
$s['COUNT'] = intval(($s['COUNT']));

api/src/Page/DC.php

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class DC extends Page
6262
array('/dat/:id', 'get', '_plot'),
6363
);
6464

65+
const EVTOA = 12398.4198;
66+
6567
# ------------------------------------------------------------------------
6668
# Data Collection AJAX Requests
6769
# This is pretty crazy, it will return unioned data collections, energy
@@ -422,9 +424,12 @@ function _data_collections($single = null)
422424
dc.transmission,
423425
dc.axisrange,
424426
dc.wavelength,
427+
".self::EVTOA."/dc.wavelength as energy,
425428
dc.comments,
426429
1 as epk,
427430
1 as ein,
431+
1 as wpk,
432+
1 as win,
428433
dc.xtalsnapshotfullpath1 as x1,
429434
dc.xtalsnapshotfullpath2 as x2,
430435
dc.xtalsnapshotfullpath3 as x3,
@@ -556,9 +561,12 @@ function _data_collections($single = null)
556561
min(dc.transmission) as transmission,
557562
min(dc.axisrange) as axisrange,
558563
min(dc.wavelength) as wavelength,
564+
".self::EVTOA."/min(dc.wavelength) as energy,
559565
min(dc.comments) as comments,
560566
1 as epk,
561567
1 as ein,
568+
1 as wpk,
569+
1 as win,
562570
min(dc.xtalsnapshotfullpath1) as x1,
563571
min(dc.xtalsnapshotfullpath2) as x2,
564572
min(dc.xtalsnapshotfullpath3) as x3,
@@ -705,17 +713,20 @@ function _data_collections($single = null)
705713
es.energyscanid,
706714
1,
707715
es.element,
708-
es.peakfprime,
716+
es.peakfprime as resolution,
709717
es.exposuretime,
710718
es.axisposition,
711-
es.peakfdoubleprime,
719+
es.peakfdoubleprime as numimg,
712720
es.starttime as st,
713721
es.transmissionfactor,
714-
es.inflectionfprime,
715-
es.inflectionfdoubleprime,
722+
es.inflectionfprime as axisrange,
723+
es.inflectionfdoubleprime as wavelength,
724+
1 as energy,
716725
es.comments,
717726
es.peakenergy,
718727
es.inflectionenergy,
728+
".self::EVTOA."/es.peakenergy as wpk,
729+
".self::EVTOA."/es.inflectionenergy as win,
719730
'A',
720731
'A',
721732
'A',
@@ -805,10 +816,13 @@ function _data_collections($single = null)
805816
TO_CHAR(xrf.starttime, 'DD-MM-YYYY HH24:MI:SS') as st,
806817
xrf.beamtransmission,
807818
1,
808-
xrf.energy,
819+
".self::EVTOA."/xrf.energy as wavelength,
820+
xrf.energy as energy,
809821
xrf.comments,
810822
1,
811823
1,
824+
1 as wpk,
825+
1 as win,
812826
'A',
813827
'A',
814828
'A',
@@ -899,9 +913,12 @@ function _data_collections($single = null)
899913
1,
900914
1,
901915
1,
916+
1 as energy,
902917
'A',
903918
1,
904919
1,
920+
1 as wpk,
921+
1 as win,
905922
r.xtalsnapshotbefore,
906923
r.xtalsnapshotafter,
907924
'A',
@@ -974,7 +991,7 @@ function _data_collections($single = null)
974991

975992
// Data collections
976993
if ($dc['TYPE'] == 'data') {
977-
$nf = array(1 => array('AXISSTART', 'CHISTART', 'PHI', 'OVERLAP'), 2 => array('RESOLUTION', 'TRANSMISSION', 'AXISRANGE', 'TOTALDOSE'), 4 => array('WAVELENGTH', 'EXPOSURETIME'));
994+
$nf = array(0 => array('ENERGY'), 1 => array('AXISSTART', 'CHISTART', 'PHI', 'OVERLAP'), 2 => array('RESOLUTION', 'TRANSMISSION', 'AXISRANGE', 'TOTALDOSE'), 4 => array('WAVELENGTH', 'EXPOSURETIME'));
978995

979996
$dc['DIRFULL'] = $dc['DIR'];
980997
$dc['DIR'] = preg_replace('/.*\/' . $this->arg('prop') . '-' . $dc['VN'] . '\//', '', $dc['DIR']);
@@ -993,9 +1010,10 @@ function _data_collections($single = null)
9931010
$dc['DCT'] = 'Data Collection';
9941011
}
9951012

996-
if ($dc['DCT'] == 'Mesh')
1013+
if ($dc['DCT'] == 'Mesh' || $dc['DCT'] == 'Mesh3D' ||
1014+
($dc['DCT'] != 'Serial Fixed' && $dc['DCT'] != 'Serial Jet' && $dc['AXISRANGE'] == 0 && $dc['NI'] > 1)
1015+
) {
9971016
$dc['DCT'] = 'Grid Scan';
998-
if ($dc['DCT'] != 'Serial Fixed' && $dc['DCT'] != 'Serial Jet' && $dc['AXISRANGE'] == 0 && $dc['NI'] > 1) {
9991017
$dc['TYPE'] = 'grid';
10001018
}
10011019
//$this->profile('dc');
@@ -1010,12 +1028,12 @@ function _data_collections($single = null)
10101028

10111029
$dc['FILETEMPLATE'] = preg_replace('/.*\/' . $this->arg('prop') . '-' . $dc['VN'] . '\//', '', $dc['FILETEMPLATE']);
10121030

1013-
$nf = array(2 => array('EXPOSURETIME', 'AXISSTART', 'RESOLUTION', 'TRANSMISSION'));
1031+
$nf = array(1 => array('EPK', 'EIN'), 2 => array('AXISRANGE', 'WAVELENGTH', 'EXPOSURETIME', 'AXISSTART', 'RESOLUTION', 'TRANSMISSION', 'NUMIMG'), 5 => array('WPK', 'WIN'));
10141032
$this->profile('edge');
10151033

10161034
// MCA Scans
10171035
} else if ($dc['TYPE'] == 'mca') {
1018-
$nf = array(2 => array('EXPOSURETIME', 'WAVELENGTH', 'TRANSMISSION'));
1036+
$nf = array(0 => array('ENERGY'), 2 => array('EXPOSURETIME', 'TRANSMISSION'), 4 => array('WAVELENGTH'));
10191037
$dc['DIRFULL'] = $dc['DIR'];
10201038
$dc['DIR'] = preg_replace('/.*\/\d\d\d\d\/\w\w\d+-\d+\//', '', $dc['DIR']);
10211039

api/src/Page/Download.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ function _download_visit()
9292
$this->_error('There doesnt seem to be a data archive available for this visit');
9393
}
9494

95-
# ------------------------------------------------------------------------
96-
# Download mtz/log file for Fast DP / XIA2
97-
# TODO: Delete me
95+
9896
# This method either returns a list of plots from MX auto processing tools (n_obs, n_uniq, completeness etc.)
9997
# Or returns a specific plot based on auto processing attachment id (aid).
10098
# Individual plotly format Graphs can be returned via an aid, but will not be included in the list of plots (as their format is different)
@@ -468,14 +466,14 @@ function _get_autoproc_archive()
468466

469467
$aps = $this->db->union(
470468
array(
471-
"SELECT app.autoprocprogramid, app.processingprograms, app.processingstatus
469+
"SELECT app.autoprocprogramid, app.processingprograms, app.processingstatus, dc.imageprefix, dc.datacollectionnumber
472470
FROM autoprocintegration api
473471
INNER JOIN autoprocprogram app ON api.autoprocprogramid = app.autoprocprogramid
474472
INNER JOIN datacollection dc ON dc.datacollectionid = api.datacollectionid
475473
INNER JOIN datacollectiongroup dcg ON dcg.datacollectiongroupid = dc.datacollectiongroupid
476474
INNER JOIN blsession s ON s.sessionid = dcg.sessionid
477475
WHERE s.proposalid=:1 AND app.autoprocprogramid=:2",
478-
"SELECT app.autoprocprogramid, app.processingprograms, app.processingstatus
476+
"SELECT app.autoprocprogramid, app.processingprograms, app.processingstatus, dc.imageprefix, dc.datacollectionnumber
479477
FROM autoprocprogram app
480478
INNER JOIN processingjob pj on pj.processingjobid = app.processingjobid
481479
INNER JOIN datacollection dc ON dc.datacollectionid = pj.datacollectionid
@@ -497,7 +495,7 @@ function _get_autoproc_archive()
497495
}
498496

499497
$clean_program = preg_replace('/[^A-Za-z0-9\-]/', '', $ap['PROCESSINGPROGRAMS']);
500-
$zipName = $this->arg('AUTOPROCPROGRAMID') . '_' . $clean_program;
498+
$zipName = $this->arg('AUTOPROCPROGRAMID') . '_' . $ap['IMAGEPREFIX'] . '_' . $ap['DATACOLLECTIONNUMBER'] . '_' . $clean_program;
501499
$this->_streamZipFile($files, $zipName);
502500
}
503501

api/src/Page/Sample.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ class Sample extends Page
195195
array('/pdbs(/pid/:pid)', 'get', '_get_pdbs'),
196196
array('/pdbs', 'post', '_add_pdb'),
197197
array('/pdbs(/:pdbid)', 'delete', '_remove_pdb'),
198+
array('/pdbs/download/:pdbid', 'get', '_download_pdb'),
198199

199200
array('/concentrationtypes', 'get', '_concentration_types'),
200201
array('/componenttypes', 'get', '_component_types'),
@@ -2062,6 +2063,21 @@ function _get_pdbs()
20622063
$this->_output($rows);
20632064
}
20642065

2066+
# ------------------------------------------------------------------------
2067+
# Download a pdb file
2068+
function _download_pdb()
2069+
{
2070+
if (!$this->has_arg('pdbid'))
2071+
$this->_error('No PDB id specified');
2072+
2073+
$pdb = $this->db->pq("SELECT name, contents FROM pdb WHERE pdbid = :1", array($this->arg('pdbid')));
2074+
$pdb = $pdb[0];
2075+
2076+
header('Content-Type:text/plain');
2077+
header('Content-Disposition:attachment;filename='.$pdb['NAME']);
2078+
print $pdb['CONTENTS'];
2079+
}
2080+
20652081
# ------------------------------------------------------------------------
20662082
# Add a new pdb
20672083
function _add_pdb()

0 commit comments

Comments
 (0)