Share this

Sunday, September 28, 2025

Scorpius at 30,000 Feet: A Smartphone Milky Way Adventure


Scorpius at 30,000 Feet: A Smartphone Milky Way Adventure


Somewhere over Kansas, cruising at 30,000 feet on a late-night United flight to Memphis, I peeked through the cabin glow and saw something I never expected: the Scorpius constellation sparkling beside a faint shimmer of the Milky Way core. 

My mind raced. Could I capture this on my phone? 

  • Pro mode—of course. 

  • ISO—crank it to 3200. 

  • Shutter—maybe 32 seconds? (What am I thinking!) 

Then reality struck. No tripod Minor turbulence. Bright cabin reflections. A recipe for streaks and smears!!! 

Still, I pressed the phone firmly against the window, shielding the sides with my jacket to block reflections. Click. 
A sudden bump—Stars all streaked out like modern art. 

Not giving up, I dialed the exposure down to 16 seconds to dodge the worst shakes. Phew! The next frame landed beautifully—Scorpius fully outlined and the Milky Way’s dusty heart faint but unmistakable. 

A few more cautious shots followed. My fellow passenger, politely bewildered by my excitement, smiled as I proudly shared the results. The streaky city lights far below and the bright cabin reflections only added context and a sense of reality to the cosmic scene, grounding the galaxy against the unmistakable evidence of flight. I just had to adjust the contrast settings a bit to bring out the features of the sky.

Like I say Smartphone astronomy can happen in the most unlikely settings—you just have to be ready for it. 

Exposure details 

  • Phone: Motorola Edge 2025 

  • Mode: Pro 

  • ISO: 3200 

  • Shutter: 16 s 

  • Flight: United Airlines, midair above Kansas 

 

 

Saturday, April 5, 2025

Optimal Windows for Actionable Glucose Monitoring

A CGM (Continuous Glucose Monitor) sensor monitors and reports glucose every few minutes. Typical sensors (worn under the skin) last about 2 weeks. A Lab based HbA1C test measures a snapshot of this average in a single test. Ideally they tend to be in the ballpark. 
Image source: Gen AI


Quick Recap

Glucose monitoring for clinical evaluation has come a long way since measuring one's 'fasting glucose'. This value provided a snapshot of your resting glucose levels early in the morning after allowing for overnight resumption to baseline levels. 

One also had the Oral Glucose Tolerance Test (OGTT), though this was a more detailed procedure - ~ 2hrs and many pokes in between to sample your blood. A graph plot of glucose levels in this time period showed how the body was responding to a controlled glucose challenge. 

These two tests were good for diagnosis and getting a picture of glucose homeostasis in an individual. Based on this healthcare professionals (HCPs) could decide on course of action to manage cases of glucose intolerance a.k.a diabetes (or even prediabetes).

Enter HbA1C test OR more simply A1C test. This test changed the paradigm of evaluation and management of diabetes in clinical settings. It provided a snapshot average of glucose levels in the body over three months. Useful for long-term glucose management. 

So why was this cool? No more asking a patient to arrive fasting at the lab. Also the levels gave a clear window into how the glucose homeostasis was over the three months. This could assist HCPs in providing more actionable suggestions in terms of managing lifestyle choices in patients e.g. specific foods, physical activities etc.

The principle behind the test was elegant and simple. Hemoglobin in the RBC cells in blood reacted with glucose at a constant rate to form a product that could be easily measured. Since this simple chemical reaction occurred in the body at a constant rate one could calibrate the glucose levels easily. Why 3 months? Remember RBCs in our body have a lifespan of about 120 days. So a test after another 120 days was enough to monitor the progress. 

Well! What if the lifespan of RBCs aren't ever the same? What if the RBCs of certain demographics are inherently different to reacting with glucose? What about cases of hemoglobinopathies?

The answer is yes to all of the above. So, though Hemoglobin A1c (HbA1c) has come to be regarded as the gold standard for assessing glycemic control in individuals with diabetes, it is not without its limitations. Regardless of the caveats the test continues to be useful and a mainstream approach to evaluation of glucose homeostasis in an individual. 

The Problem with Traditional A1C

One significant caveat is the demographic differences observed in HbA1c levels. For instance, research indicates that South Asians tend to have HbA1c levels that are approximately 0.5–0.7% higher than other populations for the same glucose exposure [1]. This discrepancy can lead to misinterpretations of glycemic control and potentially inappropriate clinical decisions.

