Exemple #1
0
        static void Main(string[] args)
        {
            Dictionary<string, Accumulator> vals = new Dictionary<string, Accumulator>();

              Model m = new Model(args[0]);

              JupiterXL JXL = new JupiterXL(args[1]);
              JXL.ReadWells(true, false);
              JXL.ReadInLithology();

              foreach (var geo in JXL.LITHSAMP)
              {
            if (!geo.IsROCKSYMBOLNull() && !geo.IsBOTTOMNull() && !geo.IsTOPNull() && geo.ROCKSYMBOL.Trim() != "")
            {
              var Boring = JXL.BOREHOLE.FindByBOREHOLENO(geo.BOREHOLENO);

              if (Boring != null && !Boring.IsXUTMNull() && !Boring.IsYUTMNull())
              {
            int Column = m.GridInfo.GetColumnIndex(Boring.XUTM);
            int row = m.GridInfo.GetRowIndex(Boring.YUTM);
            if (row >= 0 & Column >= 0)
            {
              int Layer = m.GridInfo.GetLayer(Column, row, m.GridInfo.SurfaceTopography.Data[row, Column] - (geo.TOP + geo.BOTTOM) / 2);
              if (Layer >= 0)
              {
                Accumulator Ledningsevner;
                if (!vals.TryGetValue(geo.ROCKSYMBOL, out Ledningsevner))
                {
                  Ledningsevner = new Accumulator();
                  vals.Add(geo.ROCKSYMBOL, Ledningsevner);
                }
                Ledningsevner.Add(Math.Log10(m.Processed.HorizontalConductivity.Data[row, Column, Layer]));
              }

            }
              }
            }
              }//End of loop

              Accumulator all = new Accumulator();
              for (int lay = 0; lay < m.GridInfo.NumberOfLayers; lay++)
            for (int row = 0; row < m.GridInfo.NumberOfRows; row++)
              for (int col = 0; col < m.GridInfo.NumberOfColumns; col++)
            if (m.GridInfo.ModelDomainAndGrid.Data[row, col] == 1)
              all.Add(Math.Log10(m.Processed.HorizontalConductivity.Data[row, col, lay]));

              vals.Add("All", all);

              using (StreamWriter sw = new StreamWriter(@"F:\temp\out.txt", false, Encoding.Default))
              {
            sw.WriteLine("Rocksymbol\tNoOfEntries\tMean\tVariance\tStandard Deviation");
            foreach (KeyValuePair<string, Accumulator> KVP in vals.OrderByDescending((acc) => acc.Value.Count))
            {
              sw.WriteLine(KVP.Key + "\t" + KVP.Value.Count + "\t" + KVP.Value.Mean + "\t" + KVP.Value.Variance + "\t" + KVP.Value.Sigma);
            }
              }
              JXL.Dispose();
        }
    public void MemoryTest()
    {
      JupiterXL JXL = new JupiterXL(@"..\..\..\mcribe.mdb");
      JXL.ReadWells(true, false);

      int k= JXL.BOREHOLE.Count;
      JXL = null; 
      
      
    }
    public void DobbletFillTest()
    {
      JupiterXL JXL = new JupiterXL(@"..\..\..\TestData\AlbertslundPcJupiter.mdb");
      JXL.ReadWells(true, false);

      Assert.IsTrue(JXL.BOREHOLE.First().IsUSENull());

      JXL.ReadWells(false, false);
      Assert.IsFalse(JXL.BOREHOLE.First().IsUSENull());
    }
Exemple #4
0
        private void FillPlantDataIntoDataRow(NovanaTables.IndvindingerRow CurrentRow, JupiterXL.DRWPLANTRow anlaeg, Plant P, DateTime StartDate, DateTime EndDate)
        {
            CurrentRow.PLANTID = anlaeg.PLANTID;
              CurrentRow.PLANTNAME = anlaeg.PLANTNAME;

              //Get additional data about the plant from the dataset
              CurrentRow.NYKOMNR = anlaeg.MUNICIPALITYNO2007;
              CurrentRow.KOMNR = anlaeg.MUNICIPALITYNO;
              CurrentRow.ATYP = anlaeg.PLANTTYPE;
              CurrentRow.ANR = anlaeg.SERIALNO;
              CurrentRow.UNR = anlaeg.SUBNO;
              CurrentRow.ANTUNDERA = P.SubPlants.Count;

              if (anlaeg.IsXUTMNull())
            CurrentRow.ANLUTMX = 0;
              else
            CurrentRow.ANLUTMX = anlaeg.XUTM;

              if (anlaeg.IsYUTMNull())
            CurrentRow.ANLUTMY = 0;
              else
            CurrentRow.ANLUTMY = anlaeg.YUTM;

              CurrentRow.VIRKTYP = anlaeg.COMPANYTYPE;
              CurrentRow.ACTIVE = anlaeg.ACTIVE;

              if (!anlaeg.IsSUPPLANTNull())
            CurrentRow.OVERANL = anlaeg.SUPPLANT;

              var SelectecExtrations = P.Extractions.Where(var => var.Time >= StartDate && var.Time <= EndDate);
              var ActualValue = SelectecExtrations.FirstOrDefault(var => var.Time.Year == EndDate.Year);

              if (P.Extractions.Count > 0)
              {
            if (SelectecExtrations.Count() > 0)
            {
              CurrentRow.MEANINDV = SelectecExtrations.Average(var => var.Value);
              if (ActualValue != null)
            CurrentRow.AKTUELIND = ActualValue.Value;
              else
            CurrentRow.AKTUELIND = 0;
            }
              }
              CurrentRow.ANTINT_A = P.PumpingIntakes.Count;
              CurrentRow.ANTBOR_A = P.PumpingWells.Count;
        }
Exemple #5
0
 /// <summary>
 /// Put the observation in the well
 /// </summary>
 /// <param name="CurrentWell"></param>
 /// <param name="WatLev"></param>
 private void FillInWaterLevel(IIntake CurrentIntake, JupiterXL.WATLEVELRow WatLev)
 {
     if (!WatLev.IsTIMEOFMEASNull())
     if (!WatLev.IsWATLEVMSLNull())
       CurrentIntake.Observations.Add(new ObservationEntry(WatLev.TIMEOFMEAS, WatLev.WATLEVMSL));
     else if (!WatLev.IsWATLEVGRSUNull())
     CurrentIntake.Observations.Add(new ObservationEntry(WatLev.TIMEOFMEAS, CurrentIntake.well.Terrain - WatLev.WATLEVGRSU));
 }
Exemple #6
0
 public Reader(string DataBaseFile)
 {
     JXL = new JupiterXL(DataBaseFile);
 }