CHARMM Development Project
After recentereing, some resids still float out of unit cell.
I tried to recenter only 5 ns at a time but the result is the same.

stream toppar.str

read psf card name "/export/lustre_1/mallsopp/dpc/sim1/w-dpc-1.psf"
OPEN UNIT 1 READ CARD NAME "/export/lustre_1/mallsopp/dpc/rg/crd/sim1.crd"
coor copy comp

crystal free
crystal define cubi 70 70 70 90. 90. 90.
crystal build noper 0 
image byres sele segid DPC end 
update imgfrq 20 cutim 20.0

set i = 100
set j = 100
label beginloop

open unit @i read unform name /export/lustre_1/mallsopp/dpc/dcd/sim1/dyn@i.dcd

incr i by 1
incr j by 1
if @j .lt. 151 then goto beginloop

open write unit 20 file name micelle-tmp-sim1.dcd    ! Write recenered 

merge first 100 nunit 51 output 20 - !nfile 1000 output @wu -
!sele segid DPC .and. (-
! end -
sele segid DPC .or. segid WAT end -
 recenter -
orient norot sele type C212 .and. resid 1 end

close unit 20

In another thread, someone mentioned a shift z command. I could not find that in documentation.

Maybe some combination of shifts could fix it.
It looks like this:

I found this piece of code
COOR STATistics SELE desired-atom END
I see no obvious reason why this does not work; you should probably also add IMAGE BYRES SELE SEGID WAT END, but that should not influence your DPC. Do you get any output indicating that image centering is being done? You could try removing the "ORIENT NOROT", but that too should not be any problem.
To be clear, there is an obvious recentering that occurs from this script. However, the micelle still drifts enough for this problem to occur.
OK. You can try doing the merge recenter twice, or increasing the cutoff in your crystal build command to get more images included.
There can be issues with this if the micelle is no longer intact due to a simulation run with IMAGE BYRES for the centering, esp. for the ORIENT option. Micelle structures are generally too chaotic for an RMS atom based alignment to be very useful.
Recentering does not depend on any RMS based alignment.
The ORIEnt requested in this case was very focused.
I think the problem was that some residues moved further than one neighbor image between saved frames in the trajectory.
Right-- I forgot ORIENT uses the same atom selection as RECENTER.

It could be an issue with the position of the selected atom in the reference structure, though, so it still may be worth trying it w/o the ORIENT NOROT keywords.
I tried recentering twice- running the above script on the output of the above script.

I also tried using crystal build cuto 100.

The resulting trajectory was analyzed with the script developed in this thread.

In both cases, the time series is fluctuating too much to represent a micelle that is not breaking apart from parts leaving the unit cell.

Would you like me to post trajectories, input, outputs?

One idea to bypass this problem which I used during other analysis is to work with all the time series and exclude the affected points. I tried "write all" , however this only writes 8 columns so columns 8-16 are in row 2. Is there a way to write all preserving columns?

Thankyou for the assistance
One way to avoid this problem is to use IMAGE BYSEG for the micelle, so that it remains intact throughout the simulation.

Use the LONGline command prior to writing the data files from CORREL to avoid line wrapping to 80 chars.

I'd probably look at time series of the P atom coordinates to see if I could find one that hasn't been image centered at all, and use that as the target for the RECENTER.

Have you tried w/o ORIENT NOROT yet?

I have resolved z drift in some bilayer simulations by using the COM from the unfolded trajectory; however, this requires starting from a point before any lipids have been separated by image centering.
Yes I tried ORIENT NOROT also and did not see a change.
© CHARMM forums