library(stockassessment)

oldwd<-setwd("data")

  cn<-read.ices("cn.dat")
  cw<-read.ices("cw.dat")
  dw<-read.ices("dw.dat")
  lw<-read.ices("lw.dat")
  mo<-read.ices("mo.dat")
  nm<-read.ices("nm.dat")
  pf<-read.ices("pf.dat")
  pm<-read.ices("pm.dat")
  sw<-read.ices("sw.dat")
  lf<-read.ices("lf.dat")
  surveys<-read.ices("survey.dat")
 names(surveys) <- c("Faroese_summer_survey","Faroese_spring_survey")

setwd(oldwd)


# inserted at wgdeep 2026 to downweight summer survey 2022,2023,2024 and spring survey 2022,2023,2024


Wsum <- matrix(1,nrow=30,ncol=9)
  Wsum[26:28,] <- 0.1
  attributes(surveys[["Faroese_summer_survey"]])$weight <- Wsum

  Wspr <- matrix(1,nrow=28,ncol=8)
  Wspr[25:27,] <- 0.1
  attributes(surveys[["Faroese_spring_survey"]])$weight <- Wspr



dat<-setup.sam.data(surveys=surveys,
                    residual.fleet=cn, 
                    prop.mature=mo, 
                    stock.mean.weight=sw, 
                    catch.mean.weight=cw, 
                    dis.mean.weight=dw, 
                    land.mean.weight=lw,
                    prop.f=pf, 
                    prop.m=pm, 
                    natural.mortality=nm, 
                    land.frac=lf)


save(dat, file="run/data.RData")
