Skip to content

Commit 5d41436

Browse files
committed
Adapting eoxmagmod to the changed qdipole API
1 parent a3da644 commit 5d41436

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

eoxmagmod/eoxmagmod/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from .quasi_dipole_coordinates import (
6161
eval_qdlatlon, eval_mlt, eval_subsol,
6262
eval_qdlatlon_with_base_vectors,
63+
QDIPOLE_VERSION,
6364
)
6465
from .solar_position import sunpos, sunpos_original
6566
from .dipole_coords import (
@@ -115,6 +116,7 @@
115116
'eval_qdlatlon_with_base_vectors',
116117
'eval_mlt',
117118
'eval_subsol',
119+
'QDIPOLE_VERSION',
118120
'sunpos',
119121
'sunpos_original',
120122
'decimal_year_to_mjd2000',

eoxmagmod/eoxmagmod/pyqd.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
/* sub-solar point coordinates evaluation */
4747
#include "pyqd_eval_subsol.h"
4848

49+
/* qdipole API */
50+
#include "qdipole/cqdipole.h"
51+
4952
/*---------------------------------------------------------------------------*/
5053
/* module's doc string */
5154

@@ -80,9 +83,10 @@ static PyObject* init_module(void)
8083

8184
/* metadata */
8285
set_dict_item_str_str(dict, "__author__", "Martin Paces ([email protected])");
83-
set_dict_item_str_str(dict, "__copyright__", "Copyright (C) 2015-2022 EOX IT Services GmbH");
86+
set_dict_item_str_str(dict, "__copyright__", "Copyright (C) 2015-2024 EOX IT Services GmbH");
8487
set_dict_item_str_str(dict, "__licence__", "EOX licence (MIT style)");
8588
set_dict_item_str_str(dict, "__version__", VERSION);
89+
set_dict_item_str_str(dict, "QDIPOLE_VERSION", get_qdipole_version());
8690

8791
exit:
8892
return module;

eoxmagmod/eoxmagmod/pyqd_eval_qdlatlon.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ static PyObject* eval_qdlatlon(PyObject *self, PyObject *args, PyObject *kwdict)
9292
goto exit;
9393

9494
// check the filename length
95-
if (strlen(model_fname) > MAX_PATH_LENGTH) {
95+
if (strlen(model_fname) > get_qdipole_max_fname_lenght()) {
9696
PyErr_Format(
9797
PyExc_RuntimeError,
9898
"Filename is too long and exceeds the maximum allowed %d bytes! filename = %s",
99-
MAX_PATH_LENGTH, model_fname
99+
get_qdipole_max_fname_lenght(), model_fname
100100
);
101101
goto exit;
102102
}

eoxmagmod/eoxmagmod/quasi_dipole_coordinates.py

+2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
"eval_qdlatlon_with_base_vectors",
3636
"eval_mlt",
3737
"eval_subsol",
38+
"QDIPOLE_VERSION",
3839
]
3940

41+
QDIPOLE_VERSION = _pyqd.QDIPOLE_VERSION
4042

4143
def eval_qdlatlon(gclat, gclon, gcrad, time, fname=APEX_LATEST):
4244
"""

0 commit comments

Comments
 (0)