Blockmean calculation in projected coordinates

Hello!

I have a question regarding the gridding (blockmean/blockmedian) workflow involving some projections. My data are somewhat regularly spaced in certain projections (think geostationary viewpoint, GOES-R series satellites), but not regular in lon/lat. Thus, when I aggregate and plot the data with blockmean+grdimage, they show some aliasing (? or artefacts) related to the spatial sampling, especially when going to smaller increments.

Now I have the blockmean and grdimage process working just fine, however I would like to ask blockmean to perform the “blocking” and averaging operations in the projected coordinates (in my case some -JG), rather than doing those operations in lon/lat and then performing the transformation upon calling grdimage. Is there a way to do that in GMT? I obviously had a look in the documentation, but from what I could gather, it reads like GMT performs all those calculations in lon/lat internally (when using the “-fp[unit]” argument), regardless of the input format or projection.

If that is not possible with blockmean, would there be a way of producing a grid file manually and then ask grdimage to treat the input correspondingly?

It looks like I’m having a similar issue as https://forum.generic-mapping-tools.org/t/can-grdimage-plot-grids-where-the-latitude-bands-are-unequally-spaced/68, however I would be totally fine with having a regular grid in projected coordinates.

Cheers all!

Sounds like you need to

  1. Use mapproject to convert your lon,lat,z data to x,z,y using the -JG projection.
  2. Run blockmean on that. Are you not gridding with surface or similar, just calling blockmean and writing a grid?
  3. Plot the resulting grid with a linar -Jx projection.

I am indeed plotting the grid directly, as there’s some meaning attached to grid cells etc. I will try and work the mapproject and linear -Jx projection into my workflow.

Thanks, really appreciate the help!