Skip to content

Elaborate on DPS output folder usage #455

@wildintellect

Description

@wildintellect

Turns out passing the output directory location to scripts is trickier than outlined in
https://docs.maap-project.org/en/latest/technical_tutorials/dps_tutorial/dps_tutorial_demo.html#Output-folder
Q: why do users need to make the output folder, if it's always needed as the correct location for outputs, should it exist already? @sujen1412

Specifically, this does not show how to pass the correct path to scripts, e.g. python and R.
Also is the case of R, R is very sensitive to working directories when importing other R files, so the script can't always be run from the default path DPS starts at, which means the output folder is actually up one level from where the script executes.

Here's an R example (We're going to need R examples on par with the python dps_tutorial)

#!/bin/bash
basedir=$( cd "$(dirname "$0")" ; pwd -P )

mkdir -p output
outdir=${PWD}/ouput

country=${1}

#Rscript global_process_part1_2024_MAAP_step123.R $country
cd ${basedir}
conda run --no-capture-output --name gedi_pa_env Rscript global_process_part3_2024_MAAP_step5.r $country outdir

Metadata

Metadata

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions