Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BRDF correction in Hytools: BRF or HDRF at Zenith? #11

Open
serbinsh opened this issue Mar 21, 2022 · 4 comments
Open

BRDF correction in Hytools: BRF or HDRF at Zenith? #11

serbinsh opened this issue Mar 21, 2022 · 4 comments

Comments

@serbinsh
Copy link

We were talking today about using Hytools for an experiment for SBG. We are looking to re-run some algorithms using different simulated SBG by view azimuth/zenith directions. However, as we were chatting I realized I wasnt sure what BRDF (BRF) is considered in Hytools - is it hemispherical over all angles (integrated, albedo) or is it the reflectance for each pixel corrected to a Zenith (nadir)? I think that the RL correct does do an integration over all angles but is the output at zenith (or whatever angle you want each pixel corrected too) or assumed to be integrated reflectance (i.e. albedo, BRF)?

Also, is is possible to configure Hytools to accept a user-input view azimuth/zenith as the output directions for the BRDF correction? Perhaps by setting up the json config to overwrite the data dictionary to "force" a different output angle than nadir?

Thanks!

@serbinsh
Copy link
Author

Basically we are trying to determine if Hytools provides a correction BRDF kernal that then corrects each pixel to nadir (blue in the figure) or if Hytools outputs hemispherical reflecatance?

brdf-diagram

@adamchlus
Copy link
Member

adamchlus commented Mar 21, 2022

The BRDF correction done by Hytools corrects each pixel to nadir (see here), it should be possible without too much work to allow the user to input custom solar and viewing geometry angles to normalize to. Let me think about the best way to implement it and I'll get back to you on that.

@serbinsh
Copy link
Author

serbinsh commented Mar 23, 2022

Thanks @adamchlus FYI - commented to Ann about using the config file to set the angles. I would totally support that. In fact I made some updates to examples we had to use config files as inputs to setting up the json files and then running the corrections here: https://github.com/TESTgroup-BNL/hytools_helpers/tree/main/modex_examples

I could see adapting this or like I do, setting the angles in the global options config much like this example https://github.com/TESTgroup-BNL/hytools_helpers/blob/main/modex_examples/configs/hytools_run_setup_config.cfg

In there I made some mods so that we could set options there instead of the script, and use the script to generate the dictionary and json config that we use with the corrections script.

Perhaps under a similar [brdf] tag we place the angles? And the default can be zenith but allow for us to set them "on the fly" instead to run over different angles?

Also, this is just a quick and dirty mod to the functions to use the config files and allow passing of the json file for corrections. So not the cleaneast but it works! I also did it this way to be able to submit SLURM jobs like this https://github.com/TESTgroup-BNL/hytools_helpers/blob/main/batch/run_image_correct_batch.sh

it works like: python modex_examples/image_correct.py --config ${1}

and in the code

# get config file from script call
parser = argparse.ArgumentParser()
parser.add_argument('--config', help='path to configuration file to use',
    required=True)
args = parser.parse_args()
print(f'Config file: {args.config}')
config_file_in = args.config

@adamchlus
Copy link
Member

Thanks for the examples, I'll work on incorporating the ability to specify custom normalization angles next week when I address the no data value issue #10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants