\setlength{\topmargin}{17mm} \setlength{\oddsidemargin}{27mm} \setlength{\evensidemargin}{20mm}

\pagestyle{fancyplain} \lhead{\begin{picture}(5,5) \put(4,4){\includegraphics[width=90mm]{imarpe_logo_5.png}} \end{picture}} \renewcommand{\headrulewidth}{0.5pt} \renewcommand{\headrule}{\hbox to\headwidth{\color{gray}\leaders\hrule height \headrulewidth\hfill}}

knitr::opts_chunk$set(echo = TRUE)

# param
xlabNames = ""
Nlas = 1

out.semana  = imarpe:::estima_semana(inicio.temp = inicio_temp, fin.temp = fin_temp)
labelSEMANA = imarpe:::rangeWeek(data = out.semana, semana = "semana", fecha = "diasTemporada")


# space
space.perfil = -5
space = (0:(length(unique(out_report$fishing_points$semana))-1))*space.perfil


fishing_points00 = out_report$fishing_points
for(i in 1:length(unique(fishing_points00$semana))){
  fishing_points00[fishing_points00$semana == rev(sort(unique(fishing_points00$semana)))[i],"Lon"] = fishing_points00[fishing_points00$semana == rev(sort(unique(fishing_points00$semana)))[i],"Lon"] + space[i]
}

x = fishing_points00$Lon
y = fishing_points00$Lat

require(MASS)
ker = kde2d(fishing_points00$Lon, fishing_points00$Lat, n = 2000, h = 0.3) # el h optimo es 0.3
vmin = min(ker$z[ker$z != 0]) # identifico el valor minimo 
vmax = max(ker$z[ker$z != 0]) # identifico el valor maximo

# ker$z corresponde al valor de z
ker$z = (ker$z - vmin)/(vmax-vmin) 
ker$z[ker$z < 0.001] <- NA
# hotspots
require(fields)
coor = contourLines(ker,levels = 0.4)
col = designer.colors(n = 64, col = c("blue","cyan", "green4", "green","yellow","orange","red" ,"black","black"))
wf = -84 + space[length(space)]

\vspace{-3mm} \footnotesize \textit{Año 1, N° 002 \hspace{90mm} Lunes, 11 de setiembre, 2017} \vspace{-3mm}

\section{\small I. Esfuerzo y CPUE}

par(mfrow = c(4,2), mar = c(2,5,1,1), oma = c(0,0,0,0))


## duracion del viaje
plot(out_report$effort_ind$semana, out_report$effort_ind$Dur.viaje, 
     ylim = c(0, max(out_report$effort_ind$Dur.viaje)*1.4), 
     pch = 16, type = "o", 
     xlab = "Semanas", ylab = "Duración de viaje (horas)",
     axes = F, col = 4)
box()
axis(1, at = out_report$effort_ind$semana, labels = labelSEMANA, cex.axis = 0.8)
axis(2)
segments(out_report$effort_ind$semana,out_report$effort_ind$Dur.viaje + out_report$sdt_effort_ind$Dur.viaje, 
         out_report$effort_ind$semana,out_report$effort_ind$Dur.viaje - out_report$sdt_effort_ind$Dur.viaje, col = 4)

lines(out_report$effort_indmad$semana, out_report$effort_indmad$Dur.viaje, type = "o", pch = 16, col = 2)
segments(out_report$effort_indmad$semana,out_report$effort_indmad$Dur.viaje + out_report$sdt_effort_ind$Dur.viaje, 
         out_report$effort_indmad$semana,out_report$effort_indmad$Dur.viaje - out_report$sdt_effort_ind$Dur.viaje, col = 2)
legend("topleft", legend = c("Ind Acero", "Ind Madera"), col = c(4,2), lty = 1,pch = 16, bty = "n")
legend("bottomlef", legend = "a)", bty = "n")


