


ADJGRIDORIGIN adjusts the input grid's origin to ensure consistency among images.
ADJGRIDORIGIN takes as input the grid from GETMISSCRNRS and returns a the
grid with the origin adjusted if necessary. If no adjustment is needed
the same grid is returned.
INPUTS:
grid: output of GETMISSCRNRS
OUTPUTS:
gridout: adjusted grid

0001 function gridout=adjgridorigin(grid) 0002 % ADJGRIDORIGIN adjusts the input grid's origin to ensure consistency among images. 0003 % 0004 % ADJGRIDORIGIN takes as input the grid from GETMISSCRNRS and returns a the 0005 % grid with the origin adjusted if necessary. If no adjustment is needed 0006 % the same grid is returned. 0007 % 0008 % INPUTS: 0009 % grid: output of GETMISSCRNRS 0010 % 0011 % OUTPUTS: 0012 % gridout: adjusted grid 0013 0014 if norm(squeeze(grid(1,1,:)))>norm(squeeze(grid(end,end,:))) 0015 gridtemp(:,:,1)=rot90(grid(:,:,1),2); 0016 gridtemp(:,:,2)=rot90(grid(:,:,2),2); 0017 gridout=gridtemp; 0018 else 0019 gridout=grid; 0020 end