Open juliabruneau opened 2 years ago
detect_data_source.R
is added to the workflowUse:
Rscript ~/HARParchive/HARP-2022-Summer/AutomatedScripts/detect_data_source.R /opt/model/p53/p532c-sova/output/hspf/land/out/for/hsp2_2022/forA51019.h5 /opt/model/p53/p532c-sova/output/hspf/land/out/for/hsp2_2022/eos/forA51019_pwater.csv /RESULTS/PERLND_P001/PWATER
_pwater.csv
and /RESULTS/PERLND_P001/PWATER_iwater.csv
and /RESULTS/IMPLND_I001/IWATER_hydr.csv
and /RESULTS/RCHRES_R001/HYDR_Example basin: OR1_7700_7980, and scenario: hsp2_2022._
Arguments for both batch scripts:
1. Land Segment Data Harvesting
batch_harvest_land.bat
Use:
bash ~/HARParchive/HARP-2022-Summer/AutomatedScripts/batch_harvest_land.bat hsp2_2022 OR1_7700_7980
/opt/model/p53/p532c-sova
export_hsp_h5.R
and detect_data_source.R
$landuse$landseg_iwater.csv
or $landuse$landseg_pwater.csv
in their respectable file paths2. Pervious Land Segment Data Summary and Analysis
batch_analysis_pwater.bat
Use:
bash ~/HARParchive/HARP-2022-Summer/AutomatedScripts/batch_analysis_pwater.bat hsp2_2022 OR1_7700_7980
/opt/model/p53/p532c-sova
hsp_pwater.R
and hsp_pwater_stats.R
Batch scripts for data harvesting and analyzing river segments can be found in issue: #312 Script to Export river h5s
batch_harvest_river.bat
batch_analysis_hydr.bat
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:
/media/model/p532/out/land/h5/[land use]/[scenario]/
/media/model/p532/out/land/h5/hyo/hsp2_2022/
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?
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?
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
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:
h5_file_path
in batch_harvest.bat
, and that path seems OK, but I also saw this error coming from somewhere:
Error: no such file ":HJ5 file path: /media/model/p532/out/land/h5/cex/hsp2_2022/cexA51011.h5"
batch_harvest.bat
to use the new location info.@juliabruneau - I just verified that I can run the following commands manually from your tree (i.e. using your permissions), and they both work.
1
nano ~/test_pwater.csv
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.
This is the updated batch script: batch_harvest_land.bat
, which generates iwater and pwater files and inputs them in their respective directories:
/media/model/p532/out/land/hsp2_2022/iwater
/media/model/p532/out/land/hsp2_2022/pwater
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 .
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
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._
Rscript HARParchive/HARP-2022-Summer/AutomatedScripts/export_hsp_h5.R /opt/model/p53/p532c-sova/output/hspf/land/out/for/hsp2_2022/forA51019.h5 /opt/model/p53/p532c-sova/output/hspf/land/out/for/hsp2_2022/eos/forA51019_pwater.csv /RESULTS/PERLND_P001/PWATER/table
Output:
forA51019_pwater.csv
in/opt/model/p53/p532c-sova/output/hspf/land/out/for/hsp2_2022/eos
hsp_pwater.R
Use:
Rscript HARParchive/HARP-2022-Summer/AutomatedScripts/hsp_pwater.R A51019 hsp2_2022 for /opt/model/p53/p532c-sova/output/hspf/land/out/for/hsp2_2022/eos/forA51019_pwater.csv /media/model/p532/out/land/hsp2_2022/images
[x] Output in VAHydro:
fig.AGWS
fig.totalFlowOut
l90_Runit
l90_agwo_Runit
[x] 3. Further Analysis
Purpose: Further trend analysis is performed on active groundwater storage and 3 figures and several regression variables are exported to VAHydro
File name:
hsp_pwater_stats.R
Arguments: path to hsp_pwater_stats.R land_segment scenario_name landuse output_file_path image_file_path
Use:
Rscript HARParchive/HARP-2022-Summer/AutomatedScripts/hsp_pwater_stats.R A51019 hsp2_2022 for /opt/model/p53/p532csova/output/hspf/land/out/for/hsp2_2022/eos/forA51019_pwater.csv /media/model/p532/out/land/hsp2_2022/images
Output in VAHydro:
AGWS25perc
- containerfig.AGWS25perc
rsquared_25th
slope_25th
p_25th
AGWSmedian
- containerfig.AGWSmedian
rsquared_med
slope_med
p_med
fig.AGWSdecomp