"""When DEP expands, we have a problem that we have no close by precip files.

So lets ensure we have one file per 0.25 degree lat and lon, we can then use
these to fast-start newly expanded areas...
"""
from pyiem.dep import SOUTH, EAST, NORTH, WEST
import numpy as np
import os
import shutil

# We shall use this file, no mater what
SRC = "/i/0/cli/095x038/095.17x038.13.cli"
SCENARIO = 0

created = 0
for lon in np.arange(WEST, EAST, 0.05):
    for lat in np.arange(SOUTH, NORTH, 0.05):
        if (("%.2f" % (lon,)).endswith(".25") and
                ("%.2f" % (lat,)).endswith(".25")):
            mydir = "/i/%s/cli/%03.0fx%03.0f" % (SCENARIO, 0 - lon, lat)
            if not os.path.isdir(mydir):
                os.makedirs(mydir)
            fn = "%s/%06.2fx%06.2f.cli" % (mydir, 0 - lon, lat)
            if not os.path.isfile(fn):
                created += 1
                shutil.copyfile(SRC, fn)

print("We just created %s new files!" % (created,))

@@ -385,16 +385,53 @@
 IO = 0%0A%0A
+WANTS = %5B'.00', '.25', '.50', '.75'%5D%0A
 created 
@@ -549,32 +549,30 @@
  (lon,))
-.endswith(%22.25%22)
+%5B-3:%5D in WANTS
  and%0A   
@@ -605,24 +605,22 @@
 t,))
-.endswith(%22.25%22)
+%5B-3:%5D in WANTS
 ):%0A 

fix the logic with precip init