Ocular : error in formula for CCD sensors

Bug #604975 reported by Fred_76
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Stellarium
Fix Released
High
treaves

Bug Description

In the CCD.cpp file, here is a formula that is used to calculate the field of view of the CCD sensor :

float CCD::getActualFOVx(Ocular *ocular)
{
 float FOVx = (chip_width * 206.265) / ocular->getEffectiveFocalLength();
 return FOVx;
}

float CCD::getActualFOVy(Ocular *ocular)
{
 float FOVy = (chip_height * 206.265) / ocular->getEffectiveFocalLength();
 return FOVy;
}

There are two errors :
1) The factor 206.265 is not adequate. It is adequate to calculate the sampling angle of one pixel by using the following formula :

sampling (in arc. sec) = 206.265 * pixel width (µm) / telescope focal length (mm)

but it is not suitable for the FOV of the whole sensor.

The right exact formula for the field of view of the CCD shall be :

FOVx (arc. min) = 2 * atan(chip_width (mm) / (2* telescope focal length (mm)) * 180 / pi() * 60
FOVy (arc. min) = 2 * atan(chip_height (mm) / (2* telescope focal length (mm)) * 180 / pi() * 60

This formula can be simplified :

FOVx (arc. min) = 6875.5 * atan(chip_width (mm) / (2* telescope focal length (mm))
FOVy (arc. min) = 6875.5 * atan(chip_height (mm) / (2* telescope focal length (mm))

It can even be further simplified if chip size << telescope focal length, but to allow the use of DSLR lenses (with short focal length) the above formula would be better.

FOVx (arc.min) = 3437.7 * chip_width (mm) / telescope focal length (mm)
FOVy (arc. min) = 3437.7 * chip_height (mm) / telescope focal length (mm)

2) The formula in the CCD.ccp file is using the "ocular" focal length. It is not correct. The focal length of the telescope shall be used. Most astronomers are using their CCD in the focal plane of their telescope, and not in line behind an ocular. Even behind an ocular the use of the ocular focal length only is not adequate.

Therefore the right code in CCD.cpp should be :

float CCD::getActualFOVx(Telescope *telescope)
{
 float FOVx = 6875.5 * atan(chip_width / telescope->getEffectiveFocalLength() / 2);
 return FOVx;
}

float CCD::getActualFOVy(Telescope *telescope)
{
  float FOVy = 6875.5 * atan(chip_height / telescope->getEffectiveFocalLength() / 2);
 return FOVy;
}

or something like that...

Fred

Revision history for this message
Fred_76 (fmichaud76-public) wrote :

Addition :

a) If you take a picture behind an ocular, the formula is given by replacing the focal length of the telescope above by Feq, the equivalent focal length of the telescope + ocular :

Feq = equivalent focal length for telescope + ocular (mm)
Ftel = telescope focal length (mm)
D = distance between ocular and CCD (mm)
Foc = ocular focal length (mm)

Feq = Ftel * ( ( D / Foc ) - 1 )

b) If you take a picture behind an ocular with a DSLR equiped with a lens, the equivalent focal length of the assembly is :

Feq = equivalent focal length for telescope + ocular + DSLR (mm)
Flens= DSLR focal length (mm)
Ftel = telescope focal length (mm)
Foc = ocular focal length (mm)

Feq = Ftel * Flens / Foc

Revision history for this message
Peter Mousley (scrupeus) wrote : Re: [Bug 604975] [NEW] Ocular : error in formula for CCD sensors
Download full text (3.2 KiB)

On 13/07/2010 21:36, Fred_76 wrote:
> Public bug reported:
>
> In the CCD.cpp file, here is a formula that is used to calculate the
> field of view of the CCD sensor :
>
> float CCD::getActualFOVx(Ocular *ocular)
> {
> float FOVx = (chip_width * 206.265) / ocular->getEffectiveFocalLength();
> return FOVx;
> }
>
> float CCD::getActualFOVy(Ocular *ocular)
> {
> float FOVy = (chip_height * 206.265) / ocular->getEffectiveFocalLength();
> return FOVy;
> }
>
>
> There are two errors :
> 1) The factor 206.265 is not adequate. It is adequate to calculate the sampling angle of one pixel by using the following formula :
>
> sampling (in arc. sec) = 206.265 * pixel width (µm) / telescope focal
> length (mm)
>
> but it is not suitable for the FOV of the whole sensor.
>
> The right exact formula for the field of view of the CCD shall be :
>
> FOVx (arc. min) = 2 * atan(chip_width (mm) / (2* telescope focal length (mm)) * 180 / pi() * 60
> FOVy (arc. min) = 2 * atan(chip_height (mm) / (2* telescope focal length (mm)) * 180 / pi() * 60
>
> This formula can be simplified :
>
> FOVx (arc. min) = 6875.5 * atan(chip_width (mm) / (2* telescope focal length (mm))
> FOVy (arc. min) = 6875.5 * atan(chip_height (mm) / (2* telescope focal length (mm))
>
> It can even be further simplified if chip size<< telescope focal
> length, but to allow the use of DSLR lenses (with short focal length)
> the above formula would be better.
>
> FOVx (arc.min) = 3437.7 * chip_width (mm) / telescope focal length (mm)
> FOVy (arc. min) = 3437.7 * chip_height (mm) / telescope focal length (mm)
>
>
> 2) The formula in the CCD.ccp file is using the "ocular" focal length.
> It is not correct. The focal length of the telescope shall be used. Most
> astronomers are using their CCD in the focal plane of their telescope,
> and not in line behind an ocular. Even behind an ocular the use of the
> ocular focal length only is not adequate.
>
>
> Therefore the right code in CCD.cpp should be :
>
> float CCD::getActualFOVx(Telescope *telescope)
> {
> float FOVx = 6875.5 * atan(chip_width / telescope->getEffectiveFocalLength() / 2);
> return FOVx;
> }
>
> float CCD::getActualFOVy(Telescope *telescope)
> {
> float FOVy = 6875.5 * atan(chip_height / telescope->getEffectiveFocalLength() / 2);
> return FOVy;
> }
>
> or something like that...
>
> Fred
>
> ** Affects: stellarium
> Importance: Undecided
> Status: New
>
>
As mentioned a several days ago, I was working on a patch for Oculars.
It includes several bug fixes (including this one) and some new
options. The problem is, patches being submitted are not being accepted
so I wasn't exactly rushing to finish this one...

@Timothy: I wanted to get this finished properly and then contact you to
discuss, but as this is the second bug report that will cause
over-lapping code changes that are a real pain to merge, I've pushed my
patch to LP for review (see ~scrupeus/stellarium/oculars). There is
still a little cleaning up to do but the main components are there. I
have some other ideas but they can wait.
Check the bzr log for changes made. If you want this patch, let me know
and I'll finish it properly. If...

Read more...

Revision history for this message
Fred_76 (fmichaud76-public) wrote :

You can also correct this very minor bug, in the details shown on the top right corner, the unit for "Ocular FL:" is wrong. It should be "mm" i/o "°".

Did you also found a way to fix the hot keys issues (Ctrl/Shift + [ / ] ) with non EN keyboards ?

Revision history for this message
treaves (treaves) wrote :

Peter, I think you need to move your code to 'Propose for Merging.' I'll take a look at it ASAP.

Fred, that's not a defect. Stellarium needs a way to edit key bindings. Please file a feature request stating as much.

Revision history for this message
treaves (treaves) wrote :

Also Peter, make sure you've merged from trunk, and committed that too.

treaves (treaves)
Changed in stellarium:
status: New → Confirmed
Revision history for this message
treaves (treaves) wrote :

Fixed in commit 4775.

Changed in stellarium:
status: Confirmed → Fix Committed
assignee: nobody → treaves (treaves)
importance: Undecided → High
Changed in stellarium:
milestone: none → 0.10.6
Changed in stellarium:
status: Fix Committed → Fix Released
Revision history for this message
Andrea (andrea1984-j) wrote :

Hi, I've the same problem using the ocular plugin.
With Stellarium 0.12.1 for windows with ocular plugin 1.0.1 the FOV calculated is right, but inverted:
orizontal instead of vertical angle and viceversa while the rectangle is well painted.

Revision history for this message
Alexander Wolf (alexwolf) wrote :

Please fill new bug report and attach screenshot also.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.