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

Use igrf C code instead of Fortran. #2

Open
Jammyjamjamman opened this issue Sep 25, 2018 · 4 comments
Open

Use igrf C code instead of Fortran. #2

Jammyjamjamman opened this issue Sep 25, 2018 · 4 comments

Comments

@Jammyjamjamman
Copy link

Firstly, thanks for this awesome repository! It has been really useful to me!

I think it would be better if the repository used the C IGRF code because:

  1. C is better than Fortran (well... ok this isn't really true anymore, but it is true for old Fortran like seen in the IGRF code).

  2. Most people have a C/C++ compiler already for installing python packages, but not a Fortran compiler. I was using anaconda python on ubuntu and I had to install fortran to install this. (You can also install fortran from the anaconda repo).

Of course, this is not an essential project. I just think it might be a nice improvement. If it's too difficult, then I wouldn't worry about it.

@scivision
Copy link
Member

Hi @Jammyjamjamman I think that would be fine to have the C version of IGRF as a reference. Feel free to pull request it 👍
It is not too difficult.

@Jammyjamjamman
Copy link
Author

Hi, @scivision , sorry for taking a year to respond... Would you still be interested in me implementing this?

Here is what my plan would be to implement it:

@scivision
Copy link
Member

I just checked and put the C code in this repo for future reference. I didn't have any issues compiling with Visual Studio or any other modern C compiler I tried. The C source code for the geomag_windows and geomag_linux is exactly the same. I would need to make an interface for this C code.

@Jammyjamjamman
Copy link
Author

I just checked and put the C code in this repo for future reference. I didn't have any issues compiling with Visual Studio or any other modern C compiler I tried. The C source code for the geomag_windows and geomag_linux is exactly the same. I would need to make an interface for this C code.

SWIG interfaces are the easiest way I know of doing this. Could also be done as a pure python module (hard) or using Cython.

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

No branches or pull requests

2 participants