I have a NetCDF file (gridded data) with a landsea mask. I would like to determine, for the coastal grid-cells, what the orientation of the coastline is. I need to do this in order to calculate the angle between incident wind direction and the coastline at each coastal grid cell.

For example, if at a certain location the coastline is zonal (east to west) and the land is to the south, and the sea to the north, the orientation would be 0°:

enter image description here

If the coast is zonal but the position of land and ocean are inverted, the orientation of the coast would be 180°.

enter image description here

If the coast is 45° with the land to the south, the angle is 45°. With the land to the north, the orientation is 135°... you get the idea.

enter image description here enter image description here

Any suggestions on how to get this information from the landsea mask grid?

Thank you in advance.

  • 2
    $\begingroup$ Gridded data is orthogonal by definition, so you either have 0/180° or 90/270°. $\endgroup$ – Erik Jul 12 '19 at 7:35
  • $\begingroup$ There are sometimes curvilinear grids, like those with 3 poles or 2 poles and one over Greenland. $\endgroup$ – ouranos May 14 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.