コード例 #1
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Writes an output map of biomass removed from each active site.
        /// </summary>
        /// <param name="timestep">
        /// Timestep to use in the map's name.
        /// </param>
        public void WriteMap(int timestep)
        {
            string path = BaseHarvest.MapNames.ReplaceTemplateVars(nameTemplate, timestep);
            using (IOutputRaster<BiomassPixel> map = CreateMap(path)) {
                BiomassPixel pixel = new BiomassPixel();
                foreach (Site site in Model.Core.Landscape.AllSites) {
                    pixel.Band0 = (ushort) (SiteVars.BiomassRemoved[site] / 10.0);
                    map.WritePixel(pixel);
                }
            }
        }
コード例 #2
0
 //---------------------------------------------------------------------
 private void WriteSpeciesMaps()
 {
     foreach (ISpecies species in selectedSpecies)
     {
         foreach(AgeClass ageclass in ageClasses[species.Name])
         {
             IOutputRaster<BiomassPixel> map = CreateMap(MakeSpeciesMapName(species.Name, ageclass.Name));
             using (map)
             {
                 BiomassPixel pixel = new BiomassPixel();
                 foreach (Site site in modelCore.Landscape.AllSites)
                 {
                     if (site.IsActive)
                         pixel.Band0 = (ushort)((float)Util.ComputeAgeClassBiomass(cohorts[site][species], ageclass) / 100.0);
                     else
                         pixel.Band0 = 0;
                     map.WritePixel(pixel);
                 }
             }
         }
     }
 }
コード例 #3
0
 //---------------------------------------------------------------------
 private void WriteMapForAllSpecies()
 {
     // Biomass map for all species
     IOutputRaster<BiomassPixel> map = CreateMap(MakeSpeciesMapName("TotalBiomass"));
     using (map) {
         BiomassPixel pixel = new BiomassPixel();
         foreach (Site site in modelCore.Landscape.AllSites) {
             if (site.IsActive)
                 pixel.Band0 = (ushort) ((float) Util.ComputeBiomass(cohorts[site]) / 100.0);
             else
                 pixel.Band0 = 0;
             map.WritePixel(pixel);
         }
     }
 }
コード例 #4
0
 //---------------------------------------------------------------------
 private void WritePoolMap(string         poolName,
     ISiteVar<Pool> poolSiteVar)
 {
     string path = PoolMapNames.ReplaceTemplateVars(poolMapNameTemplate,
                                                    poolName,
                                                    modelCore.CurrentTime);
     IOutputRaster<BiomassPixel> map = CreateMap(path);
     using (map) {
         BiomassPixel pixel = new BiomassPixel();
         foreach (Site site in modelCore.Landscape.AllSites) {
             if (site.IsActive)
                 pixel.Band0 = (ushort) ((float) poolSiteVar[site].Biomass / 100.0);
             else
                 pixel.Band0 = 0;
             map.WritePixel(pixel);
         }
     }
 }
コード例 #5
0
 //---------------------------------------------------------------------
 private void WriteSpeciesMaps()
 {
     foreach (ISpecies species in selectedSpecies) {
         IOutputRaster<BiomassPixel> map = CreateMap(MakeSpeciesMapName(species.Name));
         using (map) {
             BiomassPixel pixel = new BiomassPixel();
             foreach (Site site in Model.Core.Landscape.AllSites) {
                 if (site.IsActive)
                     pixel.Band0 = (ushort) Math.Round((double) ComputeSpeciesBiomass(cohorts[site][species]) / 100.0);
                 else
                     pixel.Band0 = 0;
                 map.WritePixel(pixel);
             }
         }
     }
 }
コード例 #6
0
        //---------------------------------------------------------------------
        private void WriteSpeciesMaps()
        {
            foreach (ISpecies species in selectedSpecies) {
                IOutputRaster<BiomassPixel> map = CreateMap(MakeSpeciesMapName(species.Name));
                using (map) {
                    BiomassPixel pixel = new BiomassPixel();
                    foreach (Site site in modelCore.Landscape.AllSites) {
                        if (site.IsActive)
                            pixel.Band0 = Util.ComputeBiomass(cohorts[site][species]);
                        else
                            pixel.Band0 = 0;
                        map.WritePixel(pixel);
                    }
                }
            }

            WriteMapForAllSpecies();
        }