Commit e5390cc5 authored by Roelofsen, Hans's avatar Roelofsen, Hans
Browse files

update to pkl source

parent 24010e2c
......@@ -16,7 +16,7 @@ cv_precp_dir = r'c:\Users\roelo008\OneDrive - WageningenUR\a_projects\DOREN\a_br
cv_precp_src = "EObs_v200e_rr_5yrmean"
cv_temp_dir = r'c:\Users\roelo008\OneDrive - WageningenUR\a_projects\DOREN\a_brondata\covariables\EObs\2_compiled'
cv_temp_src = "EObs_v200e_tg_5yrmean"
sp_req_src = r'c:\Users\roelo008\OneDrive - WageningenUR\a_projects\DOREN\z_scratch\soortenlijst.csv'
sp_req_src = r'c:\Users\roelo008\Wageningen University & Research\DOREN - General\2020-09-17 uniek soorten per habitat.xlsx'
doren = dc.Doren(header_src=param_header_src, sp_src=param_sp_src)
doren.initiate(sample=False)
......@@ -27,8 +27,7 @@ doren.add_posch(posch_src_dir=param_posch)
doren.add_covar(covar_dir=cv_soil_dir, covar_src=cv_soil_src, covar_name='soil_type', nominal=True)
doren.add_yearly_covar(covar_dir=cv_precp_dir, covar_src_basename=cv_precp_src, covar_name='5_yearly_precip')
doren.add_yearly_covar(covar_dir=cv_temp_dir, covar_src_basename=cv_temp_src, covar_name='5_yearly_temp')
doren.get_requested_species(xls=r'c:\Users\roelo008\Wageningen University & Research\DOREN - General\2020-09-17 uniek soorten per habitat.xlsx',
sheet='PGO-1', col='newsoort', simplify_names=False)
doren.get_requested_species(xls=sp_req_src, sheet='PGO-1', col='newsoort', simplify_names=False)
doren.write_stuff('species_list')
......
......@@ -20,4 +20,4 @@ echo $SLURM_ARRAY_TASK_ID
# Run
cd /home/WUR/roelo008/projs/doren_2019
python run_species.py $SLURM_ARRAY_TASK_ID 50
\ No newline at end of file
python run_species.py $SLURM_ARRAY_TASK_ID 50 doren_20200928.pkl
\ No newline at end of file
......@@ -3,6 +3,7 @@ Script for taking a pre-existing DOREN pkl object and processing a subset of its
Hans Roelofsen, 03 June 2020
"""
import os
import numpy as np
import argparse
import pickle
......@@ -10,6 +11,7 @@ import pickle
parser = argparse.ArgumentParser()
parser.add_argument('batch_nr', help='batch number')
parser.add_argument('n_batches', help='number of batches')
parser.add_argument('pkl', help='name of pkl source')
args = parser.parse_args()
......@@ -17,13 +19,11 @@ batch_nr = int(args.batch_nr)
n_batches = int(args.n_batches)
# Recover the Pickled doren object
pkl_src = './pkl_src/doren_20200907.pkl'
# pkl_src = r'c:\Users\roelo008\OneDrive - WageningenUR\a_projects\DOREN\b_compiled_data\a_pkl\doren_20200903.pkl'
pkl_src = os.path.join('./pkl_src/', args.pkl)
with open(pkl_src, 'rb') as handle:
doren = pickle.load(handle)
doren.base_out_dir = r'./c_out'
# doren.get_requested_species(src='./req_species/soortenlijst.csv')
# Determine subset of requested species to proces
sel = np.array_split(np.arange(0, len(doren.req_sp)), n_batches)[batch_nr].tolist()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment