This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Antonio Olinto Avila-da-Silva, Instituto de Pesca, Brasil | |
# ver 2016-05-17 | |
# https://gist.github.com/aolinto/79e184f6c156c6ab21b3 | |
# script to process Aqua MODIS Sea Surface Temperature | |
# files downloaded from http://oceancolor.gsfc.nasa.gov/cgi/l3 | |
# Aqua MODIS Sea Surface temperature 11 u daytime Monthly 9 km SMI images | |
# all .L3m_MO_SST_sst_9km.nc files must be in the working directory | |
# the script will open each nc file, read date, lon, lat and sst data, | |
# then select data from specified area and write them into | |
# a single csv file named MODISA_sst.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lunar<- function(Y,M,D) { | |
# http://www.paulsadowski.com/wsh/moonphase.htm | |
# necessita do pacote cars | |
P2<-2*3.14159 | |
YY<-Y-as.integer((12-M)/10) | |
MM=M+9 | |
if (MM>=12) MM<-MM-12 | |
K1=as.integer(365.25*(YY+4712)) | |
K2=as.integer(30.6*MM+.5) | |
K3=as.integer(as.integer((YY/100)+49)*.75)-38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calculate distance in kilometers between two points | |
# https://conservationecology.wordpress.com/2013/06/30/distance-between-two-points-in-r/ | |
# PointDistance tool in the raster | |
earth.dist <- function (long1, lat1, long2, lat2) | |
{ | |
rad <- pi/180 | |
a1 <- lat1 * rad | |
a2 <- long1 * rad | |
b1 <- lat2 * rad | |
b2 <- long2 * rad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Biseau, A. 1998. Definition os a directed fishing effort in a mixed-species trawl fishery, and its impacts on stock | |
# assessments. Aquat. Living Resour. 11(3):119-136 | |
# each line refers to one trip where we have data on | |
# total catch per trip (Ti) and catch per species and trip (Tis) | |
# Antônio Olinto Ávila da Silva 13 de abril de 2016 | |
# simulation | |
Ti <- rnorm(1000,4000,300) | |
Tis <- Ti*runif(1000,0,1) | |
dat.biseau <- data.frame(Ti,Tis) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Antonio Olinto Avila-da-Silva, Instituto de Pesca, Brasil | |
# ver 2016-05-17 | |
# https://gist.github.com/aolinto/7d3f282c9fde96133daa4cdd4f1bbcab | |
# script to process Aqua MODIS Sea Surface Temperature | |
# files downloaded from http://oceancolor.gsfc.nasa.gov/cgi/l3 | |
# Aqua MODIS Clorophyll Concentration, OCI Algorithm Monthly 9 km SMI images | |
# all .L3m_MO_CHL_chlor_a_9km.nc files must be in the working directory | |
# the script will open each nc file, read date, lon, lat and chl data, | |
# then select data from specified area and write them into | |
# a single csv file named MODISA_chl.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Antonio Olinto Avila-da-Silva, Instituto de Pesca, Brasil | |
# https://gist.github.com/aolinto/b1414f94a0891d9e5d580d0436db8495 | |
# script to process Aqua MODIS Clorophyll Concentration data | |
# files downloaded from https://oceancolor.gsfc.nasa.gov/cgi/l3 | |
# Aqua MODIS Clorophyll Concentration, OCI Algorithm Monthly 4 km SMI images | |
# all .L3m_MO_CHL_chlor_a_4km.nc files must be in the working directory | |
# the script will open each nc file to read date information | |
# the script will also transform nc file to raster, read chl data | |
# for a given area, compute its statistics and write them into | |
# a single csv file named MODISA_chl.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Antonio Olinto Avila-da-Silva, Instituto de Pesca, Brasil | |
# https://gist.github.com/aolinto/3a0872e0fb61b7ca3e69d35d286ae26c | |
# script to process Aqua MODIS Sea Surface Temperature | |
# files downloaded from https://oceancolor.gsfc.nasa.gov/cgi/l3 | |
# Aqua MODIS Sea Surface temperature 11 µ daytime Monthly 4 km SMI images or | |
# Aqua MODIS Sea Surface temperature 11 µ nigthtime Monthly 4 km SMI images | |
# all .L3m_MO_SST_sst_4km.nc (daytime) or .L3m_MO_NST4_sst4_4km (nigthtime) | |
# files must be in the working directory | |
# the script will open each nc file to read date information | |
# the script will also transform nc file to raster, read sst data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ================================================================================ | |
# Cria grade de polígonos de tamanho personalizados e exporta como shapefile | |
# autor: Antônio Olinto Ávila da Silva | |
# criação: 2018-08-16 | |
# última edição: 2018-08-16 | |
# ================================================================================ | |
# ------------------------ | |
# prepara área de trabalho | |
# ------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ==================================================================== | |
# Selects fishing area squares per trip and calculates their centroids | |
# author: Antônio Olinto Ávila da Silva | |
# creation: 2018-08-24 | |
# last edition: 2018-08-24 | |
# ==================================================================== | |
# prepare workspace | |
library(rgdal) | |
library(rgeos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ==================================================================== | |
# Create isobaths and smoothed isobaths based on Etopo1 data | |
# https://maps.ngdc.noaa.gov/viewers/wcs-client/ | |
# author: Antônio Olinto Ávila da Silva | |
# creation: 2018-08-27 | |
# last edition: 2018-08-27 | |
# ==================================================================== | |
# workspace | |
# ---------- |
OlderNewer