Skip to content

Commit

Permalink
fix syntax in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Morris committed Oct 8, 2024
1 parent 52bebe2 commit 0ee4aae
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 56 deletions.
76 changes: 35 additions & 41 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,40 @@ maria

*maria blows the stars around / and sends the clouds a-flyin’*

.. raw:: html
<audio controls="controls">
<source src="./_static/they_call_the_wind_maria.mp4" type="audio/wav">
Your browser does not support the <code>audio</code> element.
</audio>

``maria`` is a complete simulator of ground-based millimeter- and submillimeter-wave telescopes. Tutorials for installation and usage can be found in the `documentation <https://www.thomaswmorris.com/maria>`_.

.. Background
.. ----------
.. Atmospheric modeling is an important step in both experiment design and
.. subsequent data analysis for ground-based cosmological telescopes
.. observing the cosmic microwave background (CMB). The next generation of
.. ground-based CMB experiments will be marked by a huge increase in data
.. acquisition: telescopes like `AtLAST <https://www.atlast.uio.no>`_ and
.. `CMB-S4 <https://cmb-s4.org>`_ will consist of hundreds of thousands of
.. superconducting polarization-sensitive bolometers sampling the sky. This
.. necessitates new methods of efficiently modeling and simulating
.. atmospheric emission at small angular resolutions, with algorithms than
.. can keep up with the high throughput of modern telescopes.
.. maria simulates layers of turbulent atmospheric emission according to a
.. statistical model derived from observations of the atmosphere in the
.. Atacama Desert, from the `Atacama Cosmology Telescope
.. (ACT) <https://lambda.gsfc.nasa.gov/product/act/>`_ and the `Atacama
.. B-Mode Search (ABS) <https://lambda.gsfc.nasa.gov/product/abs/>`_. It
.. uses a sparse-precision auto-regressive Gaussian process algorithm that
.. allows for both fast simulation of high-resolution atmosphere, as well
.. as the ability to simulate arbitrarily long periods of atmospheric
.. evolution.
.. Methodology
.. -----------
.. ``maria`` auto-regressively simulates an multi-layeed two-dimensional
.. “integrated” atmospheric model that is much cheaper to compute than a
.. three-dimensional model, which can effectively describe time-evolving
.. atmospheric emission. maria can thus effectively simulate correlated
.. atmospheric emission for in excess of 100,000 detectors observing the
.. sky concurrently, at resolutions as fine as one arcminute. The
.. atmospheric model used is detailed
.. `here <https://arxiv.org/abs/2111.01319>`_.
Background
----------

Atmospheric modeling is an important step in both experiment design and
subsequent data analysis for ground-based cosmological telescopes
observing the cosmic microwave background (CMB). The next generation of
ground-based CMB experiments will be marked by a huge increase in data
acquisition: telescopes like `AtLAST <https://www.atlast.uio.no>`_ and
`CMB-S4 <https://cmb-s4.org>`_ will consist of hundreds of thousands of
superconducting polarization-sensitive bolometers sampling the sky. This
necessitates new methods of efficiently modeling and simulating
atmospheric emission at small angular resolutions, with algorithms than
can keep up with the high throughput of modern telescopes.

maria simulates layers of turbulent atmospheric emission according to a
statistical model derived from observations of the atmosphere in the
Atacama Desert, from the `Atacama Cosmology Telescope
(ACT) <https://lambda.gsfc.nasa.gov/product/act/>`_ and the `Atacama
B-Mode Search (ABS) <https://lambda.gsfc.nasa.gov/product/abs/>`_. It
uses a sparse-precision auto-regressive Gaussian process algorithm that
allows for both fast simulation of high-resolution atmosphere, as well
as the ability to simulate arbitrarily long periods of atmospheric
evolution.

Methodology
-----------

