glmtools
glmtools copied to clipboard
Support more dx and dy resolution options
The dx or dy in the doc is 2km and the default value is 10km. I tested 20km and found the resolution is limited to 10 km.
This is caused by: https://github.com/deeplycloudy/glmtools/blob/b70484c79f12a3fdfcc8f5077ad7f37bf4caa594/examples/grid/make_GLM_grids.py#L137-L146
And that is related to the pre-defined goesr_resolutions in lmatools:
https://github.com/deeplycloudy/lmatools/blob/731a330494544bf80c7f6752bae67d8f35cb806a/lmatools/grid/fixed.py#L58-L66
So, if I need 20 km, then I have to add the support of 20km in lmatools first:
goesr_resolutions = {
'0.5km': 14e-6,
'1.0km': 28e-6,
'2.0km': 56e-6,
'4.0km': 112e-6,
'8.0km': 224e-6, # not technically in the spec, but SYMMETRY.
'10.0km': 280e-6,
'20.0km': 560e-6,
'100.0km': 2800e-6,
}
then, add 20 km to the .py script:
def nearest_resolution(args):
""" Uses args.dx to find the closest resolution specified by the
GOES-R PUG. Returns something like "10.0km" that can be used as the
resolution argument to get_GOESR_grid.
"""
goes_resln_options = np.asarray([0.5, 1.0, 2.0, 4.0, 8.0, 10.0, 20.0])