Moreover, biological confounders such as variations in red cell turnover and the presence of hemoglobinopathies can affect HbA1c readings [2]. Conditions like anemia or sickle cell disease can alter the lifespan of erythrocytes, thereby impacting the accuracy of HbA1c measurements. These factors underscore the need for more reliable and individualized methods of monitoring glucose levels.

Given these limitations, the introduction of Continuous Glucose Monitoring (CGM) systems offers a promising alternative. CGM provides real-time data on glucose levels, capturing fluctuations that HbA1c might miss [3]. This leads us to the next section, where we explore the strengths of CGM data and its potential to revolutionize diabetes management.

Table: Comparison of HbA1c and CGM Metrics

MetricHbA1cCGM
Data PointsAverage over 2-3 months~25,920 data points in 90 days
Influencing FactorsRed cell turnover, hemoglobinopathiesReal-time glucose fluctuations
Demographic DifferencesHigher A1C in South AsiansIndividualized data

2. The Strength of CGM Data: Power of Numbers

Continuous Glucose Monitoring (CGM) systems have transformed diabetes management by providing a wealth of data that far surpasses traditional methods. Over a 90-day period, CGM devices can generate approximately 25,920 data points, offering a detailed and dynamic picture of glucose levels [4]. This abundance of data significantly reduces random error, averaging out the Mean Absolute Relative Difference (MARD) to around 8.3%.

The power of CGM lies in its ability to capture real-time glucose fluctuations, which HbA1c measurements might miss. Unlike HbA1c, which reflects an average over several months, CGM provides immediate insights into daily glucose patterns [5]. This real-time data is invaluable for making timely therapeutic adjustments and for understanding the impact of lifestyle changes on glucose levels.

Moreover, the CGM-derived Glucose Management Indicator (GMI) correlates well with HbA1c but avoids the biases linked to erythrocyte lifespan [6]. This makes GMI a more reliable indicator for individuals with conditions that affect red cell turnover or hemoglobinopathies. By providing a more accurate reflection of glucose control, CGM can help tailor treatment plans more effectively.

As we delve deeper into the capabilities of CGM, it's important to consider the limitations of simply accumulating more data. In the next section, we will explore why extending the monitoring period to six months may not necessarily yield better clinical outcomes and how shorter data windows can be more actionable.

Table: Strengths of CGM vs. HbA1c

FeatureHbA1cCGM
Data FrequencyEvery 2-3 monthsContinuous
Error ReductionSubject to random errorReduces random error (8.3% MARD)
CorrelationReflects average glucoseGMI correlates well with A1C

3. The Limits of "More Data"—Why 6 Months May Not Be Better

While the extensive data provided by Continuous Glucose Monitoring (CGM) systems is invaluable, there are diminishing returns when extending the monitoring period beyond 90 days. Although a longer duration might seem beneficial for capturing comprehensive glucose trends, it can actually obscure meaningful outliers and reduce the clinical relevance of the data [7].

One key issue with extending CGM data to 180 days is the potential for older data to dilute the impact of more recent glucose fluctuations. Therapeutic adjustments, such as insulin titration, require timely and accurate data to be effective [8]. Relying on older data can lead to less responsive and potentially suboptimal treatment decisions. For instance, a patient's glucose levels might have stabilized or worsened in the recent past, but this change could be masked by the inclusion of older data.

Behavioral coaching also benefits from shorter data windows. Immediate feedback loops are crucial for encouraging patients to make lifestyle changes and adhere to treatment plans [9]. Shorter monitoring periods, such as 14-30 days, provide actionable insights that can motivate patients and help healthcare providers make more precise adjustments.

However, longer-term trends are not without their value. They are useful for risk stratification and understanding the overall trajectory of a patient's glucose control [10]. Yet, the key is to balance the need for long-term data with the necessity for timely interventions. This leads us to the next section, where we will discuss the optimal data windows for different clinical use cases and how to tailor CGM data interpretation to maximize its utility.

Table: Impact of Data Window Length

Data WindowBenefitsDrawbacks
14-30 daysImmediate feedback, acute adjustmentsLimited long-term trends
90 daysAligns with A1C, comprehensive monitoringMay miss recent changes
180+ daysLong-term trends, risk stratificationObscures recent data, less responsive

