See below for a snippet from Nuke with a sky image / camera setup - this should work for an input image (not included) of 4096 x 2048 - you might have to play with the reformat setting for your scene.
Also, if you're rendering your Terragen scene and planning on replacing the sky - turn off "Atmo/cloud on background" in the Layer Settings of the Render Elements node to give you the correct premult against black for the color elements of your terrain.
Nuke code snippet:
set cut_paste_input [stack 0]
version 9.0 v7
push $cut_paste_input
Camera2 {
translate {29766.85742 1174.575439 -48914.14063}
rotate {13.00316143 127.4347305 -2.942439079}
scaling {10 10 10}
focal 32
haperture 36.00000381
vaperture 24.00000218
near 10
far 600000
file
name Camera1
selected true
xpos 249
ypos -140
}
Read {
inputs 0
file
format "4096 2048 0 0 4096 2048 1 "
origset true
name Read1
selected true
xpos 96
ypos -370
}
Reformat {
format "4096 4096 0 0 4096 4096 1 temp"
resize fit
pbb true
name Reformat1
selected true
xpos 96
ypos -226
}
Sphere {
cast_shadow false
receive_shadow false
radius 100000
rotate {0 -30 0}
name Sphere2
selected true
xpos 96
ypos -132
}
Scene {
display textured
render_mode textured
name Scene2
selected true
xpos 105
ypos -32
}
push 0
ScanlineRender {
inputs 3
conservative_shader_sampling false
samples 2
motion_vectors_type distance
name ScanlineRender2
selected true
xpos 240
ypos -24
}