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

HIMAN-329: Short circuit coordinate transformation logic #4

Merged
merged 2 commits into from
Mar 22, 2021

Conversation

mpartio
Copy link
Member

@mpartio mpartio commented Mar 11, 2021

Himan transforms coordinates between projections (with gdal) using latlon
as an intermediate representation. This introduces some very small numerical
inaccuracies, which eventually push some valid grid points outside the grid
in some circumstances.

Introduce a "bulk" transformation method where coordinate transformation is
done directly from source to target utilizing gdal methods. Implemented only
for regular grids.

Himan transforms coordinates between projections (with gdal) using latlon
as an intermediate representation. This introduces some very small numerical
inaccuracies, which eventually push some valid grid points outside the grid
in some circumstances.

Introduce a "bulk" transformation method where coordinate transformation is
done directly from source to target utilizing gdal methods. Implemented only
for regular grids.
@mpartio mpartio requested review from tackandr and vkuvaja March 11, 2021 05:17
@mpartio mpartio self-assigned this Mar 11, 2021
Comment on lines +220 to +224

/* Return grid point value (location) of a given target grid */
virtual std::vector<point> XY(const regular_grid& to) const;

/* Return latitude-longitude value for a given location index */
Copy link
Contributor

Choose a reason for hiding this comment

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

I personally wouldn't define a bunch of new functions for the bulk calculations but use the single point functions as unary operators in std:transform algorithm library function.

Copy link
Member Author

Choose a reason for hiding this comment

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

The bulk function is using a slightly different method to transform coordinates, hence it cannot be done the way you describe.

@tackandr
Copy link
Contributor

Is this the place to make general comments on the commit?

@mpartio
Copy link
Member Author

mpartio commented Mar 12, 2021

Is this the place to make general comments on the commit?

I don't know but why not :D

@tackandr
Copy link
Contributor

Is this the place to make general comments on the commit?

I don't know but why not :D

Just trying out the interface

@@ -80,6 +80,10 @@ void grid::UVRelativeToGrid(bool theUVRelativeToGrid)
{
itsUVRelativeToGrid = theUVRelativeToGrid;
}
std::vector<point> grid::GridPointsInProjectionSpace() const
{
throw runtime_error("grid::GridPointInProjectionSpace() called");
Copy link
Contributor

Choose a reason for hiding this comment

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

GridPointIn.. -> GridPointsIn..

@mpartio mpartio merged commit a64ba77 into development Mar 22, 2021
@mpartio mpartio deleted the HIMAN-329 branch March 22, 2021 10:14
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.

3 participants