``maria`` auto-regressively simulates an multi-layeed two-dimensional
“integrated” atmospheric model that is much cheaper to compute than a
three-dimensional model, which can effectively describe time-evolving
atmospheric emission. maria can thus effectively simulate correlated
atmospheric emission for in excess of 100,000 detectors observing the
sky concurrently, at resolutions as fine as one arcminute. The
atmospheric model used is detailed
`here <https://arxiv.org/abs/2111.01319>`_.
14 changes: 6 additions & 8 deletions maria/coords/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,22 @@ def __init__(
if (np.ptp(self.time, axis=axis) > 0).any():
raise ValueError("Only the last axis can vary in time.")

ref_time = ttime.monotonic()
self.compute_transforms()
duration_ms = 1e3 * (ttime.monotonic() - ref_time)
logger.debug(
f"Initialized coordinates with shape {self.shape} in {int(duration_ms)} ms."
) # noqa

def compute_transforms(self):
ref_time = ttime.monotonic()

self.shaped_time = np.atleast_1d(self.time)
keep_dims = (-1,) if hasattr(self.time, "__len__") else ()
time_ordered_center_phi_theta = np.c_[
get_center_phi_theta(self._phi, self._theta, keep_dims=keep_dims)
]

# (nt) time samples on which to explicitly compute the transformation from astropy
time_samples_min_res_seconds = 5
time_samples_min_res_seconds = 10
time_samples_min = np.min(self.time) - 1e0
time_samples_max = np.max(self.time) + 1e0
n_time_samples = int(
Expand Down Expand Up @@ -214,11 +217,6 @@ def compute_transforms(self):
setattr(self, frames[frame]["phi"], frame_phi)
setattr(self, frames[frame]["theta"], frame_theta)

duration_ms = 1e3 * (ttime.monotonic() - ref_time)
logger.debug(
f"Initialized coordinates with shape {self.shape} in {int(duration_ms)} ms."
)

def downsample(self, timestep: float = None, factor: int = None):
if timestep is None and factor is None:
raise ValueError("You must supply either 'timestep' or 'factor'.")
Expand Down
2 changes: 1 addition & 1 deletion maria/instrument/array/configs/so.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sat-wafer:
n: 631
primary_size: 0.5
beam_spacing: 1.2
array_offset: [5.2, 9.0]
field_of_view: 10.0
array_shape: hex
Expand Down
8 changes: 4 additions & 4 deletions maria/map/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,14 @@ def to_fits(self, filepath):
self.header["comment"] = "Made Synthetic observations via maria code"
self.header["comment"] = "Overwrote resolution and size of the output map"

self.header["CDELT1"] = np.rad2deg(self.resolution)
self.header["CDELT2"] = np.rad2deg(self.resolution)
self.header["CDELT1"] = np.radians(self.resolution)
self.header["CDELT2"] = np.radians(self.resolution)

self.header["CRPIX1"] = self.n_x / 2
self.header["CRPIX2"] = self.n_y / 2

self.header["CRVAL1"] = np.rad2deg(self.center[0])
self.header["CRVAL2"] = np.rad2deg(self.center[1])
self.header["CRVAL1"] = np.radians(self.center[0])
self.header["CRVAL2"] = np.radians(self.center[1])

self.header["CTYPE1"] = "RA---SIN"
self.header["CTYPE2"] = "DEC--SIN"
Expand Down
8 changes: 6 additions & 2 deletions maria/tod/tod.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def __init__(
if self.weight is None:
self.weight = da.ones_like(self.signal)

self.boresight = self.coords.boresight()

def get_field(self, field: str):
if field not in self.fields:
raise ValueError(f"Field '{field}' not found.")
Expand All @@ -84,6 +82,12 @@ def get_field(self, field: str):

return d

@property
def boresight(self):
if not hasattr(self, "_boresight"):
self._boresight = self.coords.boresight()
return self._boresight

def to(self, units: str):
cal = self.dets.cal(f"{self.units} -> {units}")

Expand Down

0 comments on commit 0ee4aae

Please sign in to comment.