## 4 Discussion and Conclusions
### Functions Based on the Species Distribution Models  
The functions \"Launch Butterflies forest specialist computation\", \"Launch Butterflies generalist computation\" and \"Launch Habitat directive species computation\" return the number of protected species and the species names per management unit. These estimations are based on the species distribution models (SDMs), which combine presence records of a species with spatially explicit environmental variables (e.g., temperature, precipitation, topography, geology, and land use) and control for the bias introduced by direct field observations. The SDM data are stored as shapefiles (200 m squared polygons) covering the entire territory of Luxembourg. For each grid cell of the study area, the SDM returns a habitat suitability index (values between 0 and 1), reflecting the probability of presence of the species. The determination of a threshold allows this index to be binarised afterwards in order to consider a species as present (index values above the threshold) or absent (below the threshold) in each grid cell. The threshold is computed using the maximum training sensitivity plus specificity logistic threshold [60]. The same threshold methodology is used for all the species.  
From the 85 butterfly species with national distribution knowledge, 14 species are highly related to forest biotopes, and 27 are generalist species related to forest biotopes, open woodlands, and grassland. Concerning the Habitat Directive protected species, SDMs were produced for all species that had enough field observations, but not all models passed the experts' evaluation and hence could not to be used for reporting under article 17 [27]. Overall, the SDMs for 19 species were included in the tool. The complete lists of species included in the three functions (\"Launch Butterflies forest specialist computation\", \"Launch Butterflies generalist computation\", and \"Launch Habitat directive species computation\") are presented in Table 14.  
Based on the SDM for the 60 selected species (14 forest-specialist butterflies, 27 generalist butterflies, and 19 Habitat Directive species), it was possible to generate 60 grid shapefiles containing presence-absence data for each species. These grids were aggregated into three shapefiles (one for each of the three functions). These three shapefiles used the same 200 m grid and contained for each cell the total number of species present (of forest-specialist butterflies, of generalist butterflies, and of Habitat Directive species) and their Latin name. The background aggregated SDMs are shown in Figure 14.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Forest-Specialist Butterflies** & **Generalist Butterflies** & **Habitat Directive Species** \\ \hline
14 species & 27 species & 19 species \\ \hline \hline \end{tabular}
\begin{tabular}{c} _Aglais io_ \\ _Aglais urticae_ \\ _Athalovirus carcinomas_ \\ _Aphanus hyperentatus_ \\ _Anschthia levanta_ \\ _Comenophyta pumpitius_ \\ _Aputura lia_ \\ _Isocratic iis_ \\ _Aputura iris_ \\ _Arygrism putida_ \\ _Bretisha degriue_ \\ _CalCaliprays nuli_ \\ _Cartocoxibus palamera_ \\ _Calicasting aychus_ \\ _Favornis queries_ \\  
In order to compute the species presence at the stand level, the three functions read the values in the cells overlapping with every stand and count the number of unique species. For example, imagine a stand that overlaps with three cells of the Habitat Directive aggregated SMD: cell 1 indicates the presence of three species _Dicranum viriide_, _Euplagia quadrupiruntaria_, and _Felis silvestris silvestris_; cell 2 indicates the presence of _Felis silvestris silvestris_ and _Helix pomatia_; and cell 3 indicates the presence of _Dicranum viriide_ and _Helix pomatia_. Therefore, the three cells overlapping with the stand contain four unique species: _Dicranum viriide_, _Euplagia quadrupiruntaria_, _Felis silvestris silvestris_, and _Helix pomatia_.