def z_lambda(sigma_trace, xi, p0, planet_radius, mass, T, planet_mass, sigma_filler=False): ''' Parameters ---------- sigma_trace: array Absorption cross section of atmosphere species as a function of wavelength p0: float Reference pressure of atmosphere; pressure at z=0 planet_radius: float Minimum radius of planet mass: float mass of trace atomic species T: float Effective temperature of planet planet_mass: float mass of the planet in earth masses Returns ------- z: float, array The amount by which the planet's occultation disk is increased by opacity of the atmosphere, as a function of wavelength. ''' # convert planet radius to meters r_p = r_earth * planet_radius # convert from bars to pa pressure = p0 * 100000 g = gravity(planet_mass, planet_radius) h = scale_h(mass, T, g) if sigma_filler is not None: # calculate average cross section sigma = (1 - xi) * sigma_filler + xi * sigma_trace else: # set volume mixing ratio to 1 xi = 1 sigma = sigma_trace # set equiv scale height to 1 tau_eq = 1 # calculate beta beta = pressure / tau_eq * np.sqrt(2 * np.pi * r_p) return h * np.log(sigma * 1 / np.sqrt(k * mass * amu_kg * T * g) * beta)
# Grab the initial position/velocity/effort. (initpos, initvel, initeff) = get_joints() # Define a command message, which will encode (save) the state of # the current commands. Start at the current values. cmdmsg = JointState() cmdmsg.header.stamp = rospy.Time.now() cmdmsg.name = fullnames cmdmsg.position = initpos cmdmsg.velocity = initvel cmdmsg.effort = initeff # Create a publisher to send commands to the robot. Allow initial # time for the subscriber to connect avoiding any missed commands. pub = rospy.Publisher('/hebiros/robot/command/joint_state', JointState, queue_size=10) rospy.sleep(0.4) pub.publish(cmdmsg) # Gradually change the effort to the gravity model. blocking_rampeffort(pub, cmdmsg, gravity(cmdmsg.position)) # Then move from the current (initial) to the nominal. blocking_moveto(pub, cmdmsg, [0.4, -0*math.pi/2, 0*math.pi/2], gravity) # Finally (continually) output the triangle wave. blocking_trianglewave(pub, cmdmsg, 1, 0.1, 2.0, gravity)