How to use the rebound.clibrebound.reb_hash function in rebound

To help you get started, we’ve selected a few rebound examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hannorein / rebound / rebound / units.py View on Github external
def hash_to_unit(hash):
    clibrebound.reb_hash.restype = c_uint32
    for u in times_SI.keys():
        uhash = clibrebound.reb_hash(c_char_p(u.encode("ascii")))
        if uhash == hash:
            return u
    for u in masses_SI.keys():
        uhash = clibrebound.reb_hash(c_char_p(u.encode("ascii")))
        if uhash == hash:
            return u
    for u in lengths_SI.keys():
        uhash = clibrebound.reb_hash(c_char_p(u.encode("ascii")))
        if uhash == hash:
            return u
    return None
github hannorein / rebound / rebound / simulation.py View on Github external
def update_units(self, newunits): 
        clibrebound.reb_hash.restype = c_uint32
        self.python_unit_l = clibrebound.reb_hash(c_char_p(newunits[0].encode("ascii")))
        self.python_unit_t = clibrebound.reb_hash(c_char_p(newunits[1].encode("ascii")))
        self.python_unit_m = clibrebound.reb_hash(c_char_p(newunits[2].encode("ascii")))
        self.G = convert_G(newunits)
github hannorein / rebound / rebound / simulation.py View on Github external
def update_units(self, newunits): 
        clibrebound.reb_hash.restype = c_uint32
        self.python_unit_l = clibrebound.reb_hash(c_char_p(newunits[0].encode("ascii")))
        self.python_unit_t = clibrebound.reb_hash(c_char_p(newunits[1].encode("ascii")))
        self.python_unit_m = clibrebound.reb_hash(c_char_p(newunits[2].encode("ascii")))
        self.G = convert_G(newunits)
github hannorein / rebound / rebound / simulation.py View on Github external
def update_units(self, newunits): 
        clibrebound.reb_hash.restype = c_uint32
        self.python_unit_l = clibrebound.reb_hash(c_char_p(newunits[0].encode("ascii")))
        self.python_unit_t = clibrebound.reb_hash(c_char_p(newunits[1].encode("ascii")))
        self.python_unit_m = clibrebound.reb_hash(c_char_p(newunits[2].encode("ascii")))
        self.G = convert_G(newunits)
github hannorein / rebound / rebound / simulation.py View on Github external
def update_units(self, newunits): 
        clibrebound.reb_hash.restype = c_uint32
        self.python_unit_l = clibrebound.reb_hash(c_char_p(newunits[0].encode("ascii")))
        self.python_unit_t = clibrebound.reb_hash(c_char_p(newunits[1].encode("ascii")))
        self.python_unit_m = clibrebound.reb_hash(c_char_p(newunits[2].encode("ascii")))
        self.G = convert_G(newunits)