Ejemplo n.º 1
0
        static void Main(string[] args)
        { /*
           * String progID;
           *
           * progID = Telescope.Choose("ScopeSim.Telescope");
           * Telescope T = new Telescope(progID);
           *
           * T.SetupDialog();
           * T.Connected = true;
           * TelescopeControl tc = new TelescopeControl( progID, T );
           *
           * tc.Goto(5, 88 );
           * Console.Read();
           * T.Connected = false;
           * T.Dispose();
           * */
            JANClient       astrometry      = new JANClient();
            CalibrationData calibrationData = astrometry.imageCalibration("C:\\Users\\Michele\\documents\\visual studio 2013\\Projects\\ConsoleApplication6\\Occultationis\\Occultationis\\NGC7209.jpg");

            Console.WriteLine("RA : " + calibrationData.ra);
            Console.WriteLine("DEC: " + calibrationData.dec);


            String progID = Camera.Choose("CCDSimulator.Camera");

            //CameraControl cc = new CameraControl();
            //cc.infoCamera( progID );

            Console.Read();
        }
Ejemplo n.º 2
0
        public CalibrationData getCalibration(string jobid)
        {
            StringBuilder builder = new StringBuilder();
            String        result  = "";

            CodeScales.Http.HttpClient httpClient = new CodeScales.Http.HttpClient();
            HttpGet      httpGet  = new HttpGet(new Uri(url + "/api/jobs/" + jobid + "/calibration"));
            HttpResponse response = httpClient.Execute(httpGet);
            HttpEntity   entity   = response.Entity;
            String       content  = EntityUtils.ToString(entity);

            if (debug)
            {
                Console.WriteLine("getCalibration gets: " + content);
            }
            String parity      = jsonGetValue(content, "parity");
            String orientation = jsonGetValue(content, "orientation");
            String pixscale    = jsonGetValue(content, "pixscale");
            String radius      = jsonGetValue(content, "radius");
            String radecimal   = jsonGetValue(content, "ra");
            String decdecimal  = jsonGetValue(content, "dec");

            CalibrationData res = new CalibrationData();

            res.parity      = Double.Parse(parity);
            res.orientation = Double.Parse(orientation);
            res.pixscale    = Double.Parse(pixscale);
            res.radius      = Double.Parse(radius);
            res.ra          = Double.Parse(radecimal);
            res.dec         = Double.Parse(decdecimal);

            return(res);
        }
Ejemplo n.º 3
0
        public CalibrationData imageCalibration(string nameFile)
        {
            String          sessionID       = loginPost();
            String          sidl            = postFile(sessionID, nameFile);
            CalibrationData calibrationData = waitResult(sidl);

            return(calibrationData);
        }
Ejemplo n.º 4
0
        public CalibrationData waitResult(string subID)
        {
            CalibrationData cal = new CalibrationData();

            for (int i = 0; i < howManyTimes; i++)
            {
                System.Threading.Thread.Sleep(waitingTime);
                jobids     = getJobids(subID);
                jobstaties = getJobStaties();
                Console.Write(".");
                Boolean b = testResult();
                if (b)
                {
                    break;
                }
            }

            for (int i = 0; i < jobids.Length; i++)
            {
                cal = getCalibration(jobids[i]);
            }
            return(cal);
        }