## numero de calas
plot(out_report$effort_ind$semana, out_report$effort_ind$Num.Calas, 
     ylim = c(0, max(out_report$effort_ind$Num.Calas)*1.4), 
     pch = 16, type = "o", 
     xlab = "Semanas", ylab = "Número de lances",
     axes = F, col = 4)
box()
axis(1, at = out_report$effort_ind$semana, labels = labelSEMANA, cex.axis = 0.8)
axis(2)
segments(out_report$effort_ind$semana,out_report$effort_ind$Num.Calas + out_report$sdt_effort_ind$Num.Calas, 
         out_report$effort_ind$semana,out_report$effort_ind$Num.Calas - out_report$sdt_effort_ind$Num.Calas, col = 4)

lines(out_report$effort_indmad$semana, out_report$effort_indmad$Num.Calas, type = "o", pch = 16, col = 2)
segments(out_report$effort_indmad$semana,out_report$effort_indmad$Num.Calas + out_report$sdt_effort_ind$Num.Calas, 
         out_report$effort_indmad$semana,out_report$effort_indmad$Num.Calas - out_report$sdt_effort_ind$Num.Calas, col = 2)
legend("topleft", legend = c("Ind Acero", "Ind Madera"), col = c(4,2), lty = 1,pch = 16, bty = "n")
legend("bottomlef", legend = "b)", bty = "n")


## cpue Dv
plot(out_report$effort_ind$semana, out_report$effort_ind$cpueDv, 
     ylim = c(0, max(out_report$effort_ind$cpueDv)*1.4), 
     pch = 16, type = "o", 
     xlab = "Semanas", ylab = "CPUE (ton/horas de viaje)",
     axes = F, col = 4)
box()
axis(1, at = out_report$effort_ind$semana, labels = labelSEMANA, cex.axis = 0.8)
axis(2)
segments(out_report$effort_ind$semana,out_report$effort_ind$cpueDv + out_report$sdt_effort_ind$cpueDv, 
         out_report$effort_ind$semana,out_report$effort_ind$cpueDv - out_report$sdt_effort_ind$cpueDv, col = 4)

lines(out_report$effort_indmad$semana, out_report$effort_indmad$cpueDv, type = "o", pch = 16, col = 2)
segments(out_report$effort_indmad$semana,out_report$effort_indmad$cpueDv + out_report$sdt_effort_indmad$cpueDv, 
         out_report$effort_indmad$semana,out_report$effort_indmad$cpueDv - out_report$sdt_effort_indmad$cpueDv, col = 2)
legend("topleft", legend = c("Ind Acero", "Ind Madera"), col = c(4,2), lty = 1,pch = 16, bty = "n")
legend("bottomlef", legend = "c)", bty = "n")


## cpue Ncala
plot(out_report$effort_ind$semana, out_report$effort_ind$cpueNcala, 
     ylim = c(0, max(out_report$effort_ind$cpueNcala)*1.4), 
     pch = 16, type = "o", 
     xlab = "Semanas", ylab = "CPUE (ton/N° lances)",
     axes = F, col = 4)
box()
axis(1, at = out_report$effort_ind$semana, labels = labelSEMANA, cex.axis = 0.8)
axis(2)
segments(out_report$effort_ind$semana,out_report$effort_ind$cpueNcala + out_report$sdt_effort_ind$cpueNcala, 
         out_report$effort_ind$semana,out_report$effort_ind$cpueNcala - out_report$sdt_effort_ind$cpueNcala, col = 4)

lines(out_report$effort_indmad$semana, out_report$effort_indmad$cpueNcala, type = "o", pch = 16, col = 2)
segments(out_report$effort_indmad$semana,out_report$effort_indmad$cpueNcala + out_report$sdt_effort_indmad$cpueNcala, 
         out_report$effort_indmad$semana,out_report$effort_indmad$cpueNcala - out_report$sdt_effort_indmad$cpueNcala, col = 2)
legend("topleft", legend = c("Ind Acero", "Ind Madera"), col = c(4,2), lty = 1,pch = 16, bty = "n")
legend("bottomlef", legend = "d)", bty = "n")


