# Simulating Atmospheric Refraction

Interesting things happen when you put refraction into the flat earth model. Here's standard refraction from 10 feet.

Look where the horizon is! The standard atmosphere is denser lower down due to air pressure, so all rays bend down, and over a long distance they hit the water. This raises up the horizon in the image quite a bit.

It's not at all as dramatic as it looks though, the vertical field of view here is 0.1° (vs. about 0.75 for a P900)

Amazing work, Mick! I love stuff like this 'cos it makes me realise my place in the grand scheme of things.

Coupla questions: do the red and blue lines of the 60 foot target signify anything? Being the same colour as the refraction lines there's a sense that they're related. Also, in the previous comment the non-refracted flat earth target has ten feet below the horizon. Why is that? I guess I've always thought it would always be visible.

Also, how does the flat earth simulation know where to put a horizon?

Cheers.

Coupla questions: do the red and blue lines of the 60 foot target signify anything? Being the same colour as the refraction lines there's a sense that they're related.
No, they are just there so you can see reflections more clearly. When the slope of the line changes direction. like here:

At the very bottom there's a small region of reflection, but without the diagonal lines, you would not be able to tell.

Also, in the previous comment the non-refracted flat earth target has ten feet below the horizon. Why is that? I guess I've always thought it would always be visible.
It is visible. It's in front of the horizon

Also, how does the flat earth simulation know where to put a horizon?
IMprefectly, but close enough.
Code:
``````var widthToTrace = sideWidthFeet;
if (par.useFlat) widthToTrace *=3;

// and later

if (par.useFlat && angle >0 || sy(y)>sideHeightPixels)
rayHitGround[line] = true;``````
That last bit is: "If we are simulating a flat earth, and were are looking down then we hit the ground, or if the ray goes below then we hit the ground"

So without refraction it just puts the horizon at eye level. This is reasonable, except you would not get a sharp horizon due to haze.

With refraction light rays to are angled up a bit can still hit the ground, so the apparent horizon can move. I triple the distance over which rays are traced in order for this to be more accurate, but it's not perfect.

I've added a couple of laser targets, including "Green Laser at 5 feet" which is a typical FE over-water test configuration. It's ten miles away

The image above shows the laser visible from 10 feet, but with the relatively small temperature gradient, the laser is visible from 1 foot and even 0.1 feet.

The other laser target has a different color laser ever five feet, starting at 0 feet and is interesting

Last edited:

Some real-world comparisons. Not going to be perfect because of tides, but starting with the image on the right, view from 6 feet, very minor tweak to standard refraction needed to show an extra half a floor.

Then with the same settings, lower to 2 feet:

Matches pretty much exactly. Not particularly challenging from a refraction point of view, but still validates the basic model.

If you've not checked this out recently, I've made some substantial improvement in speed, accuracy, configuration options, and the variety of scenes:

https://www.metabunk.org/refraction/

Last edited by a moderator:
In what circumstances a superior mirage can occur?
How to simulate a superior mirage by the link https://www.metabunk.org/refraction/

Usually, it's a thermal inversion above both the viewer and the target.

One of the presets shows a superior mirage of an oil tanker: The temperature curve has a normal lapse rate up to about 150 feet, then a very steep increase of about 2°C, then normal again.

https://www.metabunk.org/refraction/

Last edited:
Added Pontchartrain, and a general ability for multiple images at different distances. Which might be useful for looking at peaks being obscured by intermediate ridges, like what @Rory was looking at.

Added a preset to match Walter Bislin's Superior Mirage implementation.

Walter's
http://walter.bislins.ch/bloge/index.asp?page=Simulation+of+Atmospheric+Refraction (Click on "Superior Mirage" black button)

Mine:
https://www.metabunk.org/refraction/?~(p~'Andy*2fWalter*20Superior)_

Walter uses a simple spline though three temperature points, whereas I use a Bezier curve with three extra control points. So I had to adjust the control points to match his output. It would be interesting to see if the same temperature curve gives the same results.

There's a distinct kink at the base of the third and fourth targets which I think might be a bug on my part, to do with the optimization. Needs investigation.

There's a distinct kink at the base of the third and fourth targets which I think might be a bug on my part, to do with the optimization. Needs investigation.

Fixed! It was an error in computing the index gradient below 0.5 feet. Changed

Code:
``if (x<=0) return nByFoot[0] ;``
to

Code:
``if (x<=0) return nByFoot[0] + (nByFoot[0] - nByFoot[1]) * -x ;``

in function calculateInterpolateFunctions()

The actual effect of an RH gradient depends on the temperature gradient. It might be worth adding an editable humidity gradient just so you can see how little of an effect it has.

Done! And I was surprised that it had much more of an effect than I suspected. The Ciddor equation seems to has slightly more effect, but really my previous test wasn't very good, as I did not test it over a range of altitudes.

