Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke-takase committed Nov 25, 2024
1 parent a619c26 commit c9f4a12
Show file tree
Hide file tree
Showing 218 changed files with 50,252 additions and 22 deletions.
Binary file added docs/build/doctrees/appendix.doctree
Binary file not shown.
Binary file added docs/build/doctrees/bibliography.doctree
Binary file not shown.
Binary file added docs/build/doctrees/data_layout.doctree
Binary file not shown.
Binary file added docs/build/doctrees/detectors.doctree
Binary file not shown.
Binary file added docs/build/doctrees/dipole.doctree
Binary file not shown.
Binary file added docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/build/doctrees/gaindrifts.doctree
Binary file not shown.
Binary file added docs/build/doctrees/hwp.doctree
Binary file not shown.
Binary file added docs/build/doctrees/hwp_sys.doctree
Binary file not shown.
Binary file added docs/build/doctrees/imo.doctree
Binary file not shown.
Binary file added docs/build/doctrees/index.doctree
Binary file not shown.
Binary file added docs/build/doctrees/installation.doctree
Binary file not shown.
Binary file added docs/build/doctrees/integrating.doctree
Binary file not shown.
Binary file added docs/build/doctrees/map_scanning.doctree
Binary file not shown.
Binary file added docs/build/doctrees/mapmaking.doctree
Binary file not shown.
Binary file added docs/build/doctrees/mpi.doctree
Binary file not shown.
Binary file added docs/build/doctrees/noise.doctree
Binary file not shown.
Binary file added docs/build/doctrees/non_linearity.doctree
Binary file not shown.
Binary file added docs/build/doctrees/observations.doctree
Binary file not shown.
Binary file added docs/build/doctrees/part1.doctree
Binary file not shown.
Binary file added docs/build/doctrees/part2.doctree
Binary file not shown.
Binary file added docs/build/doctrees/part3.doctree
Binary file not shown.
Binary file added docs/build/doctrees/part4.doctree
Binary file not shown.
Binary file added docs/build/doctrees/part5.doctree
Binary file not shown.
Binary file added docs/build/doctrees/part6.doctree
Binary file not shown.
Binary file added docs/build/doctrees/plot_fp.doctree
Binary file not shown.
Binary file added docs/build/doctrees/pointing_sys.doctree
Binary file not shown.
Binary file added docs/build/doctrees/profiling.doctree
Binary file not shown.
Binary file added docs/build/doctrees/quaternions.doctree
Binary file not shown.
Binary file added docs/build/doctrees/random_numbers.doctree
Binary file not shown.
Binary file added docs/build/doctrees/reports.doctree
Binary file not shown.
Binary file added docs/build/doctrees/scanning.doctree
Binary file not shown.
Binary file added docs/build/doctrees/simulations.doctree
Binary file not shown.
Binary file added docs/build/doctrees/singularity.doctree
Binary file not shown.
Binary file added docs/build/doctrees/sky_maps.doctree
Binary file not shown.
Binary file added docs/build/doctrees/tutorial.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 4c494d747a2a3309a821e12e38277420
tags: 645f666f9bcd5a90fca523b33c5a78b7
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import numpy as np
import litebird_sim as lbs
from astropy.time import Time
import matplotlib.pylab as plt

orbit = lbs.SpacecraftOrbit(start_time=Time("2023-01-01"))

posvel = lbs.spacecraft_pos_and_vel(
orbit,
start_time=orbit.start_time,
time_span_s=3.15e7, # One year
delta_time_s=86_400.0, # One day
)

# posvel.positions_km is a N×3 array containing the XYZ position
# of the spacecraft calculated every day for one year. We compute
# the modulus of the position, which is of course the
# Sun-LiteBIRD distance.
sun_distance_km = np.linalg.norm(posvel.positions_km, axis=1)

# We do the same with the velocities
speed_km_s = np.linalg.norm(posvel.velocities_km_s, axis=1)

# Plot distance and speed as functions of time
_, ax = plt.subplots(nrows=2, ncols=1, figsize=(7, 7))

ax[0].plot(sun_distance_km)
ax[0].set_xlabel("Day")
ax[0].set_ylabel("Distance [km]")