# area cubierta por la flota
plot(out_report$spatial_indicators_ind$semana, out_report$spatial_indicators_ind$area_pesca,
     ylim = c(0, max(out_report$spatial_indicators_ind$area_pesca)*1.4),
     pch = 16, type = "o",
     xlab = xlabNames, ylab = expression(paste("Área cubierta por la flota", " ",(mn^2))),
     axes = F, col = 4)
box()
axis(1, at = out_report$spatial_indicators_ind$semana, labels = labelSEMANA, cex.axis = 0.8, las = Nlas)
axis(2, las = 2)
legend("bottomlef", legend = "e)", bty = "n")
lines(out_report$spatial_indicators_indmad$semana, out_report$spatial_indicators_indmad$area_pesca, type = "o", pch = 16, col = 2)
legend("topleft", legend = c("Ind Acero", "Ind Madera"), col = c(4,2), lty = 1,pch = 16, bty = "n")


# distancia a costa media
plot(out_report$spatial_indicators_ind$semana, out_report$spatial_indicators_ind$dc_mean,
     ylim = c(0, max(out_report$spatial_indicators_ind$dc_mean)*1.4),
     pch = 16, type = "o",
     xlab = xlabNames, ylab = "Distancia costa media (mn)",
     axes = F, col = 4)
box()
axis(1, at = out_report$spatial_indicators_ind$semana, labels = labelSEMANA, cex.axis = 0.8, las = Nlas)
axis(2, las = 2)
segments(out_report$spatial_indicators_ind$semana,out_report$spatial_indicators_ind$dc_mean - (out_report$spatial_indicators_ind$dc_mean - out_report$spatial_indicators_ind$dc_lower),
         out_report$spatial_indicators_ind$semana, out_report$spatial_indicators_ind$dc_mean + out_report$spatial_indicators_ind$dc_upper - out_report$spatial_indicators_ind$dc_mean, col = 4)
legend("bottomlef", legend = "f)", bty = "n")

lines(out_report$spatial_indicators_indmad$semana, out_report$spatial_indicators_indmad$dc_mean, type = "o", pch = 16, col = 2)
legend("topleft", legend = c("Ind Acero", "Ind Madera"), col = c(4,2), lty = 1,pch = 16, bty = "n")
segments(out_report$spatial_indicators_indmad$semana,out_report$spatial_indicators_indmad$dc_mean - (out_report$spatial_indicators_indmad$dc_mean - out_report$spatial_indicators_indmad$dc_lower),
         out_report$spatial_indicators_indmad$semana, out_report$spatial_indicators_indmad$dc_mean + out_report$spatial_indicators_indmad$dc_upper - out_report$spatial_indicators_indmad$dc_mean, col = 2)


# latitud media
plot(out_report$spatial_indicators_ind$semana, out_report$spatial_indicators_ind$Lat_mean,
     ylim = c(-16, -3),
     pch = 16, type = "o",
     xlab = xlabNames, ylab = "Latitud media (°S)",
     axes = F, col = 4)
box()
axis(1, at = out_report$spatial_indicators_ind$semana, labels = labelSEMANA, cex.axis = 0.8, las = Nlas)
axis(2, las = 2)
legend("bottomlef", legend = "g)", bty = "n")
lines(out_report$spatial_indicators_indmad$semana, out_report$spatial_indicators_indmad$Lat_mean, type = "o", pch = 16, col = 2)
legend("topleft", legend = c("Ind Acero", "Ind Madera"), col = c(4,2), lty = 1,pch = 16, bty = "n")


# indice de agregacion
plot(out_report$spatial_indicators_ind$semana, out_report$spatial_indicators_ind$Igini,
     pch = 16, type = "o", ylim = c(0.2, 1),
     xlab = xlabNames, ylab = "Indice de agregación",
     axes = F, col = 4)