The default is still fixed 50%, however there's now an "Edit RH" box that brings up a graph. Here's a fixed 50% RH:

And 100% at sea level coming down to 30% at 100 feet.

So now the question is: what's a realistic set of RH profiles?

Mathias Kp, who I think is Danish, has made several videos showing the effects of refraction over bodies of water. He has a new one here, with long distance observations of a tall building ('Turning Torso') in Malmo (Sweden) across the straits from Copenhagen over the course of a few hours. There is a striking comparison at around 3:00 in the video, showing an astonishing amount of compression of the bottom of the building:

I don't know exactly what kind of refraction is responsible, but Mathias gives some temperature data showing much higher air than water temps.

Mathias Kp, who I think is Danish, has made several videos showing the effects of refraction over bodies of water. He has a new one here, with long distance observations of a tall building ('Turning Torso') in Malmo (Sweden) across the straits from Copenhagen over the course of a few hours. There is a striking comparison at around 3:00 in the video, showing an astonishing amount of compression of the bottom of the building:

I don't know exactly what kind of refraction is responsible, but Mathias gives some temperature data showing much higher air than water temps.
I added it to the sim
https://www.metabunk.org/refraction/?~(p~'Turning*20Torso)_

And a much less technical tutorial:

that helps! i bookmarked it as i'll have to rewatch frequently i'm sure.
so not to interrupt thread too much:

the pink area (the area of red and blue lines) is top to bottom of what is showing in the photo.
the green dot is the top of the rock.
everything in grey i cannot see in this photo.

yes?

everything in grey i cannot see in this photo.

yes?

Correct. There are some more blue lines in your image, but they all hit the water before they get as far as the target, so they are the ones that get displayed as water. You can see this more if you raise up the viewer height.

There are some more blue lines in your image, but they all hit the water before they get as far as the target, so they are the ones that get displayed as water.
so.. the red and blue lines are the top of the photo to the bottom of the rock [that shows in this picture]. ??

Last edited:
so.. the red and blue lines are the top of the photo to the bottom of the rock [that shows in this picture]. ??
If you move your cursor over the side view (the red and blue lines) it will show which line there corresponds to which line in the image.

If you move your cursor over the side view (the red and blue lines) it will show which line there corresponds to which line in the image.
ok playing around with Catalina preset i see there is no exact formula, sometimes the bottom blue line is the bottom of the rock and sometimes its a bit up the rock and sometimes it's in the water. So basically i won't know unless you guys post links to the simulator/photos

I'll have to watch the tutorial a few more times!

Would the refraction simulator help to predict ideal conditions for the proposal to recreate the Bedford Level experiment?

This would be over a canal, in England, with cameras and targets a minimum of 13-15 feet above the water.

There's a preset in there now:
https://www.metabunk.org/refraction/?~(p~'Bedford*20Level*3a*20Wallace)_

Ideal conditions are those that have the least refraction, so really it's going to be when the air temperature is close to the water temperature. But Wallace designed the experiment to minimize the effects of any refraction. Playing around with the simulator it's hard to see how it could go wrong.

I've added the ability for adding as many lasers as you like. In three colors.

By default, lasers will start at the camera position and beam away. If you select "Flip Laser Direction", then the laser will be positioned at the last target, and pointing back towards the camera.

Something I'd like to improve is the rendering of the laser when it hits the camera. Currently what is being rendered is the diffuse beam (i.e. the beam light that is scattered by the air.) But when that beam covers the camera, there should be a very bright spot of light at the position of the laser source.

Also new:
• A "Geometric Horizon" line, showing where the horizon would be with simple geometry (i.e. with no refraction).
• A blue line on the temperature graph showing the refractive index (with no scale, will probably change)

Last edited:
Did I break something? When I try to load an image, I lose everything except the blue sky field and the graph, and can only regain function if I reload the page, which starts me back at the default settings.

Did I break something? When I try to load an image
What are you doing when you "try to load an image?" Clicking on a preset? Putting something in the "Image Files" box?

What browser are you using?

Chrome.
I'm placing a URL in the Image Files form block entry.
https://1.bp.blogspot.com/-P66-aqsm...l1lSnw4r4nvvdfo0ACLcBGAsYHQ/s1600/Zumwalt.jpg

Any change to that Image Files form entry seems to lock up the page. I'll try a different browser.
You need to put in the same number of images as is used in the preset. Right now the default is the oil platforms, so you need two.
https://1.bp.blogspot.com/-P66-aqsm...l1lSnw4r4nvvdfo0ACLcBGAsYHQ/s1600/Zumwalt.jpg, https://1.bp.blogspot.com/-P66-aqsm...l1lSnw4r4nvvdfo0ACLcBGAsYHQ/s1600/Zumwalt.jpg

But simpler if you change to a single image preset first, like
https://www.metabunk.org/refraction/?~(p~'60*20foot*20taget*20at*2010*20miles)_