4. Optimal Data Windows for Different Use Cases

Determining the optimal data window for Continuous Glucose Monitoring (CGM) is crucial for maximizing its clinical utility. Different use cases require different monitoring periods to ensure the data is actionable and relevant.

14-30 days: This shorter window is ideal for acute treatment adjustments, such as basal insulin titration. It provides immediate insights into the patient's current glucose levels, allowing for timely and precise therapeutic changes. Short-term data is also beneficial for behavioral coaching, as it offers quick feedback that can motivate patients and help healthcare providers make more precise adjustments.

90 days: Aligning with the traditional HbA1c measurement period, a 90-day window is best for clinical monitoring. It balances the need for comprehensive data with the necessity for timely interventions. This period smooths out random errors and provides a reliable average of glucose levels, making it suitable for routine check-ups and ongoing management of diabetes.

180+ days: Longer-term data windows are useful for observing trends and risk stratification. They help healthcare providers understand the overall trajectory of a patient's glucose control and identify patterns that might indicate future complications. However, while valuable for long-term planning, these extended periods are less effective for immediate therapeutic adjustments and can dull responsiveness to current conditions.

This approach ensures that the data is both relevant and actionable, enhancing the effectiveness of lifestyle adaptions while managing diabetes.

5. Concluding Thoughts

The journey through understanding temporal granularity in glucose monitoring highlights the importance of selecting the optimal data window for clinical actionability. Continuous Glucose Monitoring (CGM) systems offer a powerful alternative to traditional HbA1c measurements, providing real-time data that can significantly enhance diabetes management. However, the key to maximizing the utility of CGM lies in tailoring the data window to the specific clinical needs.

Take Home Messages:

  1. Recognize the Limitations of HbA1c: While HbA1c is a valuable tool, it has significant limitations due to demographic differences and biological confounders. CGM offers a more individualized and accurate reflection of glucose control.
  2. Leverage the Strength of CGM Data: The extensive data provided by CGM systems reduces random error and offers immediate insights into glucose fluctuations, making it a superior tool for real-time diabetes management.
  3. Balance Data Windows for Clinical Relevance: Shorter data windows (14-30 days) are ideal for acute treatment adjustments and behavioral coaching, while 90-day periods align well with traditional monitoring practices. Longer-term data (180+ days) is useful for risk stratification but less effective for immediate interventions.

Wednesday, October 23, 2024

Reconciling BGM and CGM Accuracy: Can the Twain Meet in Glucose Monitoring?

Have you ever wondered why your Continuous Glucose Monitor (CGM) and Blood Glucose Monitor (BGM) seem to give slightly different readings?

A Continuous Glucose Monitor (CGM patch) worn over the skin
A Continuous Glucose Monitor (CGM) patch worn over the skin 



If you’re living with diabetes or monitoring your blood glucose regularly, you’ve likely experienced this. You may be comparing the numbers from your CGM, a device that continuously tracks glucose levels, to those from a traditional fingerstick BGM, and notice that the values aren’t exactly the same. With their stated accuracy ranges, it may seem that neither can be dependable. Yet the real world readings look more closer. Assuming the provided ranges to be conservative can one work out more realistic ranges? Let's dig in some Math here.

The Problem: Why Do These Devices Disagree?

Both CGMs and BGMs have some level of error in their measurements. Manufacturers often provide accuracy percentages to help users understand this. For example, a CGM might claim to be accurate within 8.5%, while a BGM could have an accuracy rate of 15%. These percentages mean that the devices can be off by that much from the actual blood glucose level.

However, if you assume that one device is reading at the highest possible value of its error range and the other at the lowest, you might think the difference between the two readings could be huge. Yet, in real life, users often report that the numbers are closer than expected—sometimes differing by only 5%. So why is the real-world experience so much better than the theoretical extremes?

Let’s take a closer look with a bit of math.

The Math: Finding the Real Discrepancy

Manufacturers usually advertise the maximum error range, but in practice, these errors don’t always need to occur at their worst levels. Instead, the devices could perform more reliably, leading to smaller discrepancies.

Imagine you’re looking at a CGM with an 8.5% error and a BGM with a 15% error. When both devices are calibrated and used in real-world conditions, these error percentages give us a combined potential error for both devices. The key here is to understand how these errors interact.

