OpasnetUtils/GIS

From Testiwiki
Jump to: navigation, search

Latitude of the emission site:

Longitude of the emission site:

Emission of PM2.5 (Mg/a or tons per year):

+ Show code

Description

This section contains a couple of general GIS related functions

Code

https://www.opasnet.org/svn/opasnet_utils/trunk/R/GIS%20methods.r

Kehitysehdotus

Tarkastellaan GIS.Exposure-funktion tätä osaa:

temp <- Population * Concentration.matrix
	
	if(dbug) cat(colnames(temp@output), "\n")
	
	#temp <- oapply(temp, cols = c("LObin", "LAbin"), sum)
	# Sum over spatial data.
	out <- tapply(
		temp@output$Result, 
		temp@output[,colnames(temp@output)[temp@marginal & !colnames(temp@output) %in% c("LObin", "LAbin")]], 
		sum,
		na.rm = TRUE
	)

Väestö * pitoisuus -sarakkeen lisäksi lasketaan

  • Ryhmittely quantiles kvantiiliin pitoisuuden perusteella. Oletusarvo on 1 eli nykyinen käytäntö. Jos quantiles = 0, ei tapplyta lainkaan vaan lasketaan alkuperäisillä riveillä. Joka tapauksessa kuitenkin LO ja LA poistetaan, koska paikkatietoa ei haluta antaa funktion läpi. --# : Koska kvantiilit voivat muiden indeksien takia olla hyvinkin erisuuruisia, voi kuitenkin olla järkevämpää laskea yksinkertaisesti cut:lla pilkottuja tasalevyisiä pitoisuusluokkia. --Jouni 10:46, 17 March 2013 (EET)
  • tapplytaan yllä olevalla ehdolla mutta lisättynä juuri luodulla kvantiilisarakkeella:
    • väestö (funktio: sum)
    • pitoisuus (funktio: mean)

Tällä tavalla saadaan output, jossa on tarvittavat tiedot HIA-laskentaan, esim. Exposures in Finland-tyyppiseen tauluun Exposure, ja väestön koko.

Functions

GIS.Exposure

Exposure computes exposure using a given concentration matrix and protected population data from Heande.

Inputs:

  • Concentration.matrix - A matrix containing spatially dependent concentratio data;
  • LO & LA - coordinates of the center of the concentration matrix;
  • distx & disty - maximum displacement from center of concentration matrix, assumed symmetrical, defaults to 10.5 km (Piltti source-receptor matrix);
  • resolution - resolution of concentration matrix, length of side of grid element which are assumed squares, defaults to 1 km (Piltti source-receptor matrix)

Output:

  • An ovariable containing result of Population * Concentration. Output and marginal slots are defined. Spatial information lost in summation (though there is an easy way around it).

GIS.Concentration.matrix

Computes a concentration matrix from given emission and coordinates, based on random sampling Piltti source-receptor matrix.

Inputs:

  • Emission - emission of substance in Mga^-1;
  • LO & LA - coordinates where emission occurs;
  • distx & disty - maximum displacement in kilometers from center of desired matrix, assumed symmetrical, defaults to 10.5 km (Piltti source-receptor matrix);
  • resolution - resolution of desired matrix (length in kilometers of side of grid element which are assumed squares), defaults to 1 km (Piltti source-receptor matrix);
  • N - number of iterations to be run

Output:

  • An ovariable containing spatially dependent concentration data. Output and marginal slots are defined.

See also

Calculations

This code creates a function that is used to plot a concentration field on a Google map.

+ Show code