예제 #1
0
 /// <summary>
 /// Constructor of the class.
 /// </summary>
 /// <param name="srf">
 /// init surface;</param>
 /// <param name="phIntLineGrid">
 /// grid of photosphere spectra with lines;</param>
 /// <param name="spIntLineGrid">
 /// grid of spot spectra with lines;</param>
 /// <param name="phIntContGrid">
 /// grid of photosphere spectra without lines;</param>
 /// <param name="spIntContGrid">
 /// grid of spot spectra without lines;</param>
 /// <param name="masMu">
 /// array of mu values (mu = cos(gamma), where gamma --- angle between 
 /// normal to the surface and line of sight);</param>
 /// <param name="masLambda">
 /// array of values of wavelengths for witch model spectra was calculated;</param>
 /// <param name="obsSpec">
 /// array of observed spectra;</param>
 /// <param name="masObsPhase">
 /// array of values of phases for witch spectra was observed;</param>
 /// <param name="masObsLambda">
 /// array of values of wavelengths for witch spectra was observed;</param>
 public DoppImager(Surface srf, 
     double[][] phIntLineGrid,  
     double[][] spIntLineGrid,
     double[][] phIntContGrid,
     double[][] spIntContGrid,
     double[] masMu,
     double[] masLambda,
     double[][] obsSpec,
     double[] masObsPhase,
     double[][] masObsLambda,
     string xscale)
 {
     this.srf = srf;
     this.phIntLineGrid = phIntLineGrid;
     this.spIntLineGrid = spIntLineGrid;
     this.phIntContGrid = phIntContGrid;
     this.spIntContGrid = spIntContGrid;
     this.masMu = masMu;
     this.masLambda = masLambda;
     this.obsSpec = obsSpec;
     this.masObsPhase = masObsPhase;
     this.masObsLambda = masObsLambda;
     this.calcSpec = new double[obsSpec.Length][];
     for (int i = 0; i < obsSpec.Length; i++) this.calcSpec[i] = new double[obsSpec[i].Length];
     this.immac_profs = new double[obsSpec.Length][];
     for (int i = 0; i < obsSpec.Length; i++) this.immac_profs[i] = new double[obsSpec[i].Length];
     this.calcSrf = new TSurface(this.srf.GetN(), this.srf.GetM(), this.srf.GetInc(), 0.0);
     this.xscale = xscale;
 }
예제 #2
0
파일: Program.cs 프로젝트: arneb89/RECONS
        static void Main(string[] args)
        {
            StreamWriter sw = new StreamWriter("out.main");

            Init ini = new Init("RECONS.conf");

            int    n      = ini.NLat;
            int    m      = ini.NLong;
            double inc    = ini.Inc;
            double vsini  = ini.VSinI;
            double regpar = ini.RegPar;
            string xscale = ini.XScale;

            phases = ini.Phases;

            Console.WriteLine(" N = {0}", n);
            sw.WriteLine(" N = {0}", n);
            Console.WriteLine(" M = {0}", m);
            sw.WriteLine(" M = {0}", m);
            Console.WriteLine(" Inc = {0}", Math.Round(inc * 180.0 / Math.PI, 3));
            sw.WriteLine(" Inc = {0}", Math.Round(inc * 180.0 / Math.PI, 3));
            Console.WriteLine(" VSin(i) = {0:0.000}", vsini);
            sw.WriteLine(" VSin(i) = {0:0.000}", vsini);
            Console.WriteLine(" RegPar = {0:0.000E000}", regpar);
            sw.WriteLine(" RegPar = {0:0.000E000}", regpar);

            Surface srf = new Surface(n, m, inc);

            LoadSpectra(ini.SpecFiles);

            TSurface tsrf;

            SpectrGrid spectrumGrid = new SpectrGrid(ini.GridFile);

            double[][] phIntLineGrid = spectrumGrid.IntenLineGrid[0];
            double[][] phIntContGrid = spectrumGrid.IntenContGrid[0];
            double[][] spIntLineGrid = spectrumGrid.IntenLineGrid[1];
            double[][] spIntContGrid = spectrumGrid.IntenContGrid[1];

            RescaleObs(ini.PseConts);

            DoppImager di = new DoppImager(srf, phIntLineGrid, spIntLineGrid, phIntContGrid, spIntContGrid,
                                           spectrumGrid.Mu,
                                           spectrumGrid.Lambda,
                                           obsSpectrums,
                                           ini.Phases,
                                           obsLambda,
                                           xscale);

            di.DoppImGo(vsini, regpar, ini.ContCor);

            srfDopp      = di.RestoredSurface;
            modSpectrums = di.ModelSpectrumGrid;
            immac_profs  = di.ImmacProfs;
            SaveModelSpectra(ini.OutFile);
            SaveMap(ini.OutFile);
            LatDistrib(ini.OutFile);

            double ff = FFTotal();

            Console.WriteLine(" FF = {0:0.000E000}", ff);
            sw.WriteLine(" FF = {0:0.000E000}", ff);
            sw.Close();
        }