diff --git a/CITATION.cff b/CITATION.cff index 8e43a96..ab7f40f 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -33,5 +33,5 @@ keywords: - spectroscopy - submillimeter license: MIT -version: 2025.8.0 +version: 2025.10.0 date-released: '2025-08-18' diff --git a/README.md b/README.md index 36bea73..a404d3d 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ DESHIMA code for data analysis ## Installation ```shell -pip install decode==2025.8.0 +pip install decode==2025.10.0 ``` ## Quick look diff --git a/decode/__init__.py b/decode/__init__.py index 778e381..00bf3b0 100644 --- a/decode/__init__.py +++ b/decode/__init__.py @@ -11,7 +11,7 @@ "stats", "utils", ] -__version__ = "2025.8.0" +__version__ = "2025.10.0" # submodules diff --git a/decode/make.py b/decode/make.py index 1cdee06..9144c04 100644 --- a/decode/make.py +++ b/decode/make.py @@ -33,7 +33,8 @@ def cube( skycoord_units: Units of the sky coordinate axes. Returns: - Cube DataArray. + Cube DataArray. The weight coordinate is the inverse + variance of the input DEMS samples within each pixel. """ dems = convert.coord_units(dems, "lon", "deg") @@ -56,14 +57,20 @@ def cube( dems = dems.copy(data=dems.data) dems.coords.update({"index": index}) - gridded = dems.groupby("index").mean("time") + mean = dems.groupby("index").mean("time") + var = dems.groupby("index").var("time") data = np.full([n_lat * n_lon, n_chan], np.nan) - data[gridded.index.values] = gridded.values + data[mean.index.values] = mean.values data = data.reshape(n_lat, n_lon, n_chan).transpose(2, 0, 1) + weight = np.full([n_lat * n_lon, n_chan], np.nan) + weight[var.index.values] = 1 / var.values + weight = weight.reshape(n_lat, n_lon, n_chan).transpose(2, 0, 1) + cube = Cube.new( data=data, + weight=weight, lat=lat, lon=lon, chan=dems.chan, diff --git a/pyproject.toml b/pyproject.toml index e908458..2ce174b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "decode" -version = "2025.8.0" +version = "2025.10.0" description = "DESHIMA code for data analysis" readme = "README.md" keywords = [ diff --git a/uv.lock b/uv.lock index 407cac0..a35e5f9 100644 --- a/uv.lock +++ b/uv.lock @@ -535,7 +535,7 @@ wheels = [ [[package]] name = "decode" -version = "2025.8.0" +version = "2025.10.0" source = { editable = "." } dependencies = [ { name = "astropy", version = "6.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" },