Skip to content

Commit

Permalink
test almost all header elements for MRC/CCP4
Browse files Browse the repository at this point in the history
  • Loading branch information
orbeckst committed Feb 19, 2022
1 parent 74057cb commit 6b326b9
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions gridData/tests/test_mrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,48 +41,48 @@ def ccp4data():
return mrc.MRC(datafiles.CCP4_1JZV)

@pytest.mark.parametrize('name,value', [
# nc, nr, ns appear to be nx, ny, nz
#('nc', 96),
#('nr', 76),
#('ns', 70),
('mode', 2),
#('ncstart', -4),
#('nrstart', -23),
#('nsstart', 102),
# not sure why the following values are different in CCP4.CCP4 and mrc.MRC
##('nx', 84),
##('ny', 84),
##('nz', 160),
# nx, ny, nz are named nc, nr, ns in the CCP4 module
('nx', 96),
('ny', 76),
('nz', 70),
#('xlen', 45.79999923706055),
#('ylen', 45.79999923706055),
#('zlen', 89.6500015258789),
#('alpha', 90.0),
#('beta', 90.0),
#('gamma', 90.0),
('mode', 2),
('nxstart', -4),
('nystart', -23),
('nzstart', 102),
('mx', 84),
('my', 84),
('mz', 160),
('cella', np.rec.array((45.8, 45.8, 89.65),
dtype=[('x', '<f4'), ('y', '<f4'), ('z', '<f4')])),
('cellb', np.rec.array((90., 90., 90.),
dtype=[('alpha', '<f4'), ('beta', '<f4'), ('gamma', '<f4')])),
('mapc', 2),
('mapr', 1),
('maps', 3),
#('amin', -0.9930942058563232),
#('amax', 9.050403594970703),
#('amean', -0.0005801090155728161),
('dmin', -0.9930942058563232),
('dmax', 9.050403594970703),
('dmean', -0.0005801090155728161),
('ispg', 92),
('nsymbt', 640),
#('lskflg', 0),
#('bsaflag', '@'),
#('skwmat', None),
#('skwtrn', None),
#('endianness', 'little'),
#('arms', 0.4034915268421173),
('nversion', 0),
('origin', np.rec.array((0., 0., 0.),
dtype=[('x', '<f4'), ('y', '<f4'), ('z', '<f4')])),
('map', b'MAP '),
('machst', np.array([68, 65, 0, 0], dtype=np.uint8)),
('rms', 0.40349153),
('nlabl', 1),
# label exists but contains more byte strings
#('label', ' Map from fft '),
('cella', np.rec.array((45.8, 45.8, 89.65),
dtype=[('x', '<f4'), ('y', '<f4'), ('z', '<f4')])),
('cellb', np.rec.array((90., 90., 90.),
dtype=[('alpha', '<f4'), ('beta', '<f4'), ('gamma', '<f4')])),
('label', np.array([
b' Map from fft ',
b' ',
b' ',
b' ',
b' ',
b' ',
b' ',
b' ',
b' ',
b' '],
dtype='|S80'))
])
def test_ccp4_read_header(ccp4data, name, value):
if type(value) is float:
Expand Down

0 comments on commit 6b326b9

Please sign in to comment.