Hacked-Crew / Magnetic-Declination

QGIS plugin
GNU General Public License v2.0
5 stars 8 forks source link

Conversion calculations #2

Open ArnoGitHub opened 8 years ago

ArnoGitHub commented 8 years ago

First thanks for this plug-in, it is very useful.

Maybe I am wrong but ...

it seems that there is an error when calculation are made for the conversion between the Magnetic and the True angle.

Ex: Using New York city coordinates Latitude: 40.7142700 Longitude: -74.0059700

with today date (2015-11-23) it gives a declination of -12.95 (i.e. 12.95 west) That's correct.

But, using the conversion Magnetic to True and setting the heading to 0 degrees, it gives: True heading = 12.95 degrees ! IMO it should be 347.05 (i.e. 360 - 12.95)

However, the compass rose is correct

Hacked-Crew commented 8 years ago

Hi Arno,

"Magnetic to True" conversion is used when North Magnetic value are stored e.g. within compass. If you want know the True North value, simply read the compass magnetic value 12,95. In your case, 12.95 becomes the 0 heading by ring nut, and now the compass Magnetic North related to True North is 347,05 (ring nut scale).

I hope you are agree with my explication. If not, send me your feebdack.

Regards

ArnoGitHub commented 8 years ago

Hi,

In fact, I agree with your explanation, but not with the presentation of the values in your tool.

Here is my understanding when I use your tool as it is currently.

Regards,

Arnaud

2015-11-27 7:29 GMT-05:00 Aldo Scorza notifications@github.com:

Hi Arno,

"Magnetic to True" conversion is used when North Magnetic value are stored e.g. within compass. If you want know the True North value, simply read the compass magnetic value 12,95. In your case, 12.95 becomes the 0 heading by ring nut, and now the compass Magnetic North related to True North is 347,05 (ring nut scale).

I hope you are agree with my explication. If not, send me your feebdack.

Regards

— Reply to this email directly or view it on GitHub https://github.com/Hacked-Crew/Magnetic-Declination/issues/2#issuecomment-160129762 .

ludwigus commented 5 years ago

Hi, I also think that this is a very useful and nice plugin but I was also confused just as Arnaud. When I enter a true heading and Press "Calculate" to convert it to a magnetic heading, I expected that this would be the value on a magnetic scale, corresponding to the given heading on the true scale. I understand your explanation but this is not what I would expect from the information given in the plugin. If you don't want to change your definition of "magnetic to true" and "true to magentic", maybe at least some more information would be helpful to avoid confusions. Cheers!

drf5n commented 3 years ago

The tool seems to label the results clearly as "Magnetic Heading" when you choose the "find Magnetic" option in the tool, (and vice versa):

image

Forna73 commented 6 months ago

Hi! I just downloaded this plug in for my plottings.... and also find the information confusing! assumed that:

Magnetic Heading = True Heading - Variation

In the Type section if I select "find Magnetic" thus this mean (at least to me) I'm putting a True heading, cause I need magnetic one! for example:

TH = 100° Variation is 5° E MH = 100 - (+5) = 95° With the plug in I'm having 105° that is wrong!!!

If I select find True it does the opposite!

I think you could simply cancel the word "find" in the type section, so if I select Magnetic does this mean I'm putting a Magnetic heading and vice versa So in Results, when I select Magnetic Type there will be True Heading nad when True Type is selected, there will be Magnetic heading.

drf5n commented 6 months ago

When drawing a compass rose for the Yorktown Monument in Yorktown, VA, USA, I get:

image

and

image

It does seem backwards. With the TVMDC, AW rule, the calculation would be:

000T + 010.76W = 010.76M  (versus the panel's 349.236222828773M)

which matches the rose, with True North reading 010M on the Magnetic ring.

and the reverse CDMVTAE rule:

000M - 010.76 = 349T  (versus the panel's 10.7637771712263T)

which also matches the Rose with the 000M line pointing at 349T

The numbers reported in the panel do not match the drawn rose.

The panel calculations appear to be here:

https://github.com/Hacked-Crew/Magnetic-Declination/blob/9ea3356558224a4fd86777c25b8d461eee4b11aa/MagneticDeclination/Magnetic_declination.py#L407-L413

and

https://github.com/Hacked-Crew/Magnetic-Declination/blob/9ea3356558224a4fd86777c25b8d461eee4b11aa/MagneticDeclination/geomag/__init__.py#L30-L36

drf5n commented 6 months ago

The https://github.com/Hacked-Crew/Magnetic-Declination/pull/10 pull request seems to solve this:

image

Or as a workaround, you can edit your installed copy of Magnetic_declination.py to swap these lines:

https://github.com/Hacked-Crew/Magnetic-Declination/blob/9ea3356558224a4fd86777c25b8d461eee4b11aa/MagneticDeclination/Magnetic_declination.py#L407-L410

to be:

 if simple_XtoMagnetic == 1: 
     Rheading = geomag.mag_heading(float(simple_heading), float(self.simple_latitude), float(self.simple_longitude), float(simple_Cheight), date(simple_year,simple_month,simple_day)) 
 else: 
     Rheading = (float(self.Rdeclination) + float(simple_heading)) % 360  

On my mac, this file was installed at:

~/Library/Application\ Support/QGIS/QGIS3/profiles/junktest4/python/plugins/MagneticDeclination/Magnetic_declination.py