1 | Jupyter QtConsole 5.5.2
|
---|
2 |
|
---|
3 | Current ChimeraX session available as 'session'.
|
---|
4 |
|
---|
5 | Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]
|
---|
6 | Type 'copyright', 'credits' or 'license' for more information
|
---|
7 | IPython 8.26.0 -- An enhanced Interactive Python. Type '?' for help.
|
---|
8 |
|
---|
9 | import mrcfile
|
---|
10 |
|
---|
11 | path_to_map = 'C:\Users\luod\Downloads\emd_40589.map'
|
---|
12 | Cell In[2], line 1
|
---|
13 | path_to_map = 'C:\Users\luod\Downloads\emd_40589.map'
|
---|
14 | ^
|
---|
15 | SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
|
---|
16 |
|
---|
17 |
|
---|
18 | path_to_map = r'C:\Users\luod\Downloads\emd_40589.map'
|
---|
19 |
|
---|
20 | path_to_map = r'C:\Users\luod\Downloads\emd_40589.map\emd_40589.map'
|
---|
21 |
|
---|
22 | try:
|
---|
23 | with mrcfile.open(path_to_map, mode='r') as mrc:
|
---|
24 | print("Header info:", mrc.header)
|
---|
25 | print("Data shape:", mrc.data.shape)
|
---|
26 | except Exception as e:
|
---|
27 | print("Caught exception:", e)
|
---|
28 |
|
---|
29 | Header info: (400, 400, 400, 2, 0, 0, 0, 400, 400, 400, (334., 334., 334.), (90., 90., 90.), 1, 2, 3, -14.0112505, 21.881187, 0.01375722, 1, 0, b'\x00\x00\x00\x00\x00\x00\x00\x00', b'', 0, b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', (0., 0., 0.), b'MAP ', [68, 65, 0, 0], 0.38660434, 1, [b'::::EMDATABANK.org::::EMD-40589:::: ', b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' '])
|
---|
30 | Data shape: (400, 400, 400)
|
---|
31 |
|
---|
32 | path_to_map = '"C:\Users\luod\Downloads\emd_40589.map\emd_40589.map'
|
---|
33 | Cell In[6], line 1
|
---|
34 | path_to_map = '"C:\Users\luod\Downloads\emd_40589.map\emd_40589.map'
|
---|
35 | ^
|
---|
36 | SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 3-4: truncated \UXXXXXXXX escape
|
---|
37 |
|
---|
38 |
|
---|
39 | path_to_map = '"C:\\Users\\luod\\Downloads\\emd_40589.map\\emd_40589.map'
|
---|
40 |
|
---|
41 | try:
|
---|
42 | with mrcfile.open(path_to_map, mode='r') as mrc:
|
---|
43 | print("Header info:", mrc.header)
|
---|
44 | print("Data shape:", mrc.data.shape)
|
---|
45 | except Exception as e:
|
---|
46 | print("Caught exception:", e)
|
---|
47 |
|
---|
48 | Caught exception: [Errno 22] Invalid argument: '"C:\\Users\\luod\\Downloads\\emd_40589.map\\emd_40589.map'
|
---|
49 |
|
---|
50 | path_to_map = '"C:\\Users\\luod\\Downloads\\emd_40589.map\\emd_40589.map"'
|
---|
51 |
|
---|
52 | try:
|
---|
53 | with mrcfile.open(path_to_map, mode='r') as mrc:
|
---|
54 | print("Header info:", mrc.header)
|
---|
55 | print("Data shape:", mrc.data.shape)
|
---|
56 | except Exception as e:
|
---|
57 | print("Caught exception:", e)
|
---|
58 |
|
---|
59 | Caught exception: [Errno 22] Invalid argument: '"C:\\Users\\luod\\Downloads\\emd_40589.map\\emd_40589.map"'
|
---|
60 |
|
---|
61 | path_to_map = "C:\\Users\\luod\\Downloads\\emd_40589.map\\emd_40589.map"
|
---|
62 |
|
---|
63 | try:
|
---|
64 | with mrcfile.open(path_to_map, mode='r') as mrc:
|
---|
65 | print("Header info:", mrc.header)
|
---|
66 | print("Data shape:", mrc.data.shape)
|
---|
67 | except Exception as e:
|
---|
68 | print("Caught exception:", e)
|
---|
69 |
|
---|
70 | Header info: (400, 400, 400, 2, 0, 0, 0, 400, 400, 400, (334., 334., 334.), (90., 90., 90.), 1, 2, 3, -14.0112505, 21.881187, 0.01375722, 1, 0, b'\x00\x00\x00\x00\x00\x00\x00\x00', b'', 0, b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', (0., 0., 0.), b'MAP ', [68, 65, 0, 0], 0.38660434, 1, [b'::::EMDATABANK.org::::EMD-40589:::: ', b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' '])
|
---|
71 | Data shape: (400, 400, 400)
|
---|