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

rounding all NDep to 2 dec

parent 0b249e54
......@@ -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 doren_20201207.pkl
\ No newline at end of file
python run_species.py $SLURM_ARRAY_TASK_ID 50 doren_20201208.pkl
\ No newline at end of file
......@@ -944,12 +944,14 @@ class Doren:
if not os.path.isdir(pg_dir):
os.mkdir(pg_dir)
out_cols = ['plot_obs_id', 'totN_kmol_ha_v', 'totN_kmol_ha_f', 'totN_kmol_ha_vf', 'totN_kmol_ha', 'soil_type_label', 'country_label', 'five_yearly_precip',
'five_yearly_temp', 'eunis_code', 'eunis_src', 'structuurtype', 'hooglaag']
out_cols = ['plot_obs_id', 'totN_kmol_ha_v', 'totN_kmol_ha_f', 'totN_kmol_ha_vf', 'totN_kmol_ha',
'soil_type_label', 'country_label', 'five_yearly_precip', 'five_yearly_temp', 'eunis_code',
'eunis_src', 'structuurtype', 'hooglaag']
for col in out_cols:
assert hasattr(self.eva, col), 'Cannot write due to missing column {}'.format(col)
out_df = self.eva.loc[:, out_cols]
out_df.round({'plot_obs_id': 0, 'totN_kmol_ha': 2, 'five_yearly_precip': 2, 'five_yearly_temp': 2, })\
out_df.round({'plot_obs_id': 0, 'totN_kmol_ha': 2, 'five_yearly_precip': 2, 'five_yearly_temp': 2,
'totN_kmol_ha_v': 2, 'totN_kmol_ha_f': 2, 'totN_kmol_ha_vf': 2})\
.to_csv(os.path.join(out_dir, '{}.csv'.format(pg_out_name)), sep=',', index=False, header=True)
self.report += 'Written plot covar output file: {0}'.format(os.path.join(pg_dir, pg_out_name))
......
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