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

Units for false_easting and false_northing get converted to km #1375

Open
1 task done
iteubner opened this issue Aug 9, 2024 · 1 comment
Open
1 task done

Units for false_easting and false_northing get converted to km #1375

iteubner opened this issue Aug 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@iteubner
Copy link

iteubner commented Aug 9, 2024

Versions impacted by the bug

We are using the latest release of thredds-docker (version 5.5), based on this commit, I assume it is version 5.6.0 or 5.6.1-SNAPSHOT. I was not able to identify the version in the container.

What went wrong?

Using thredds-docker, when subsetting a netcdf that has non-zero false_easting and false_norting and units m (https://epsg.io/3416), e.g. NetcdfSubset in catalog, the units for false_easting and false_northing get converted to km. But the projection_{x|y}_coordinates (and specifications in the esri_pe_string for the data variables) are still in m.

Definition of projection and projection coordinates in the original file:

char lambert_conformal_conic;
  :semi_major_axis = 6378137.0; // double
  :latitude_of_projection_origin = 47.5; // double
  :inverse_flattening = 298.257222101; // double
  :longitude_of_central_meridian = 13.3333333333333; // double
  :standard_parallel = 49.0, 46.0; // double
  :false_northing = 400000.0; // double
  :grid_mapping_name = "lambert_conformal_conic";
  :semi_minor_axis = 6356752.31414036; // double
  :false_easting = 400000.0; // double

double x(x=585);
  :units = "m";
  :long_name = "x coordinate of projection";
  :standard_name = "projection_x_coordinate";
  :axis = "X";

double y(y=314);
  :long_name = "y coordinate of projection";
  :standard_name = "projection_y_coordinate";
  :axis = "Y";
  :units = "m";

Values after subsetting (with projection coordinates added again for completeness):

int lambert_conformal_conic;
  :grid_mapping_name = "lambert_conformal_conic";
  :latitude_of_projection_origin = 47.5; // double
  :longitude_of_central_meridian = 13.3333333333333; // double
  :standard_parallel = 49.0, 46.0; // double
  :false_easting = 400.0; // double
  :false_northing = 400.0; // double
  :units = "km";
  :semi_major_axis = 6378137.0; // double
  :inverse_flattening = 298.257222101; // double

double x(x=585);
  :units = "m";
  :long_name = "x coordinate of projection";
  :standard_name = "projection_x_coordinate";
  :axis = "X";

double y(y=314);
  :long_name = "y coordinate of projection";
  :standard_name = "projection_y_coordinate";
  :axis = "Y";
  :units = "m";

According to CF, as also stated here

* from CF: false_easting(false_northing):
* The value added to all abscissa(ordinate) values in the rectangular coordinates for a map projection.
* This value frequently is assigned to eliminate negative numbers.
* Expressed in the unit of the coordinate variable identified by the standard name projection_x_coordinate
* (projection_y_coordinate).
, the unit of false_easting and false_norting should be the same unit as the projection_{x|y}_coordinates. Them not beeing the same causes the data to be displayed horizontally shifted, when opening the data for example in Panoply.

Original:
image

Subsetted:
image

Could it be related to this line?

Relevant stack trace

No response

Relevant log messages

No response

If you have an example file that you can share, please attach it to this issue.

If so, may we include it in our test datasets to help ensure the bug does not return once fixed?
Note: the test datasets are publicly accessible without restriction.

Yes

Code of Conduct

  • I agree to follow the UCAR/Unidata Code of Conduct
@iteubner iteubner added the bug Something isn't working label Aug 9, 2024
@tdrwenski
Copy link
Contributor

Thanks for reporting this and including all the info. Definitely sounds like a bug, we will have a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants