Skip to content

Commit

Permalink
Download catageysa.dat from TAF database -> data, later moved to input
Browse files Browse the repository at this point in the history
  • Loading branch information
Arni Magnusson committed Sep 13, 2017
1 parent f1d668f commit 56f07a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions _raw/upload.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Upload raw data to TAF database

## Before: catageysa.dat (user dir)
## After: catageysa.dat (TAF database)

library(icesTAF)

owd <- setwd("d:/projects/ices-taf/ftp/nwwg/2015/had-iceg/raw")
upload("2015_had-iceg", "raw", "catageysa.dat")
setwd(owd)
10 changes: 5 additions & 5 deletions data.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
## Download and preprocess data, write TAF input tables
## Preprocess data, write TAF data tables

## Before: catageysa.dat (ftp)
## Before: catageysa.dat (TAF database)
## After: catageysa.dat, catage.csv, wcatch.csv, maturity.csv, wstock.csv,
## smb.csv, smh.csv (data)

library(icesTAF)
source("utilities.R")

ftp <- "https://raw.githubusercontent.com/ices-taf/ftp/master/nwwg/2015/had-iceg/"

mkdir("data")

url <- "http://taf.ices.local/taf/fs/2015_had-iceg/raw/"

## Download data
download.file(paste0(ftp,"raw/catageysa.dat"), "data/catageysa.dat", quiet=TRUE)
download.file(paste0(url,"catageysa.dat"), "data/catageysa.dat", quiet=TRUE)
txt <- readLines("data/catageysa.dat", encoding="latin1")

## Extract tables from original source
Expand Down
2 changes: 1 addition & 1 deletion input.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ library(icesTAF)
mkdir("input")

## Copy model input file to input directory
cp("data/catageysa.dat", "input")
cp("data/catageysa.dat", "input", move=TRUE)

0 comments on commit 56f07a1

Please sign in to comment.