Old IDL code for CGS image analysis