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

Added support for lake, blowing snow, and flexible lai/fcanopy/albedo to grid_params.py #40

Merged

Conversation

tbohn
Copy link
Contributor

@tbohn tbohn commented Feb 13, 2016

Modified grid_params.py to account for:

  1. optional extra columns in soil_param file
  2. optional extra fcanopy in veg_lib file
  3. optional blowing_snow params in veg_param file
  4. optional lai, fcanopy, albedo in veg_param file
  5. optional lake_param file
  6. reading of veg_lib comment field
  7. conditional creation of bare soil class, only if not already present

This closes #38.
This does not completely address issues #29, #31, and #34. It addresses converting these from ascii to netcdf, but not netcdf to ascii.

1. optional extra columns in soil_param file
2. optional extra fcanopy in veg_lib file
3. optional blowing_snow params in veg_param file
4. optional lai, fcanopy, albedo in veg_param file
5. optional lake_param file
6. reading of veg_lib comment field
7. conditional creation of bare soil class, only if not already present
# option values
FROM_DEFAULT = 0
FROM_VEGLIB = 1
FROM_VEGPARAM = 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Python string comparison is pretty trivial (if x == 'FROM_DEFAULT'). I'd rather just compare the strings rather than alias to ints.

veg_dict['fcanopy'] = fcan[:cell, :, :]

if vegparam_albedo and alb_src == FROM_VEGPARAM:
veg_dict['albedo'] = albedo[:cell, :, :]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see earlier comments on string comparison

@jhamman
Copy link
Member

jhamman commented Feb 16, 2016

Lot's of little comments @tbohn - Thanks for pulling this together. Give me a ping once you've had a chance to go through them.

@tbohn
Copy link
Contributor Author

tbohn commented Feb 18, 2016

OK, pushed and built.

@tbohn
Copy link
Contributor Author

tbohn commented Feb 18, 2016

Hold on a sec, I accidentally committed a "print" statement that I had inserted for debugging purposes.

lines[row] = lines[row].strip()
line = lines[row].strip('\n').split(' ')
lai[cell, vind, :] = np.array(line).astype(float)
print(line)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove debugging print statement

@jhamman
Copy link
Member

jhamman commented Feb 18, 2016

Okay, let me know when its ready for review/merge.

@tbohn
Copy link
Contributor Author

tbohn commented Feb 18, 2016

OK, this is ready for merge. I perused the Landscape code quality report for the first time - very interesting.

jhamman pushed a commit that referenced this pull request Feb 19, 2016
…w_veghist

Added support for lake, blowing snow, and flexible lai/fcanopy/albedo to grid_params.py
@jhamman jhamman merged commit a268595 into UW-Hydro:master Feb 19, 2016
@tbohn tbohn deleted the feature/add_support_for_lake_blosnow_veghist branch July 13, 2017 03:18
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

Successfully merging this pull request may close these issues.

Read veg_lib veg class descriptions dynamically
2 participants