def draw_albedo_map(nside, view_map, bright_spot): nside = nside # map resolution # Gaussian process properties whitenoise_relative_amp = 0.02 length_scale = 30. * np.pi / 180 albedo_mean = .5 albedo_std = 0.2 # Draw a valid albedo map (i.e., 0 < albedo < 1) while True: simulated_map = draw_map(nside, albedo_mean, albedo_std, whitenoise_relative_amp, length_scale) if min(simulated_map) > 0 and max(simulated_map) < 1: break for i in range(0, simulated_map.size): if i == bright_spot: simulated_map[i] = 1.00 else: simulated_map[i] = 0.00 if view_map == True: hp.mollview(simulated_map, title='albedo', cmap='gist_gray') return simulated_map
from exocartographer import IlluminationMapPosterior from exocartographer.util import logit, inv_logit from astropy_healpix import HEALPix import pdb # Potential Nside values = 1,2,4,8 # Map: nside = 1 map = HEALPix(nside=nside, order='nested') whitenoise_relative_amp = 0.2 length_scale = 30 * np.pi / 2 albedo_mean = 0.5 albedo_std = 0.2 while True: one_point_map = draw_map(nside, albedo_mean, albedo_std, whitenoise_relative_amp, length_scale) if min(one_point_map) > 0 and max(one_point_map) < 1: break bright_spot = 1 for i in range(0, one_point_map.size): if i == bright_spot: one_point_map[i] = 1.00 else: one_point_map[i] = 0.00 # Parameters p_rotation = 1 p_orbit = 365.256363 lat, lng = map.healpix_to_lonlat([bright_spot]) w_rot = 2 * np.pi / p_rotation w_orb = 2 * np.pi / p_orbit
from exocartographer import IlluminationMapPosterior from exocartographer.util import logit, inv_logit import pdb from astropy_healpix import HEALPix # resolution nside = 4 # Gaussian process properties whitenoise_relative_amp = 0.02 length_scale = 30. * np.pi / 2 albedo_mean = 0.5 albedo_std = 0.2 # drawing an albedo map while True: simulated_map = draw_map(nside, albedo_mean, albedo_std, whitenoise_relative_amp, length_scale) if min(simulated_map) > 0 and max(simulated_map) < 1: break # # # simulating a map that's all black everywhere except for one bright spot # for i in range(0, simulated_map.size): if i == 100: simulated_map[i] = 1.00 else: simulated_map[i] = 0.000 hp.mollview(simulated_map, title='albedo', cmap='gist_gray') # obtaining the lon and lat of this point map = HEALPix(nside=nside, order='nested') pt_lng, pt_lat = map.healpix_to_lonlat([100])
import healpy as hp from exocartographer.gp_map import draw_map # Map resolution # The resolution is currently set to 1 (lowest) since we fit only only for the period # With this resolution, get 12 pixels # For the conversion between resolution and number of pixels, see exocartographer page on GitHub sim_nside = 1 # Gaussian process properties with which the map is generated # Those properties were kept the same as in the exocartographer tutorial sim_wn_rel_amp = 0.02 # Relative amplitude of white noise sim_length_scale = 30. * np.pi/180 # Length scale of the albedo features, in degrees sim_albedo_mean = .5 # Mean albedo, set to 0.5 for convenience (lower for Earth) sim_albedo_std = 0.25 # Standard deviation of albedo distribution # Draw a simplified albedo map, constrained between 0 and 1 while True: simulated_map = draw_map(sim_nside, sim_albedo_mean, sim_albedo_std, sim_wn_rel_amp, sim_length_scale) if min(simulated_map) > 0 and max(simulated_map) < 1: break # Visualize the map; the color can be changed by changing cmap hp.mollview(simulated_map, min=0, max=1, title='Simulated Albedo Map', cmap='gist_gray') # Save the albedo map in a csv file np.savetxt('sim_map.csv', simulated_map, delimiter=',')