@@ -22,24 +22,24 @@ def get_reconstructed_positions(file_path: str = ""):
2222 apt = ReadAptFileFormat (file_path )
2323 # print(apt.get_metadata_table())
2424 xyz = apt .get_reconstructed_positions ()
25- print (
26- f"Load reconstructed positions shape { np .shape (xyz .values )} , type { type (xyz .values )} , dtype { xyz .values .dtype } "
27- )
25+ # print(
26+ # f"Load reconstructed positions shape {np.shape(xyz.values)}, type {type(xyz.values)}, dtype {xyz.values.dtype}"
27+ # )
2828 return (xyz .values , "nm" )
2929 elif file_path .lower ().endswith (".pos" ):
3030 pos = ReadPosFileFormat (file_path )
3131 xyz = pos .get_reconstructed_positions ()
32- print (
33- f"Load reconstructed positions shape { np .shape (xyz .values )} , type { type (xyz .values )} , dtype { xyz .values .dtype } "
34- )
32+ # print(
33+ # f"Load reconstructed positions shape {np.shape(xyz.values)}, type {type(xyz.values)}, dtype {xyz.values.dtype}"
34+ # )
3535 return (xyz .values , "nm" )
3636 else :
3737 with h5py .File (file_path , "r" ) as h5r :
3838 trg = "/entry1/atom_probe/reconstruction/reconstructed_positions"
3939 xyz = h5r [trg ][:, :]
40- print (
41- f"Load reconstructed positions shape { np .shape (xyz )} , type { type (xyz )} , dtype { xyz .dtype } "
42- )
40+ # print(
41+ # f"Load reconstructed positions shape {np.shape(xyz)}, type {type(xyz)}, dtype {xyz.dtype}"
42+ # )
4343 return (xyz , "nm" )
4444
4545
@@ -52,14 +52,14 @@ def get_ranging_info(file_path: str = "", verbose: bool = False):
5252 n_ion_types = 1 + len (rrng .rrng ["molecular_ions" ]) # 1 + for the unknown type!
5353 # add the unknown iontype
5454 iontypes ["ion0" ] = ("unknown" , np .uint8 (0 ), np .float64 ([0.0 , MQ_EPSILON ]))
55- print (f" { iontypes ["ion0" ]} " )
55+ # print(f' {iontypes["ion0"]}' )
5656 for ion_id , mion in enumerate (rrng .rrng ["molecular_ions" ]):
5757 iontypes [f"ion{ ion_id + 1 } " ] = (
5858 mion .name .values ,
5959 np .uint8 (ion_id + 1 ),
6060 mion .ranges .values .flatten (),
6161 )
62- print (f"{ iontypes [f'ion{ ion_id + 1 } ' ]} " )
62+ # print(f"{iontypes[f'ion{ion_id + 1}']}")
6363 else :
6464 with h5py .File (file_path , "r" ) as h5r :
6565 trg = "/entry1/atom_probe/ranging/peak_identification"
@@ -71,12 +71,12 @@ def get_ranging_info(file_path: str = "", verbose: bool = False):
7171 np .uint8 (ion_id ),
7272 h5r [f"{ trg } /ion{ ion_id } /mass_to_charge_range" ][:, :],
7373 )
74- print (f"{ iontypes [f'ion{ ion_id } ' ]} " )
74+ # print(f"{iontypes[f'ion{ion_id}']}")
7575
76- print (f"{ n_ion_types } iontypes distinguished:" )
77- if verbose :
78- for key , val in iontypes .items ():
79- print (f"\t { key } , { val } " )
76+ # print(f"{n_ion_types} iontypes distinguished:")
77+ # if verbose:
78+ # for key, val in iontypes.items():
79+ # print(f"\t{key}, {val}")
8080 chrg_agnostic_iontypes : dict = {}
8181 elements = set ()
8282 for key , value in iontypes .items ():
@@ -89,15 +89,15 @@ def get_ranging_info(file_path: str = "", verbose: bool = False):
8989 for symbol in symbols :
9090 if symbol in chemical_symbols [1 ::]:
9191 elements .add (symbol )
92- print (f"{ len (chrg_agnostic_iontypes )} charge-agnostic iontypes distinguished:" )
93- if verbose :
94- for key , val in chrg_agnostic_iontypes .items ():
95- print (f"\t { key } , { val } " )
96- print (f"{ len (elements )} elements distinguished:" )
92+ # print(f"{len(chrg_agnostic_iontypes)} charge-agnostic iontypes distinguished:")
93+ # if verbose:
94+ # for key, val in chrg_agnostic_iontypes.items():
95+ # print(f"\t{key}, {val}")
96+ # print(f"{len(elements)} elements distinguished:")
9797 lex_asc_elements = np .sort (list (elements ), kind = "stable" )
98- if verbose :
99- for symbol in lex_asc_elements :
100- print (symbol )
98+ # if verbose:
99+ # for symbol in lex_asc_elements:
100+ # print(symbol)
101101 return iontypes , chrg_agnostic_iontypes , lex_asc_elements
102102
103103
@@ -130,17 +130,15 @@ def get_iontypes(file_path: str = "", iontypes: dict = {}):
130130 ion_id = value [1 ]
131131 low = value [2 ][0 ]
132132 high = value [2 ][1 ]
133- print (f"Ranging { ion_id } with [{ low } , { high } ] ..." )
133+ # print(f"Ranging {ion_id} with [{low}, {high}] ...")
134134 msk = np .argwhere ((mq .values >= low ) & (mq .values <= high ))
135- print (f"{ np .shape (msk )} , { msk [0 :5 ]} , { msk [- 5 :]} " )
135+ # print(f"{np.shape(msk)}, {msk[0:5]}, {msk[-5:]}")
136136 ityp [msk ] = ion_id
137- else :
138- print (f"Skipping ion0..." )
139137 else :
140138 with h5py .File (file_path , "r" ) as h5r :
141139 trg = "/entry1/iontypes/iontypes"
142140 ityp = h5r [trg ][:]
143- print (
144- f"Load ranged iontypes shape { np .shape (ityp )} , type { type (ityp )} , dtype { ityp .dtype } "
145- )
141+ # print(
142+ # f"Load ranged iontypes shape {np.shape(ityp)}, type {type(ityp)}, dtype {ityp.dtype}"
143+ # )
146144 return ityp
0 commit comments