I asked my friend who helped me out with the math a bit. Rather than just adding them up, we can use a technique from statistics called root mean square error (RMS). It helps us estimate the combined effect of these errors when they’re not always acting in the worst possible way. The formula is:

Ecombined = √{(ECGM)2 + (EBGM)2}

In other words it is the sum of the squares of the error percentages followed by taking the square root of that sum. Substituting in the values one approximately ends up with approx 17.25%

This means that, in theory, the maximum combined error could be as high as 17.25%. But remember, this is only the worst-case scenario.

Real-World Discrepancies: Why Do They Seem Lower?

In practice, you may notice that your readings from the CGM and BGM differ by far less than this combined error. Instead of seeing huge differences, you might see discrepancies of around 5%, which is a lot tighter than the 17% we just calculated.

To understand why this happens, let’s assume the real-world errors for both devices are smaller than the advertised extremes. If your CGM is performing better than expected, say with an effective error of 2.46%, and your BGM is similarly more accurate with an effective error of 4.34%, the observed discrepancy will shrink.

When these lower error rates are plugged into the same formula, the combined error becomes closer to what you actually observe—around 5%. This reflects the real-world behavior of the devices, where both are more precise during stable glucose periods, reducing the gap between their readings.

The Solution: What Can You Expect?

So, what’s the takeaway? While manufacturers provide maximum error ranges to be cautious, your real-world experience with these devices is usually more consistent. Rather than facing a 17% discrepancy, you’re likely to see much smaller differences, especially during stable glucose levels.

Knowing this can bring some peace of mind when using both a CGM and a BGM. If your readings are close—within 5%—that’s a sign that both devices are functioning well. And if you do see larger discrepancies, it’s a reminder that the devices operate within a known margin of error, and it’s not always cause for concern.

In Conclusion

Understanding the science and math behind blood glucose monitors can help us better interpret the data we see every day. So, whether your CGM and BGM readings are best friends or frenemies, what’s been your experience? Let’s see if your glucose monitors can agree more often than your favorite sitcom characters!

Sometimes, all it takes is a little math to make sense of it all!

Sample image of a Blood Glucose Meter. Image generated using OpenAI's DALL·E tool
Sample image of a Blood Glucose Meter. Image generated using OpenAI's DALL·E tool

Wednesday, February 14, 2024

Getting started with astrophotography on a budget

 

Ready for the Night skies and wonders it will unfold. Image credits: Self


Quite often I am asked, "How much does it cost to be in this hobby of astrophotography". The questions may vary in their tone and intent but they all finally come down to this particular point - COST. Another related one I often encounter is 'What is the best telescope?' to either get started with OR have one for a long time.


Learning about the the night skies visually is in fact an excellent way to get started. Call it Skywatching, Star hopping, or what you will, it is all about looking at the star constellations, identifying them, and recognizing the names attributed to them in local cultures, conventional astronomy, etc. I started with mine decades ago, when my Dad took me out to show the Saptarishi (Big Dipper), and Orion belt, watch the Grahanams (eclipses), create pin-hole cameras, DIY telescopes with lenses and tubes, explain the night skies, and sharing legends from the Puranas. All that involved $0 cost and lots of bonding time, something more precious than anything else.


For visual observations, a good pair of astronomy binoculars (10x50 to 20x80) or a small beginner telescope can reveal bright Messier objects, planets, and constellations. While a pair of binoculars can range anywhere between ($30 - $100) some decent beginner scopes can come for way less than one may think, somewhere in the range of $100-$200. These can include Newtonian reflectors compact Galilean type refractors or even some tabletop Dobsonians. There are even some Cassegrain reflector models that start in the sub $200 range though they tend to average higher. Once you start adding accessories like smartphone adapters, filters, and eyepieces, very soon you find yourself getting sucked into the black hole of this money-guzzling, yet amazing hobby.


If you ask an amateur hobbyist who has been in this area for a while, you will find that both of these questions are 'loaded', and come with a lot of 'it depends ...' 'well ...' 'but...' etc. Even a good salesperson in this field might probably start the same way. Yet for those wanting a number and a model, without all the crucial caveats, that number would be $5000 to even $10,000. That would include the scope, the tracker mount, and the imaging system a.k.a camera and accessories. 


