Skip to content

Commit

Permalink
add bennu frame; expose some caParams; timeout for internet check dur…
Browse files Browse the repository at this point in the history
…ing import
  • Loading branch information
rahil-makadia committed Sep 27, 2024
1 parent f6afd3d commit 6a32602
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion grss/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
grss_path = os.path.dirname(os.path.abspath(__file__))
default_kernel_path = f'{grss_path}/kernels/'

def _connected_to_internet(url='http://www.google.com/', timeout=5):
def _connected_to_internet(url='http://www.google.com/', timeout=30):
try:
_ = requests.head(url, timeout=timeout)
return True
Expand Down
13 changes: 10 additions & 3 deletions src/grss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,25 @@ PYBIND11_MODULE(libgrss, m) {
)mydelimiter")
.def(py::init<>())
.def_readwrite("t", &CloseApproachParameters::t, R"mydelimiter(
Time of the close approach.
Time of the close approach or impact.
)mydelimiter")
.def_readwrite("xRel", &CloseApproachParameters::xRel,
R"mydelimiter(
Relative state of the close approach or impact.
)mydelimiter")
.def_readwrite("tCA", &CloseApproachParameters::tCA, R"mydelimiter(
Time of the close approach.
)mydelimiter")
.def_readwrite("xRelCA", &CloseApproachParameters::xRelCA,
R"mydelimiter(
Relative state of the close approach.
)mydelimiter")
.def_readwrite("tMap", &CloseApproachParameters::tMap, R"mydelimiter(
Time of the mapping point.
Time of mapping.
)mydelimiter")
.def_readwrite("xRelMap", &CloseApproachParameters::xRelMap,
R"mydelimiter(
Relative state of the mapping point.
Relative state at map time.
)mydelimiter")
.def_readwrite("dist", &CloseApproachParameters::dist, R"mydelimiter(
Distance of the close approach.
Expand Down
13 changes: 12 additions & 1 deletion src/pck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,16 @@ void iau_to_euler(const real t0_mjd, std::string iauFrame, real *euler){
cdec0 = -6.163;
cw0 = 302.695;
cw1 = 56.3625225;
} else if (iauFrame == "IAU_BENNU"){
// from https://naif.jpl.nasa.gov/pub/naif/pds/pds4/orex/orex_spice/spice_kernels/pck/bennu_v17.tpc
// BODY2101955_POLE_RA = ( 85.45864 0. 0. )
// BODY2101955_POLE_DEC = ( -60.36468 0. 0. )
// BODY2101955_PM = ( 150.48977 2011.143058731885 2.0E-06 )
cra0 = 85.45864;
cdec0 = -60.36468;
cw0 = 150.48977;
cw1 = 2011.143058731885;
cw2 = 2.0e-06;
} else {
throw std::runtime_error("iau_to_euler: The IAU frame is not supported.");
}
Expand Down Expand Up @@ -713,7 +723,8 @@ void get_pck_rotMat(const std::string &from, const std::string &to,
"IAU_EARTH", "IAU_MOON",
"IAU_MARS", "IAU_JUPITER",
"IAU_SATURN", "IAU_URANUS",
"IAU_NEPTUNE", "IAU_PLUTO"};
"IAU_NEPTUNE", "IAU_PLUTO",
"IAU_BENNU"};
// make sure either from or to frame is J2000
int bodyFrameIdx = -1;
if (from == "J2000"){
Expand Down

0 comments on commit 6a32602

Please sign in to comment.