Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Morris committed May 22, 2024
1 parent 665f6f9 commit e059c81
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
4 changes: 2 additions & 2 deletions maria/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = "0.9.8.dev32"
__version_tuple__ = version_tuple = (0, 9, 8, "dev32")
__version__ = version = "1.0.0"
__version_tuple__ = version_tuple = (1, 0, 0)
2 changes: 1 addition & 1 deletion maria/instrument/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def plot(self, units=None):
ax.scatter(
*getattr(offsets, offsets.units)[band_mask].T,
label=uband,
s=5e-1,
s=0,
color=band_color,
)

Expand Down
4 changes: 2 additions & 2 deletions maria/map/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def plot(
vmin, vmax = np.interp([rel_vmin, rel_vmax], np.cumsum(w) / np.sum(w), d)

map_im = ax.imshow(
self.data.T,
self.data[i_freq].T,
cmap=cmap,
interpolation="none",
extent=map_extent,
Expand All @@ -188,4 +188,4 @@ def plot(
ax.set_ylabel(rf"$\Delta\,\theta_y$ [{units}]")

cbar = fig.colorbar(map_im, ax=ax, shrink=1.0)
cbar.set_label("mJy km/s/pixel")
cbar.set_label("RJ temperature [K]")
17 changes: 11 additions & 6 deletions maria/map/mappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,12 @@ def run(self):

for tod in self.tods:
# compute detector offsets WRT the map

dx, dy = tod.coords.offsets(frame=self.frame, center=self.center)

band_mask = tod.dets.band_name == band

if self.calibrate:
D = tod.data_calibrated.copy()[band_mask]
else:
D = tod.data.copy()[band_mask]
D = tod.cal[band_mask, None] * tod.data[band_mask]

# windowing
W = np.ones(D.shape[0])[:, None] * sp.signal.windows.tukey(
Expand Down Expand Up @@ -203,14 +201,15 @@ def run(self):
if "despline" in self.tod_postprocessing.keys():
B = utils.signal.get_bspline_basis(
tod.time.compute(),
dk=self.tod_postprocessing["despline"].get("knot_spacing", 10),
spacing=self.tod_postprocessing["despline"].get(
"knot_spacing", 10
),
order=self.tod_postprocessing["despline"].get(
"spline_order", 3
),
)

A = np.linalg.inv(B @ B.T) @ B @ WD.T

WD -= A.T @ B

map_sum = sp.stats.binned_statistic_2d(
Expand Down Expand Up @@ -261,6 +260,12 @@ def run(self):

self.map_weight[iband] = band_map_denom

# from maria.atmosphere import Spectrum

# spectrum = Spectrum(region=tod.metadata.region)

# transmission = spectrum.transmission(nu=150, zenith_pwv=tod.metadata.pwv, elevation=np.degrees(tod.coords.el))

self.map = Map(
data=self.map_data,
weight=self.map_weight,
Expand Down
6 changes: 6 additions & 0 deletions maria/sim/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import dask.array as da
import numpy as np
import pandas as pd # noqa
from todder import TOD
from todder.coords import Coordinates, dx_dy_to_phi_theta

Expand Down Expand Up @@ -144,4 +145,9 @@ def run(self, dtype=np.float32):
coords=self.coords,
)

tod.cal = 1 / self.instrument.dets.dP_dTRJ # takes the data to TRJ

# tod.metadata = pd.Series({"pwv": self.atmosphere.weather.pwv,
# "region": self.site.region})

return tod

0 comments on commit e059c81

Please sign in to comment.