ax[1].plot(speed_km_s)
ax[1].set_xlabel("Day")
ax[1].set_ylabel("Speed [km/s]")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import numpy as np
import litebird_sim as lbs
from astropy.time import Time
import matplotlib.pyplot as plt

start_time = Time("2034-05-02")
duration_s = 100
sampling_freq_Hz = 1

# Creating a list of detectors. The three detectors belong to two
# different wafer groups.
dets = [
lbs.DetectorInfo(
name="det_A_wafer_1", sampling_rate_hz=sampling_freq_Hz, wafer="wafer_1"
),
lbs.DetectorInfo(
name="det_B_wafer_1", sampling_rate_hz=sampling_freq_Hz, wafer="wafer_1"
),
lbs.DetectorInfo(
name="det_C_wafer_2", sampling_rate_hz=sampling_freq_Hz, wafer="wafer_2"
),
]

# Defining the gain drift simulation parameters with no detector mismatch
drift_params_no_mismatch = lbs.GainDriftParams(
drift_type=lbs.GainDriftType.THERMAL_GAIN,
focalplane_group="wafer",
detector_mismatch=0.0,
)

# Defining the gain drift simulation parameters with detector mismatch
drift_params_with_mismatch = lbs.GainDriftParams(
drift_type=lbs.GainDriftType.THERMAL_GAIN,
focalplane_group="wafer",
detector_mismatch=1.0,
)

sim1 = lbs.Simulation(
start_time=start_time,
duration_s=duration_s,
random_seed=12345,
)

sim1.create_observations(
detectors=dets,
split_list_over_processes=False,
num_of_obs_per_detector=1,
)

sim1.observations[0].thermalgain_tod_no_mismatch = np.ones_like(
sim1.observations[0].tod
)
sim1.observations[0].thermalgain_tod_with_mismatch = np.ones_like(
sim1.observations[0].tod
)

# Generating the gain drift factors with no detector mismatch
sim1.apply_gaindrift(
drift_params=drift_params_no_mismatch,
component="thermalgain_tod_no_mismatch",
user_seed=12345,
)

# Generating the gain drift factors with detector mismatch
sim1.apply_gaindrift(
drift_params=drift_params_with_mismatch,
component="thermalgain_tod_with_mismatch",
user_seed=12345,
)

plt.figure(figsize=(8, 10))

plt.subplot(211)
for idx in range(sim1.observations[0].tod.shape[0]):
plt.plot(
sim1.observations[0].thermalgain_tod_no_mismatch[idx],
label=sim1.observations[0].name[idx],
)

plt.xlabel("Time (in seconds)")
plt.ylabel("Linear gain factor amplitude")
plt.title("Thermal gain drift factor with no detector mismatch")
plt.legend()

plt.subplot(212)
for idx in range(sim1.observations[0].tod.shape[0]):
plt.plot(
sim1.observations[0].thermalgain_tod_with_mismatch[idx],
label=sim1.observations[0].name[idx],
)

plt.xlabel("Time (in seconds)")
plt.ylabel("Linear gain factor amplitude")
plt.title("Thermal gain drift factor with detector mismatch")
plt.legend()
plt.tight_layout()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import litebird_sim as lbs
import matplotlib.pylab as plt

# Generate the «model» (i.e., ideal band, with no wiggles)
band = lbs.BandPassInfo(
bandcenter_ghz=43.0,
bandwidth_ghz=10.0,
bandtype="top-hat-cosine",
normalize=True,
nsamples_inband=100,
)
plt.plot(band.freqs_ghz, band.weights, label="Ideal band")

# Now generate a more realistic band with random wiggles
new_weights = band.bandpass_resampling()
plt.plot(
band.freqs_ghz,
new_weights,
label="Random realization",
)

plt.xlabel("Frequency [GHz]")
plt.ylabel("Weight")
plt.legend()
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import numpy as np
import litebird_sim as lbs
from astropy.time import Time
import matplotlib.pyplot as plt

start_time = Time("2034-05-02")
duration_s = 4 * 24 * 3600
sampling_freq_Hz = 1

