Dan,
Flats are not going to help with light pollution gradients. Such gradients are typically dynamic and difficult to deal with. You’ll simply need to hone your image process skills to address these. I don’t like dealing with gradients and yet to hear of an imager that does. They are, unfortunately, a fact of imaging unless you’ve got some pristine dark skies available.
Not sure of your experience with flats, but what you’re trying to do is evenly illuminate the telescope aperture so it will fill the camera pixel well depths to around 20%-30% saturation. I can elaborate more on this if desired.
Now, I’d recommend starting off with a lightbox or t-shirt flats. I started with t-shirt flats which I found satisfactory for what I wanted to achieve, but have since moved to sky flats. Sky flats take a little more work, but with the right software it can simplify things. Firstly, when taking sky flats you need to point the telescope where there is minimum gradient visible. This immediately excludes anything low in the horizon. The ideal position is known as the solar circle which is near zenth, offset toward the anti solar horizon by 0 to 40 degrees. It is the best source of even illumination. This information is detailed from our good friends at NASA. I would recommend you and others considering sky flats download the PDF document from this link:
http://adswww.harvard.edu/cgi-bin/np...&nosetcookie=1
Once you’ve got the telescope pointing in the right area of the sky, the next challenge you face is the ever changing luminosity. At dawn, the sky is getting brighter and dusk, darker. Visually we don’t detect the changes quickly but a camera does. Now, if your camera exposure times are fixed you’ll have problems compensating for the varying brightness levels. Therefore you need to use software that will take an image, download it, analysis the background sky brightness. If the analysis indicates the sky hasn’t reached the saturation threshold you define, increase the exposure time until it does. Conversely decrease the exposure time if it’s over the saturation threshold. This is the main advantage of lightbox or t-shirt flats - the luminosity doesn’t change making it easier. I use a MaximDL plugin call Sky Flat Assistant -
http://winfij.homeip.net/maximdl/skyflats.html. There is plenty of other software around that can help you out with the changing luminosity should you choose to go the sky flat track. I’ve blinked both t-shirt flat and sky flat and found the latter gave me a better result, but this has solely been my own experience.
Now with all this background information out the way, to answer your original question, the best time to do sky flats. Typically when you’ve just hit civil twilight is a good starting point. You’ll quickly judge if its still too light or dark. If its too light, the shortest exposure time your camera is capable of will still deliver a saturation over your well depth threshold. If its too dark, you exposure times will be extremely long to reach the saturation limit. I don’t recommend going over 20 to 30 seconds. You can and people do it, but you’ll need to scale your dark frames accordingly.
One last think to throw into the mix, when taking sky flats you want the telescope to move in different directions ever so slightly. This will place stars that the exposure may capture on to different parts of the chip. When you combine the flat frames, the stars will be flagged as outlier pixels and removed. It doesn’t matter if the stars trail. You definitely don’t want stars in your flats! Again, software can assist you by move the telescope between or during exposures.
Happy to answer further questions you may have.