Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Morris committed Sep 26, 2024
1 parent ae18c6e commit 8b61a22
Show file tree
Hide file tree
Showing 31 changed files with 289 additions and 219 deletions.
21 changes: 0 additions & 21 deletions docs/source/calibration.rst

This file was deleted.

21 changes: 0 additions & 21 deletions docs/source/cmb.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ a-flyin’ <https://youtu.be/qKxgfnoz2pk>`_
``maria`` simulates celestial observations by ground-based millimeter- and submillimeter-wave arrays like `ALMA <https://en.wikipedia.org/wiki/Atacama_Large_Millimeter_Array>`_, `AtLAST <https://www.atlast.uio.no/>`_, and `MUSTANG-2 <https://greenbankobservatory.org/science/gbt-observers/mustang-2/>`_.

.. toctree::
:maxdepth: 2
:maxdepth: 3

installation.rst
usage.rst
Expand Down
78 changes: 0 additions & 78 deletions docs/source/instruments.rst

This file was deleted.

17 changes: 0 additions & 17 deletions docs/source/mapping.rst

This file was deleted.

17 changes: 0 additions & 17 deletions docs/source/maps.rst

This file was deleted.

17 changes: 0 additions & 17 deletions docs/source/noise.rst

This file was deleted.

13 changes: 0 additions & 13 deletions docs/source/plans.rst

This file was deleted.

16 changes: 6 additions & 10 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ Usage
=====

.. toctree::
:maxdepth: 2
:maxdepth: 3

simulations.rst
instruments.rst
sites.rst
plans.rst
atmosphere.rst
cmb.rst
maps.rst
noise.rst
mapping.rst
usage/instruments.rst
usage/sites.rst
usage/plans.rst
usage/simulations.rst
usage/mapping.rst
11 changes: 11 additions & 0 deletions docs/source/usage/instruments.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
===========
Instruments
===========

.. toctree::
:maxdepth: 2

instruments/index.rst
instruments/bands.rst
instruments/arrays.rst
instruments/noise.rst
39 changes: 39 additions & 0 deletions docs/source/usage/instruments/arrays.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

######
Arrays
######

To customize an array, we specify a field of view and add some `Band`.

.. code-block:: python
array = {"primary_size": 10 # in meters
"field_of_view": 0.5 # in degrees
"bands": [my_band],
}
When passed to `Instrument`, this will generate an array such that the beams do not overlap and fill up the field of view.
Instead of a `Band`, we can also pass a string that names a pre-defined band, or a mixture of the two.

.. code-block:: python
array = {"primary_size": 10 # in meters
"field_of_view": 0.5 # in degrees
"bands": [my_band, "mustang2/f093"],
}
Constructing an `Instrument` is then done as

.. code-block:: python
instrument = maria.get_instrument(array=array)
To construct an instrument with multiple subarrays, we can create a `dict` wherein each value is a valid array:


.. code-block:: python
subarrays = {"array1": {"array_offset": (0.1, 0), "field_of_view": 0.05, "bands": [f150]},
"array2": {"array_offset": (-0.1, 0), "field_of_view": 0.05, "bands": [f150]},}
instrument = maria.get_instrument(subarrays=subarrays)
13 changes: 13 additions & 0 deletions docs/source/usage/instruments/bands.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#####
Bands
#####

.. code-block:: python
from maria.instrument import Band
my_band = Band(center=150, # in GHz
width=30, # in GHz
efficiency=0.5
sensitivity=1e-5
)
24 changes: 24 additions & 0 deletions docs/source/usage/instruments/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
########
Overview
########

The observing instrument is instantiated as an ``Instrument``.
The simplest way to get an instrument is to grab a pre-defined one, e.g.:

.. code-block:: python
# The Atacama Cosmology Telescope
act = maria.get_instrument('ACT')
# The Atacama Large Millimeter Array
alma = maria.get_instrument('ALMA')
# MUSTANG-2
m2 = maria.get_instrument('MUSTANG-2')
To see the list of supported instruments, run

.. code-block:: python
print(maria.all_instruments)
32 changes: 32 additions & 0 deletions docs/source/usage/instruments/noise.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#####
Noise
#####

Noise is specified for a given band

.. code-block:: python
band_with_noise = Band(center=150,
width=30,
sensitivity=5e-5,
knee=1e0,
gain_error=1e-1)
We can also use the

.. code-block:: python
band_with_noise = Band(center=150,
width=30,
sensitivity=5e-5,
knee=1e0,
gain_error=1e-1)
Note that any sensitivity units are only implicit due to the imperfect efficiency (caused by the instrument and the atmosphere).
For a heuristic, the band implicitly assumes that we are observing the zenith at the ALMA site with a PWV of 1mm, and converts the given sensitivity to the corresponding noise equivalent power.
We can customize this by setting the sensitivity as

.. code-block:: python
my_band.set_sensitivity(1e-5, pwv=2, elevation=45, region="mauna_kea")
36 changes: 36 additions & 0 deletions docs/source/usage/mapping.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#######
Mapping
#######

We can map a ``TOD`` (or several of them) with a ``Mapper``. The simplest possible mapper just bins the data:

.. code-block:: python
from maria.map.mappers import BinMapper
mapper = BinMapper(center=(150, 10),
frame="ra_dec",
width=1e0,
height=1e0,
resolution=5e-3,
tod_preprocessing={
"window": {"tukey": {"alpha": 0.1}},
"remove_modes": {"n": 1},
"filter": {"f_lower": 0.01},
"despline": {"knot_spacing": 5},
},
map_postprocessing={
"gaussian_filter": {"sigma": 1},
"median_filter": {"size": 1},
},
units="K_RJ",
tods=[tod],
)
output_map = mapper.run()
where we define the preprocessing to be done on the ``TOD``. We can see the output with

.. code-block:: python
output_map.plot()
Loading

0 comments on commit 8b61a22

Please sign in to comment.