# Creating a list of detectors.
dets = [
lbs.DetectorInfo(
name="det_A_wafer_1", sampling_rate_hz=sampling_freq_Hz, wafer="wafer_1"
),
lbs.DetectorInfo(
name="det_B_wafer_1", sampling_rate_hz=sampling_freq_Hz, wafer="wafer_1"
),
]

# Defining the gain drift simulation parameters
drift_params = lbs.GainDriftParams(
drift_type=lbs.GainDriftType.LINEAR_GAIN,
calibration_period_sec=24 * 3600,
)

sim1 = lbs.Simulation(
start_time=start_time,
duration_s=duration_s,
random_seed=12345,
)

sim1.create_observations(
detectors=dets,
split_list_over_processes=False,
num_of_obs_per_detector=1,
)

sim1.observations[0].lingain_tod = np.ones_like(sim1.observations[0].tod)

# Applying gain drift using the `Simulation` class method
sim1.apply_gaindrift(
drift_params=drift_params,
component="lingain_tod",
)

plt.figure(figsize=(8, 5))

time_domain = (
np.arange(sim1.observations[0].tod.shape[1]) / sampling_freq_Hz / 24 / 3600
)

for idx in range(sim1.observations[0].tod.shape[0]):
plt.plot(
time_domain,
sim1.observations[0].lingain_tod[idx],
label=sim1.observations[0].name[idx],
)

plt.xlabel("Time (in days)")
plt.ylabel("Linear gain factor amplitude")
plt.legend()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from astropy.time import Time
import numpy as np
import litebird_sim as lbs
import matplotlib.pylab as plt

start_time = Time("2022-01-01")
time_span_s = 120.0 # Two minutes
sampling_hz = 20

sim = lbs.Simulation(start_time=start_time, duration_s=time_span_s, random_seed=12345)

# We pick a simple scanning strategy where the spin axis is aligned
# with the Sun-Earth axis, and the spacecraft spins once every minute
sim.set_scanning_strategy(
lbs.SpinningScanningStrategy(
spin_sun_angle_rad=np.deg2rad(0),
precession_rate_hz=0,
spin_rate_hz=1 / 60,
start_time=start_time,
),
delta_time_s=5.0,
)

# We simulate an instrument whose boresight is perpendicular to
# the spin axis.
sim.set_instrument(
lbs.InstrumentInfo(
boresight_rotangle_rad=0.0,
spin_boresight_angle_rad=np.deg2rad(90),
spin_rotangle_rad=np.deg2rad(75),
)
)

# A simple detector looking along the boresight direction
det = lbs.DetectorInfo(
name="Boresight_detector",
sampling_rate_hz=sampling_hz,
bandcenter_ghz=100.0,
)

(obs,) = sim.create_observations(detectors=[det])

sim.prepare_pointings()

# Simulate the orbit of the spacecraft and compute positions and
# velocities
orbit = lbs.SpacecraftOrbit(obs.start_time)
pos_vel = lbs.spacecraft_pos_and_vel(orbit, obs, delta_time_s=60.0)

t = obs.get_times()
t -= t[0] # Make `t` start from zero

# Create two plots: the first shows the full two-minute time span, and
# the second one shows a zoom over the very first points of the TOD.
_, axes = plt.subplots(nrows=2, ncols=1, figsize=(10, 12))

# Make a plot of the TOD using all the dipole types
for type_idx, dipole_type in enumerate(lbs.DipoleType):
obs.tod[0][:] = 0 # Reset the TOD
lbs.add_dipole_to_observations(obs, pos_vel, dipole_type=dipole_type)

axes[0].plot(t, obs.tod[0], label=str(dipole_type))
axes[1].plot(t[0:20], obs.tod[0][0:20], label=str(dipole_type))

axes[0].set_xlabel("Time [s]")
axes[0].set_ylabel("Signal [K]")
axes[1].set_xlabel("Time [s]")
axes[1].set_ylabel("Signal [K]")
axes[1].legend()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/build/html/_images/bandpass_demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/build/html/_images/coordinate-systems.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c9f4a12

Please sign in to comment.