It's entirely possible to analyze literal shit to estimate drug use patterns of whole cities. In fact, as I've reported before, wastewater drug analysis—sampling raw sewage for traces of illicit substances—is common practice in many parts of the world, including Europe, Australia, China, and parts of the United States.

But one of the biggest blind spots in this research is accurately estimating real time population size, which changes over the course of the year. (In statistics, this is known as censoring.) After all, the citizenry of a city like London can wildly vary due to factors like tourism and commuting—how do you know whose cocaine-soaked urine comes from whom?

A new study from the Norwegian Institute for Water Research suggests using mobile phone trace data to accurately peg population drug use—in other words, tracking cell phone pings and correlating them with how much MDMA is in the sewage.

"Cellular network connection counts can provide anonymized information on the movement patterns of individuals within a defined area," the researchers wrote in Environmental Science and Technology. "This provides for the possibility to normalize biomarker loads in each and every sample to an accurate (and dynamic) population figure corresponding to the period at which the wastewater sample was collected."

To test their theory, the researchers chose 13 narcotics, including amphetamine and Ritalin (methylphenidate), MDMA, methamphetamine, cocaine, and even carbamazepine, a pharmaceutical that treats schizophrenia. Last year, samples were collected from Vestfjorden Avløpsselskap, a wastewater treatment plant in Oslo, Norway that services about 600,000 people.

Samples were specifically taken in June and July because it would "result in significant changes in the catchment population," illustrating a worst-case scenario for this type of epidemiology. In Oslo, July is a major holiday month, which saw the average population drop 30.5 percent. After running glass tubes of raw sewage through a centrifuge, researchers used a technique called mass spectrometry to filter their target chemicals by atomic weight.

Combining this data with a passive network signaling monitoring system, they took more than 33 million measurements from Telenor, the large, mostly government-owned mobile provider servicing Scandinavia, Eastern Europe, and parts of Asia. These nonintrusive systems are typically used to monitor the quality of network connectivity.

"All that is needed for the system to measure the presence of a device is that a signal from the handset is captured by the cellular network," the researchers wrote. "Signaling data constitute an ideal source for population dynamic insights: it is a very reliable system, even used to enable messaging systems in case of emergencies." They found that MDMA and cocaine use went up on the weekend (big surprise) but amphetamine, meth, and prescription drug consumption stayed steady throughout the week.

However, even in a 24-hour period, the population in Oslo could change by more than 40 percent. If the researchers had been looking at a static population, which is the norm for this kind of research, they would have incorrectly assumed that prescription drug use dropped and illicit drug use remain unchanged during the holidays, despite a dip in population. Using cell phone signals gives a much more accurate picture of population drug use.

Combining wastewater drug analysis with cell phone data may raise even more privacy concerns, although the Norwegian researchers say that they hid info relating to "base stations providing a single count per geographical region" and that "data sets were stripped of all possible identifiers that could be used to trace back to the end user."