private static double gCalendarToJD(int yy, int mm, double dd){
	        /* it does not take care of 1582correction assumes correct calender from the past  */
	        int A, B, m, y;
	        double T1, T2, Tr;
	        if (mm > 2)
	        {
	            y = yy;
	            m = mm;
	        }
	        else
	        {
	            y = yy - 1;
	            m = mm + 12;
	        } 
	        A = y / 100;
	        B = 2 - A + A / 4;
	        T1 = ip(365.25 * (y + 4716));
	        T2 = ip(30.6001 * (m + 1));
	        Tr = T1 + T2 + dd + B - 1524.5;
	        return Tr;
	    }