Hi
I have two questions regarding RMF files
1) What happens if a program that carries an open rmf3 file handle gets killed? Is the rmf file likely to be corrupted? or is this only going to affect the last frame?
2) I use the following code to reprocess trajectories, reading an old rmf file and writing a new one. write_traj is called each time a new frame is to be written in the RMF file. Frames are written sequentially, so I guess the set_current_frame(frameid) is kind of superfluous.
def _write_traj_rmf(self, infile, instep, outfile): import RMF #make sure infile is open if infile not in self.traj_handles_in: src = RMF.open_rmf_file_read_only(infile) self.traj_handles_in[infile] = src src = self.traj_handles_in[infile] #make sure outfile is open if outfile not in self.traj_handles_out: dest = RMF.create_rmf_file(outfile) self.traj_handles_out[outfile] = dest RMF.clone_file_info(src, dest) RMF.clone_hierarchy(src, dest) RMF.clone_static_frame(src, dest) dest = self.traj_handles_out[outfile] #clone frame frameid = src.get_frames()[instep-1] src.set_current_frame(frameid) dest.add_frame(src.get_name(frameid), src.get_type(frameid)) RMF.clone_loaded_frame(src, dest)
Does that sound ok to you? The reason I'm asking, is I get a problem with the written coordinates. They seem to be wrapped when they are too big, e.g. like in a periodic box. Any clues appreciated.
Yannick
On 9/18/14, 4:25 AM, Yannick SPILL wrote: > 1) What happens if a program that carries an open rmf3 file handle gets > killed? Is the rmf file likely to be corrupted? or is this only going to > affect the last frame?
If you're reading the file, nothing. If you're writing it, it should only be the last frame that is affected.
> 2) I use the following code to reprocess trajectories
Looks fine.
> Does that sound ok to you? The reason I'm asking, is I get a problem > with the written coordinates. They seem to be wrapped when they are too > big, e.g. like in a periodic box. Any clues appreciated.
I'm happy to help if you can provide a minimal example. Open an issue on github. (But I can't think of any reason why coordinates would be wrapped, unless you're going outside the range that can be stored in a double.)
Ben
Le 19/09/14 02:02, Ben Webb a écrit : > On 9/18/14, 4:25 AM, Yannick SPILL wrote: >> 1) What happens if a program that carries an open rmf3 file handle gets >> killed? Is the rmf file likely to be corrupted? or is this only going to >> affect the last frame? > > If you're reading the file, nothing. If you're writing it, it should > only be the last frame that is affected. > >> 2) I use the following code to reprocess trajectories > > Looks fine. > >> Does that sound ok to you? The reason I'm asking, is I get a problem >> with the written coordinates. They seem to be wrapped when they are too >> big, e.g. like in a periodic box. Any clues appreciated. > > I'm happy to help if you can provide a minimal example. Open an issue > on github. (But I can't think of any reason why coordinates would be > wrapped, unless you're going outside the range that can be stored in a > double.) > > Ben
Okay! Thanks for your feedback! If I manage to narrow it down, I will post it there. Y
participants (2)
-
Ben Webb
-
Yannick SPILL