HARPgroup / HARParchive

This repo houses HARP code development items, resources, and intermediate work products.
1 stars 0 forks source link

Land Model Post-Processing Workflow Summary #342

Open juliabruneau opened 2 years ago

juliabruneau commented 2 years ago

The Complete Data Harvesting and Post-Processing Workflow with Examples

From issues: #261 and #280 _Example land segment: A51019 , scenario: hsp2_2022, and landuse: for._

Use:

Use:

Output in VAHydro:

juliabruneau commented 1 year ago

Update on data harvesting:

Use:


Batch scripts that run the Rscripts on an entire basin:

_Example basin: OR1_7700_7980, and scenario: hsp2_2022._

Arguments for both batch scripts:

1. Land Segment Data Harvesting

Use:

Use:


Batch scripts for data harvesting and analyzing river segments can be found in issue: #312 Script to Export river h5s

rburghol commented 1 year ago

Hey @juliabruneau -- the hard drive was finally filling up, so I finally responded and made the change to where the h5 files get stored after a model run. So, that means that the data harvesting scripts need to look in a slightly different file path:

juliabruneau commented 1 year ago

Hey @juliabruneau -- the hard drive was finally filling up, so I finally responded and made the change to where the h5 files get stored after a model run. So, that means that the data harvesting scripts need to look in a slightly different file path:

  • New location: /media/model/p532/out/land/h5/[land use]/[scenario]/
  • Ex: /media/model/p532/out/land/h5/hyo/hsp2_2022/

I used the already working batch_harvest.bat script to check that the new path works & received this error:

Error in H5Fopen(h5_file_path) :
  HDF5. File accessibility. Unable to open file.
Execution halted
pwater csv created

Permission issue?

rburghol commented 1 year ago

That looks like a path issue, I don't think you ned to be able to write to the h5 in order to read it, but I will check that for sure. Can you give me the full command with paths, etc?

juliabruneau commented 1 year ago

This is what I used:

juliasb@deq2:/opt/model/p53/p532c-sova$ bash ~/HARParchive/HARP-2022-Summer/AutomatedScripts/batch_harvest.bat hsp2_2022 OR1_7700_7980
rburghol commented 1 year ago

I've tried to reset the permiossions uin case they weren't already done (even tho I did them yesterday). No luck.

Here are some observations:

rburghol commented 1 year ago

@juliabruneau - I just verified that I can run the following commands manually from your tree (i.e. using your permissions), and they both work.

So, there must be:

FYI I added: suppressPackageStartupMessages() around all the library calls so now the output is waaaaay more sane to try to debug. Now, it should be apparent if there are some that are bad, but some that complete OK.

juliabruneau commented 1 year ago

Batch Script to Harvest Land Segment CSVs

This is the updated batch script: batch_harvest_land.bat, which generates iwater and pwater files and inputs them in their respective directories:

Use: bash ~/HARParchive/HARP-2022-Summer/AutomatedScripts/batch_harvest_land.bat hsp2_2022 OR1_7700_7980 in directory: /opt/model/p53/p532c-sova

The iwater.csv's in their folder:

juliasb@deq2:/media/model/p532/out/land/hsp2_2022/iwater$ ls -l
total 220220
-rw-rw-r-- 1 juliasb allmodelers 22031839 Jul 29 10:33 afoA51011_iwater.csv
-rw-rw-r-- 1 juliasb allmodelers 22650664 Jul 29 10:41 afoA51037_iwater.csv
-rw-rw-r-- 1 juliasb allmodelers 22031839 Jul 29 10:34 cfoA51011_iwater.csv
-rw-rw-r-- 1 juliasb allmodelers 22650664 Jul 29 10:42 cfoA51037_iwater.csv
-rw-rw-r-- 1 juliasb allmodelers 22513393 Jul 29 10:34 cidA51011_iwater.csv
-rw-rw-r-- 1 juliasb allmodelers 22861417 Jul 29 10:42 cidA51037_iwater.csv
-rw-rw-r-- 1 juliasb allmodelers 22513393 Jul 29 10:38 nidA51011_iwater.csv
-rw-rw-r-- 1 juliasb allmodelers 22861417 Jul 29 10:45 nidA51037_iwater.csv
-rw-rw-r-- 1 juliasb allmodelers 22513393 Jul 29 10:40 ridA51011_iwater.csv
-rw-rw-r-- 1 juliasb allmodelers 22861417 Jul 29 10:47 ridA51037_iwater.csv

The new batch script to harvest river segment files is in issue #312 .

glenncampagna commented 1 year ago

Summary of Use for batch harvesting and pwater analysis scripts

batch_harvest_land.bat From directory: /opt/model/p53/p532c-sova Use: batch_harvest_land.bat [scenario] [river seg] Example: bash ~/HARParchive/HARP-2022-Summer/AutomatedScripts/batch_harvest_land.bat hsp2_2022 OR1_7700_7980 Calls: detect_data_source.R, export_hsp_h5.R Output: pwater and iwater csv files located at /media/model/p532/out/land/hsp2_2022/(pwater or iwater)

batch_harvest_river.bat From directory: /opt/model/p53/p532c-sova Use: batch_harvest_river.bat [scenario] [river seg] Example: bash ~/HARParchive/HARP-2022-Summer/AutomatedScripts/batch_harvest_river.bat hsp2_2022 OR1_7700_7980 Calls: export_hsp_h5.R Output: hydr csv file located at /media/model/p532/out/river/hsp2_2022/hydr

batch_analysis_pwater.bat From directory: /opt/model/p53/p532c-sova Use: batch_analysis_pwater.bat [scenario] [river seg] Example: bash ~/HARParchive/HARP-2022-Summer/AutomatedScripts/batch_analysis_pwater.bat hsp2_2022 OR1_7700_7980 Calls: hsp_pwater.R , hsp_pwater_stats.R Output: groundwater figures and 90-day low flow metrics exported to VAhydro (1 of 2 land sets for example river seg:) http://deq1.bse.vt.edu/d.dh/om-model-info/6828216