Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pmag.sundec function gives incorrect results #695

Open
duserzym opened this issue Jun 21, 2023 · 0 comments
Open

pmag.sundec function gives incorrect results #695

duserzym opened this issue Jun 21, 2023 · 0 comments

Comments

@duserzym
Copy link
Collaborator

What command was run:
pmag.dosundec()

What happened:
The calculated core strike values from shadow angles are incorrect. They are consistently off from the magnetic strike values which are already corrected. Checking with the super-IAPD program confirms the magnetic core strike values and the calculated core strikes using sun compass values should agree.

I find that the issue with the dosundec function happens when the delta parameter from the Greenwich hour angle calculation function pmag.gha() is really close to the latitude of the paleomagnetic site. Rounding issues or integer casting of the latitude from user inputs will cause the conditional argument if delta < lat in pmag.dosundec() to jump between True and False values, causing the resultant sunaz parameter to have wrong values.

What I expected to happen:
@ltauxe Lisa, I am not very familiar with this function, and I am confused about why there is this line that compares the greenwich hour angle with the site latitude. It seems to me that line 4360 and 4361 are not necessary and are causing the issues. My light testing with some example data are shown below in the screenshot and in the example notebook in the zip file. It seems to me that removing those lines fixes the issue. Could you help explain what those lines do? Thanks!

Screenshot 2023-06-21 at 14 31 26

Data file(s):

sun_correction.zip

Screenshot(s):
Screenshot 2023-06-21 at 14 37 02

This screenshot shows the true magnetic core strike in the first column, the calculated core strike from sun angle using my modified dosundec() function that removed line 4360 and 4361 in pmag.py in the second column, and the calculated core strike from sun angle using the pmag.dosundec() without modifications in the third column. You can see that the values in the third column are all off by ~15 degrees from the true values.

PmagPy version:
Developer version, main branch, synced to the latest commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant