NOAA-GSL / pygraf

ADB's Python graphics package
MIT License
10 stars 11 forks source link

Control output image resolution via command line argument #156

Closed Jeff-Duda closed 2 years ago

Jeff-Duda commented 2 years ago

Modified create_graphics.py to add an optional command line argument 'img_res' to control the resolution of output images [i.e., the dpi entry in pyplot.savefig()].

Jeff-Duda commented 2 years ago

This is a great addition, Jeff! Do you have any information on how much extra time it takes to create the higher resolution image? It would be good to know if we get a request to generate higher res images in real-time.

I don't, Brian, but I could pretty easily run some timing tests to ascertain this information.

Brian-Jamison commented 2 years ago

If it's not too much trouble, please add that information in this conversation before merging so we have it as a reference. Thanks!

Jeff-Duda commented 2 years ago

Benchmarking results based on image resolution value are below. I ran a few sets for some values to observe the variability of timing.

default (no -r used, so dpi = 72 assumed) 170.2 s 170.3 s

-r 72 145.0 s

-r 150 177.6 s 169.2 s

-r 200 174.9 s 171.6 s

-r 300 174.9 s

-r 500 233.0 s 218.7 s 197.7 s

Total image sizes: 19M images_def (-r not specified in call) 52M images_r150 76M images_r200 126M images_r300 233M images_r500 19M images_r72

Brian-Jamison commented 2 years ago

Thanks for the size and timing info! That's helpful to know.

Great job!