Auckland Council scientists are developing a computer model that will predict, for beach swimmers, the amount of sewage pollution on any given day.
At present, under the council's summertime Safe Swim programme, water samples are collected once a week at some 60 beaches and analysed for their amounts of sewage-indicating bacteria.
If the enterococci levels are elevated, depending on how high they are, a second sample can be taken, or health warning signs can be erected.
The problem is that the laboratory testing can take several days to produce a result. Subsequent rain can overtake an earlier dry-weather sample by flushing pollution into streams and harbour water when the combined wastewater/stormwater system in parts of central Auckland overflows as intended.
A senior marine scientist at the council, Dr Jarrod Walker, is developing a computer model based on a council study of sewage pollution levels associated with stormwater outfalls at St Marys Bay and Viaduct Harbour and how they vary depending on preceding rainfall volumes and the tide.
"The model will be able to predict bacteria loads based on a bunch of environmental variables and one of the most important is rainfall," Dr Walker said.
Others were tide and currents, and wind direction and strength.
"We should be able to provide a 10-day forecast based on the rainfall and bacteria loads and as you get closer to whatever period you want to be swimming, three to four days' accuracy around rainfall data, it gets a lot better."
At the moment the main advice from the council and the Auckland Regional Public Health Service - aside from the Safe Swim testing - is not to swim within 48 hours of heavy rain.
"I want to get more clarity and reduce the uncertainty around whether 48 hours is the right time or whether it should be longer or shorter," Dr Walker said.
Within a year, he said, people would be able to look on the council website for a traffic-light warning system and predicted bacterial levels at most beaches in the council's Safe Swim programme, although the west coast beaches and some others could not be included.
The model, based on one used in Denmark, is going through its final validation tests.
Dr Walker expects it to be used for the ironman event in January whose swimming course ends at the Viaduct steps, a water body the study showed can be contaminated with sewage to highly hazardous levels after rain.