noaa-oar-arl / monet

The Model and ObservatioN Evaluation Toolkit (MONET)
https://monet-arl.readthedocs.io
Other
44 stars 20 forks source link

Adding optional counties to draw_map() #152

Closed blychs closed 1 week ago

blychs commented 1 week ago

Is your feature request related to a problem? Please describe. There is no specific problem, this is an enhancement. I wanted to add the capability to plot counties. I have already this coded in my fork and if you agree, I'd be happy to submit a PR

Describe the solution you'd like The easiest option would be to have the optional parameter in plots.mapgen.draw_map, which would now be

def draw_map(
    crs=None,
    natural_earth=False,
    coastlines=True,
    counties=False,
    states=False,
    countries=True,
    resolution="10m",
    extent=None,
    figsize=(10, 5),
    linewidth=0.25,
    return_fig=False,
    **kwargs
):

Describe alternatives you've considered I suggest simply adding something similar to states to draw_map, albeit

    if counties:
        counties = cfeature.NaturalEarthFeature(
            category='cultural',
            name='admin_2_counties',
            scale=resolution,
            facecolor='none',                                                                                                                                                                                                                                                    
            edgecolor='k',
            linewidth=linewidth,
            )  

Additional context This is needed to make useful plots when it comes to evaluations done by specific states, since it is hard to recognize the region in a map that only includes a specific state without counties. The solution seems simple enough and I can't think of any drawbacks. I have already tested this addition in my fork and it seems to be working just fine.

zmoon commented 1 week ago

@blychs sounds good, I agree it should be false by default.

blychs commented 1 week ago

Done, I'll close this as soon as the code gets reviewed and (hopefully) merged.