Not included in this are the countless hours you spend watching all those amazing YouTube video tutorials online and countless groups on Social Media that selflessly share their nuggets of knowledge with you. Be careful sharing this new-found optimism :).Your friends and family might occasionally get a bit bored OR miffed when you start ghosting them at parties or running home errands.


Yes! Astrophotography can seem daunting when you hear such price tags of $5,000, or even more, for a basic starter kit. But don't let these numbers deter you! The hobby can be explored at many budget levels, depending on your goals. 


Getting started isn’t that costly BUT upgrading is!


Yet again, anyone can get started with astrophotography with just a point-and-click camera and a tripod. Even a smartphone has come a long way. Don’t be surprised to find mind-blowing images of the Milky Way OR Andromeda galaxy taken with just a smartphone and a tripod. If you are the one having that DSLR camera you haven’t touched in a while, it’s probably time to dust it off and grab your tripod. Get ready to do a bit more detailed imaging of some brighter objects like the Orion Nebula. Before you realize it, you are already knee-deep into astrophotography, probably even more. Objects like the mineral Moon, our Milky Way, Andromeda Galaxy, and Orion Nebula might soon be a part of your album! The results can sometimes surprise you, pleasantly of course, and will also allow you to learn techniques in image stacking, image pre-processing, and doing the final edits. There are many open-source software that present themselves with varying levels of learning curves. How one can go about doing this is a separate topic. So the big numbers in costs that I mentioned right at the outset can wait, while you can get started with gear that you probably have already..


Image: Image revealing the mineral features of the Moon. A simple DSLR on a tripod is enough to create this type of image. This is my image taken using an AT60mm ED refractor attached to my Canon DSLR camera. Image acquisition, processing, and final editing form the final part of this process. Published in SkyandTelescope


As for ‘which telescope is the best’ or ‘ideal’, such a question calls for a separate discussion that can even extend to a few sessions. However, remember that the main rule is that the cost of the scope itself forms only a part of the entire rig. It would be roughly 1/3rd to 1/4th of your budget. Today many good scopes can range anywhere between $500 to $2000. The same goes for the mounts for telescopes too. Remember that no astrophotography is complete without a good tracking mount. This setup allows you to track your celestial object as it makes its way through the night skies. Mounts can be of different types. Most basic ones are simple and are driven by a motor drive OR advanced ones that slew your set up right to the target and track it accurately. Costs typically range in between $200 - $1000. The latter are called GoTo mounts. Of late there are also some advanced mounts based on Harmonic drives. Such mounts obviate the need for counterweights to a great extent and yet present themselves as very lightweight. The prices of such mounts can go well above $2000. 


Most often it is good to have a couple of scopes. One is typically for DSO imaging (Deep Sky Objects) and the other for Lunar and Planetary imaging. These are mainly classified and recognized by the f-ratios they offer. Lower f-ratios are best suited for DSOs while those with higher (f-ratio > 10-11) are ideal for observing details of Jupiter, Saturn, and Mars. I know of recovering telescope addicts who have a garage full of telescopes, but that calls for a separate light-hearted discussion :D.  Cooling, guiding, and other accessories also add to costs. A Quad-band pass filter alone can cost up to that of a simple beginner telescope. As to why that is needed! You need to check up on something called light pollution of the night skies - a loaded topic that affects our planet's health too. So it's shockingly easy to keep buying accessories as your upgrading of skills progresses.


Manually slewing my rig to the celestial target
Manually slewing my rig to the celestial target

While these mid-level scopes are excellent for many targets, some choose to invest $2000-$5000 on semi-pro setups that can reach dim nebulae and galaxies. The latest in the market is all about EAA - Electronically Assisted Astronomy. No Eyepieces! Just automated devices with varying levels of optics. A bit distracting for old-timers in the hobby who also wish to see through the scope with their eyepieces. Even a total novice can get started with just one click and the device starts imaging your desired target, and even takes you on a night sky tour. There are models for every budget ranging from $500 to $5000 and probably more. Astrophotography can become an expensive obsession over time. But by starting small and focusing on skills rather than gear, the universe can be explored at many budget levels. Passion and patience are the most important ingredients.


Gaganam Gaganakaram - For the expanse of the universe can be only compared to itself alone