box()
axis(1, at = out_report$spatial_indicators_ind$semana, labels = labelSEMANA, cex.axis = 0.8, las = Nlas)
axis(2, las = 2)
legend("bottomlef", legend = "h)", bty = "n")
lines(out_report$spatial_indicators_indmad$semana, out_report$spatial_indicators_indmad$Igini, type = "o", pch = 16, col = 2)
legend("topleft", legend = c("Ind Acero", "Ind Madera"), col = c(4,2), lty = 1,pch = 16, bty = "n")

\normalsize Figura 1. a) Duración del viaje, b) Número de lances, c) CPUE (captura/horas de viaje), d) CPUE (captura/número de lances), e) Área cubierta por la flota, f) Distancia costa media, g) Latidud media, h) Índice de agregación.

\newpage

\section{\small I. Áreas de pesca}

layout(matrix(1:3, nrow = 3), heights = c(1,0.1,1))

       par(mar=c(0.5,5,0.5,0))

      image(ker,  xlim = c(wf, -70), ylim = c(-21, -3), axes=FALSE, col = col)
      imarpe:::.mapa.peru.simple(xlim = c(wf, -70), add = TRUE, labelsxy = F, axis4L = F,perfil = TRUE)
      title("") # Areas de pesca

      for(i in 1:length(space)){
        lines(linePeru$lon + space[i], linePeru$lat, col = "gray40")
        text(x = -72 + space[i], y = -19, labels = rev(labelSEMANA)[i], cex = 0.6)
      }

      require(geoR)
      legend.krige(x.leg = c(wf + 3 ,wf + 3.5),y.leg = c(-20.0,-14.5), scale.vals = c(0.2,0.5,0.8), cex = 0.6,
                   values = 0:1, vertical = T, col = col)
      text(x = wf + 2.9, y = -14, labels = "Densidad", cex = 0.6, font = 2)
      legend("topleft", legend = "a)", bty = "n", cex = 0.6)

       #

       par(mar=c(0.5,5,0,0))

       image(ker,  xlim = c(wf, -70), ylim = c(-21, -20), axes=FALSE, col = col)
       for(i in 1:length(space)){
         lines(linePeru$lon + space[i], linePeru$lat, col = "gray40")
         text(x = -72 + space[i], y = -20.5, labels = rev(zonas_cerradas)[i], cex = 0.6)
       }
       mtext(2, text = "N° zonas \n cerradas", las = 2, cex = 0.6)
       box()

      par(mar=c(0.5,5,0.5,0))
      # map hotspots
      imarpe:::.mapa.peru(xlim = c(wf, -70), labelsxy = F, axis4L = F,perfil = TRUE)
      for(i in 1:length(space)){
        lines(linePeru$lon + space[i], linePeru$lat, col = "gray40")
        text(x = -72 + space[i], y = -19, labels = rev(labelSEMANA)[i], cex = 0.6)
      }
      title("") # Area hotspot (densidad > 40%)

      points(x, y, pch = ".", co = "gray", cex = 1)

      for(i in 1:length(coor)){
        polygon(coor[[i]],col = "cyan",lty = 1, lwd = 1, border = "cyan")
      }

      # for(i in 1:length(coor)){
      #   points(mean(coor[[i]]$x),mean(coor[[i]]$y),col="red", pch = 16, cex = 0.5, bg = "black")
      # }

      legend("bottomleft", c("Hotspot (densidad > 40%)","Puntos de pesca"), 
             pch = c(19,16),  
             col = c("skyblue","gray"), bty = "n", cex = 0.6)
      legend("topleft", legend = "b)", bty = "n", cex = 0.6)

\centering{\normalsize Figura 2. a) Áreas de pesca, b) Áreas de pesca de mayor densidad (Hostpot).}

\fbox{\begin{minipage}{47em} El presente reporte se puede reproducir citando: Reporte semanal de la Pesquería Industrial del Stock Norte-Centro de anchoveta (Temporada 2016-I) [online]. Callao, Instituto del Mar del Per\'u, Año 1 N° 2, \textit{Lunes, 11 de setiembre de 2017}. \end{minipage}}



imarpe/imarpe documentation built on Aug. 8, 2020, 8:40 p.m.