<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_source_map(srcmap_file, names, logger=None):
 """Delete a map from a binned analysis source map file if it exists. Parameters srcmap_file : str Path to the source map file. names : list List of HDU keys of source maps to be deleted. """

    with fits.open(srcmap_file) as hdulist:
        hdunames = [hdu.name.upper() for hdu in hdulist]

        if not isinstance(names, list):
            names = [names]

        for name in names:
            if not name.upper() in hdunames:
                continue
            del hdulist[name.upper()]

        hdulist.writeto(srcmap_file, overwrite=True)