<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ibrahim Nauman</title>
    <description>The latest articles on DEV Community by Ibrahim Nauman (@ibrahim_nauman_786).</description>
    <link>https://dev.to/ibrahim_nauman_786</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4196219%2Fb8787811-84ed-4468-bcbb-e2272541dfb9.jpg</url>
      <title>DEV Community: Ibrahim Nauman</title>
      <link>https://dev.to/ibrahim_nauman_786</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ibrahim_nauman_786"/>
    <language>en</language>
    <item>
      <title>Sizing a 50 W Flood Light Layout With Python: Lux, Lumens and Mounting Height</title>
      <dc:creator>Ibrahim Nauman</dc:creator>
      <pubDate>Tue, 27 Oct 2026 12:55:31 +0000</pubDate>
      <link>https://dev.to/ibrahim_nauman_786/sizing-a-50-w-flood-light-layout-with-python-lux-lumens-and-mounting-height-473d</link>
      <guid>https://dev.to/ibrahim_nauman_786/sizing-a-50-w-flood-light-layout-with-python-lux-lumens-and-mounting-height-473d</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft09e4saperlbac0nhhxm.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft09e4saperlbac0nhhxm.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;We sell outdoor LED lighting in Pakistan, and the question we get most from site engineers is a numbers question. How many fittings does this yard need, and how high do they go? Very often someone has already decided on a 50 W flood light because it's the familiar size, and what they actually want to know is whether six of them is enough or whether they need twelve.&lt;/p&gt;

&lt;p&gt;This post walks through the method we use for a first estimate, written up as a small Python script you can run and adapt. It's the lumen method, which gives you an average illuminance over an area. It's a sanity check and a starting point, not a substitute for a proper photometric calculation in DIALux or similar using the manufacturer's IES file, which you should still do for anything safety-critical.&lt;/p&gt;

&lt;p&gt;The inputs you need before writing any code&lt;br&gt;
Five numbers drive the whole calculation. Get these right and the arithmetic is trivial. Get them wrong and no script will save you.&lt;/p&gt;

&lt;p&gt;Target illuminance (E), in lux. This comes from the client's requirement or the standard they work to. For outdoor workplaces, EN 12464-2 is the usual reference. Agree the figure in writing before you start.&lt;br&gt;
Area (A), in square metres. The area that actually needs lighting, not the whole plot.&lt;br&gt;
Luminous flux per fitting, in lumens. Take this from the datasheet. Never estimate it from wattage, because two fittings with the same wattage can differ a lot.&lt;br&gt;
Utilisation factor (UF). The fraction of the fitting's lumens that actually lands on the target area. Flood lights aimed at a yard spill a good share of their light past the edges, onto walls and into the sky.&lt;br&gt;
Maintenance factor (MF). Allowance for dirt on the glass and the gradual drop in LED output over time.&lt;br&gt;
UF and MF are where judgement comes in. In the script we default to 0.5 and 0.8 as placeholder assumptions. A real photometric file replaces the UF guess, and the MF should reflect how often the glass actually gets cleaned. On a site in Faisalabad or Multan that gets a couple of dust storms every summer and is cleaned once a year, be more pessimistic than you would for a sealed canopy in a clean area.&lt;/p&gt;

&lt;p&gt;The lumen method in one line&lt;br&gt;
The number of fittings is:&lt;/p&gt;

&lt;p&gt;N = (E × A) / (Φ × UF × MF)&lt;/p&gt;

&lt;p&gt;where Φ is the rated flux of one fitting. You need E × A lumens on the ground. Each fitting contributes Φ × UF × MF of useful, maintained lumens. Divide, then round up, because you can't install 4.5 fittings.&lt;/p&gt;

&lt;p&gt;Run it backwards and you get the average lux a given number of fittings will deliver, which is handy for checking a layout someone else has already drawn.&lt;/p&gt;

&lt;p&gt;A small calculator&lt;br&gt;
Here's the whole thing. It uses only the standard library, so it runs anywhere Python 3.7 or later is installed.&lt;/p&gt;

&lt;p&gt;import math&lt;br&gt;
from dataclasses import dataclass&lt;/p&gt;

&lt;p&gt;@dataclass&lt;br&gt;
class Fitting:&lt;br&gt;
    name: str&lt;br&gt;
    lumens: float    # rated luminous flux from the datasheet&lt;br&gt;
    beam_deg: float  # full beam angle in degrees&lt;/p&gt;

&lt;p&gt;def fittings_needed(target_lux, area_m2, fitting, uf=0.5, mf=0.8):&lt;br&gt;
    """Lumen method: N = (E x A) / (flux x UF x MF), rounded up."""&lt;br&gt;
    n = (target_lux * area_m2) / (fitting.lumens * uf * mf)&lt;br&gt;
    return math.ceil(n)&lt;/p&gt;

