import pathlib


def make_icon_nwcsaf_filename(base, t, fs):
    """Generate filename for ICON data for NWCSAF

    According to the NWCSAF Interface Control Document
    <NWC/CDOP3/GEO/AEMET/SW/ICD/1> §4.3

    Args:

        base (str or Pathlib.Path):
            Path relative to which the files are generated

        t (pandas.Timestamp):
            Time for which to generate filename.

        fs: int
            Forecast timestep.
    """

    fn = t.strftime(f"S_NWC_NWP_%Y-%m-%dT%H:%M:%SZ_{fs:>03d}.grib")
    return pathlib.Path(base) / "import" / "NWP_data" / fn