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

Add support for land cover data #73

Merged
merged 18 commits into from
Apr 4, 2023
Merged

Add support for land cover data #73

merged 18 commits into from
Apr 4, 2023

Conversation

BSchilperoort
Copy link
Contributor

@BSchilperoort BSchilperoort commented Mar 21, 2023

This PR adds support for the CCI land cover dataset.

The following have been added:

  • Download script
  • Notebook to open and read some data from the netCDF file
  • Land cover translation table
  • Read routine, with support for time-dependent land cover
  • Checks & tests

I decided to remove the dem and canopy height text files, as those have been integrated into the package (as compressed txt files).

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@BSchilperoort BSchilperoort marked this pull request as ready for review March 28, 2023 07:47
Comment on lines +98 to +106
return {
"LCCS_landcover": np.array(
[landcover_lookup_table[_id] for _id in lccs_id.to_numpy()]
),
"IGBP_veg_long": np.array(
[igbp_lookup_table[_id] for _id in lccs_id.to_numpy()]
),
}

Copy link
Member

Choose a reason for hiding this comment

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

Since LCCS_landcover is unused in the code, can this function only returns IGBP_veg_long as a np.array()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, I thought it would be good to keep it in for now, also based on the discussion in EcoExtreML/STEMMUS_SCOPE#138.
It's easier than having to dive into the code again later, to then add it in.

It would also be nice (in general) if these land cover data could be in the output netCDF, for provenance sake.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, when the converter is implemented, it can be added as attrs there. Also, it should be added to the doc as mentioned in #78.

timestep,
)
data["IGBP_veg_long"] = landcover_data["IGBP_veg_long"][0]
data["LCCS_landcover"] = landcover_data["LCCS_landcover"][0]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
data["LCCS_landcover"] = landcover_data["LCCS_landcover"][0]

Copy link
Member

Choose a reason for hiding this comment

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

Because the code doesn't use it.

time_range,
timestep,
)
data["IGBP_veg_long"] = landcover_data["IGBP_veg_long"][0]
Copy link
Member

Choose a reason for hiding this comment

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

Let's get landcover_data["IGBP_veg_long"] as a np.array instead of a dictionary. See my comment above.

@@ -0,0 +1,24 @@
"lccs_class","IGBP_STEMMUS_SCOPE"
Copy link
Member

Choose a reason for hiding this comment

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

We should explain how this file is generated. I suggest adding a section "Dataset" to the documentation and explaining all datasets there. This can be done in another item. see issue #78

Copy link
Member

@SarahAlidoost SarahAlidoost left a comment

Choose a reason for hiding this comment

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

@BSchilperoort thanks. it looks very good. The run was successful. Just some minor comments

@SarahAlidoost SarahAlidoost mentioned this pull request Apr 3, 2023
3 tasks
@sonarcloud
Copy link

sonarcloud bot commented Apr 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

98.4% 98.4% Coverage
0.0% 0.0% Duplication

@BSchilperoort BSchilperoort merged commit a5be424 into main Apr 4, 2023
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.

2 participants