&lt;p&gt;def average_lux(n, area_m2, fitting, uf=0.5, mf=0.8):&lt;br&gt;
    """Average maintained illuminance that n fittings give over the area."""&lt;br&gt;
    return n * fitting.lumens * uf * mf / area_m2&lt;/p&gt;

&lt;p&gt;def footprint_m(height_m, beam_deg):&lt;br&gt;
    """Beam diameter on the ground for a fitting aimed straight down."""&lt;br&gt;
    return 2 * height_m * math.tan(math.radians(beam_deg / 2))&lt;/p&gt;

&lt;p&gt;if &lt;strong&gt;name&lt;/strong&gt; == "&lt;strong&gt;main&lt;/strong&gt;":&lt;br&gt;
    yard_l, yard_w = 30, 20   # metres&lt;br&gt;
    area = yard_l * yard_w&lt;br&gt;
    target = 20               # lux, the figure agreed with the client&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;options = [
    Fitting("50 W, 90 deg beam", lumens=5000, beam_deg=90),
    Fitting("50 W, 120 deg beam", lumens=5500, beam_deg=120),
]

print(f"Yard {yard_l} x {yard_w} m = {area} m2, target {target} lux")
for f in options:
    n = fittings_needed(target, area, f)
    lux = average_lux(n, area, f)
    print(f"\n{f.name}: {n} fittings, about {lux:.1f} lux average")
    for h in (5, 6, 8):
        print(f"  at {h} m the beam is about {footprint_m(h, f.beam_deg):.1f} m across")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Running it for a 50 W flood light on a factory yard&lt;br&gt;
The example is a 30 by 20 metre loading yard behind a factory, with an assumed target of 20 lux for this walkthrough. Treat that figure as an example only, not a recommendation for your site. The two fittings are a 50 W flood light with a 90° beam rated at 5,000 lumens, and a 50 W model with a 120° beam at 5,500 lumens, which are the kind of figures you'll find on real datasheets in this class.&lt;/p&gt;

&lt;p&gt;The script prints:&lt;/p&gt;

&lt;p&gt;Yard 30 x 20 m = 600 m2, target 20 lux&lt;/p&gt;

&lt;p&gt;50 W, 90 deg beam: 6 fittings, about 20.0 lux average&lt;br&gt;
  at 5 m the beam is about 10.0 m across&lt;br&gt;
  at 6 m the beam is about 12.0 m across&lt;br&gt;
  at 8 m the beam is about 16.0 m across&lt;/p&gt;

&lt;p&gt;50 W, 120 deg beam: 6 fittings, about 22.0 lux average&lt;br&gt;
  at 5 m the beam is about 17.3 m across&lt;br&gt;
  at 6 m the beam is about 20.8 m across&lt;br&gt;
  at 8 m the beam is about 27.7 m across&lt;br&gt;
Both options land on six fittings. That's where the second function earns its place.&lt;/p&gt;

&lt;p&gt;Checking the beam footprint against mounting height&lt;br&gt;
An average can hide a lot. Six fittings giving 20 lux on average might mean a bright patch under each pole and dark bands between them. The footprint function is a crude check for that: for a fitting aimed straight down, the lit circle on the ground has a diameter of 2 × h × tan(beam / 2).&lt;/p&gt;

&lt;p&gt;A 50 W flood light with a 90° beam at 6 metres lights a circle roughly 12 metres across. Spread six of them over a 30 by 20 metre yard and the circles barely touch, so expect visible gaps. The 120° fitting at the same height covers about 21 metres, so the pools overlap and the yard looks far more even. The catch is that a wider beam also throws more light past the yard edges, so its real UF is probably lower than the 0.5 we assumed. Change the uf argument per fitting and rerun to see how sensitive your answer is.&lt;/p&gt;

&lt;p&gt;Flood lights are rarely aimed straight down in practice, so treat the footprint as an approximation. Tilting a fitting stretches its pool into an ellipse and pushes more light toward the far side.&lt;/p&gt;

&lt;p&gt;What the script doesn't know&lt;br&gt;
A few things matter on Pakistani sites that no lumen calculation captures. Glare toward a road or a neighbour's house depends on aiming, not on the maths. Heat matters too: a 50 W flood light on a south-facing wall in a Lahore June runs hotter than one under a shade, and that affects how long it lasts. And dust is constant, which is why we'd rather be pessimistic on MF than promise a client 20 lux that turns into 14 after one andhi season.&lt;/p&gt;

&lt;p&gt;If you're filling in the lumen and beam inputs, our &lt;a&gt;flood light&lt;/a&gt; models with published lumen and beam figures give you real numbers from 50W upward to plug straight into the script.&lt;/p&gt;

&lt;p&gt;Questions about a specific yard or layout can go to our engineering team at &lt;a href="https://hyundailedlights.com.pk" rel="noopener noreferrer"&gt;Hyundai LED&lt;/a&gt;, and we're happy to sanity-check your numbers.&lt;/p&gt;

</description>
      <category>code</category>
      <category>programming</category>
      <category>python</category>
    </item>
  </channel>
</rss>
