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

First draft of structural similarity class #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

moovida
Copy link
Member

@moovida moovida commented May 30, 2023

@diegomvd , creating this PR for the purpose of having a discussion board.

@Execute
public void process() throws Exception {

GridCoverage2D meanMap1 = windowMean(inMap1);
Copy link
Member Author

Choose a reason for hiding this comment

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

I see you tend to use gridcoverages and convert them to HMRasters once you need them.

It is best that you create an HMRaster at the very begin of the module for all the maps you need and then pass these to the various window* methods.

Then at the end of the modeul you build the output GridCoverages from the HMRaster as you need.

Choose a reason for hiding this comment

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

Hi @moovida thanks for the comments! I'll implement your suggestions later in the morning

Choose a reason for hiding this comment

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

I implemented the changes. Now all the window functions take HMRasters as arguments and also return HMRasters instead of a GridCoverage2D. I don't know if you see an issue with that. My thought process is that as soon a GridCoverage that will be certainly used is produced I convert it to HMRaster

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes @diegomvd , apart of the return from the methods, which I commented, it looks fine).
Your thought was ok, but the conversion between from GC to HMRaster has a cost. So it is best to use HMRaster (which has all the methods you need) and then convert ony at the end.

throw new ModelsRuntimeException(errorMessage, this);
}

return HMRaster.fromGridCoverage(outputRaster.buildCoverage());
Copy link
Member Author

Choose a reason for hiding this comment

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

Here just return outputRaster, it is a HMRaster already.

Choose a reason for hiding this comment

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

That's fixed in the new commit.

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