You need to put in the same number of images as is used in the preset. Right now the default is the oil platforms, so you need two.

But simpler if you change to a single image preset first,
Ahh. Never occurred to me. Thanks. (And not just for the help, but for the tools.)

More questions, Mick.

I'm trying to use your refraction simulator to reproduce a scenario captured by a flat earther involving two targets. (It's Harry Baird or "Fresh Look at the Truth", although I don't know if he's still in the flat earth game anymore.) Is the only way to set that up is to take one of the presets with two targets and replace them with my own images? Or is there a way to start from scratch and add my own number of targets?

Second question: is there a way to reconfigure the temperature gradient graph parameters (temp range, height range, intervals) or to manipulate it's position on the display.

Thanks.

More questions, Mick.

I'm trying to use your refraction simulator to reproduce a scenario captured by a flat earther involving two targets. (It's Harry Baird or "Fresh Look at the Truth", although I don't know if he's still in the flat earth game anymore.) Is the only way to set that up is to take one of the presets with two targets and replace them with my own images? Or is there a way to start from scratch and add my own number of targets?

Second question: is there a way to reconfigure the temperature gradient graph parameters (temp range, height range, intervals) or to manipulate it's position on the display.

Thanks.
Unfortunately, it's rather tricky to customize. I add a new setup to the source code whenever I do it, and not all the parameters can be edited in the editor.

You can move the graphs around by shift-clicking on them.

I might improve it, but don't hold your breath.

Unfortunately, it's rather tricky to customize. I add a new setup to the source code whenever I do it, and not all the parameters can be edited in the editor.

You can move the graphs around by shift-clicking on them.

I might improve it, but don't hold your breath.
Shift+click was the key. Thanks.
I would never expect or press you to add features. (Same with Walter.) I'm just so grateful you and he have put in the effort to produce the tools you've produced and made available for free. I've learned a ton just from using them to help explain what we see.

I assembled a short slide-show video recently, revisiting some of Sydney flat earther Harry Baird's telephoto images that show the horizon against the near reference landmark of North Head at the entrance to Sydney harbor. Baird mistakenly interpreted the rising of the horizon as simply being able to see farther, but failed to comprehend the significance that a ship on the horizon at 30 miles distance (viewed from a height of 250 ft) was raised also and more visible (albeit squashed) while another ship at nearly the same distance on another day appeared lower along with the lower horizon, but was almost half obscured. He'd unwittingly captured a great example of a looming and the cliff edge of the headlands, only 3 miles away, provided a great vertical reference.

I think I can use your refraction app to show how that works, replacing the preset Hillhouse/Habitat preset with images of the headlands and a profile pic of one of the tankers Harry sighted. It works pretty good. I just need to tinker with the temperature profile a bit. If I draft up a video of me using your refraction tool, I'd love it if you'd have a look before I publish it publicly. I couldn't find a way to permalink it so that my image URLs and adjusted height/distance settings from the Hillhouse/Habitat preset remained intact.

Anyway, I know you have a lot on your plate. Don't want to ask too much. Thanks again for the great tool.

1. Is it possible to use this tool to simulate refraction on a very far distant object illuminated by the sun not visible to the observer? such as the mystery "missile" of 2010 or the missile launches in the 1970s seen from the Canary Islands? (The target distance cap is 100 miles, but could it be up to 1000 miles?).
2. Could refraction play a role in very narrow field of view recordings from military sensors i.e. Gimbal. Could they mistakenly observe a hot or bright thing hundreds of miles away or is there some correction system for that?

Is it possible to use this tool to simulate refraction on a very far distant object illuminated by the sun not visible to the observer? such as the mystery "missile" of 2010 or the missile launches in the 1970s seen from the Canary Islands? (The target distance cap is 100 miles, but could it be up to 1000 miles?).
You can enter in a larger value manually, like in the Sun preset, which I put at 1000 miles (not ideal, but put it outside the atmosphere, so the end result should be about the same. It's all a bit fiddly though
https://metabunk.org/refraction/?~(p~'Sun*20*28dummy*2c*20poor*29)_

Hi Mick,
If I give you or link to a couple transparent PNG images, could you add a preset to the list in the refraction simulator? I can give you the details (sizes/distances) for scaling.
What I'd like to be able to do is simulate various atmospheric conditions for the scenario in a recent YouTube series I've been doing:

I can sort of make it work using one of the Hillhouse/Habitat presets, but I'd like to be able to change temperature profile up to around 300 ft or even more. (Not so great that I can't make fine tune lapse rates over short spans near the water.)

If you don't have time or just don't want to deal with special requests, no problem. Just thought I'd ask. I have a notion for a YouTube presentation and was thinking I could use your simulator to demonstrate.

Replies
2
Views
1K
Replies
11
Views
10K
Replies
203
Views
22K
Replies
21
Views
18K
Replies
5
Views
9K