diff --git a/CITATION.cff b/CITATION.cff index 1d1a083..52ebfce 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -3,8 +3,8 @@ message: "If you use this software, please cite it as below." title: "de:code" abstract: "DESHIMA code for data analysis" -version: 2.16.0 -date-released: 2024-07-13 +version: 2.16.1 +date-released: 2024-07-14 license: "MIT" doi: "10.5281/zenodo.3384216" url: "https://github.com/deshima-dev/decode" diff --git a/README.md b/README.md index 18a2a1e..ed44d80 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ DESHIMA code for data analysis ## Installation ```shell -pip install decode==2.16.0 +pip install decode==2.16.1 ``` ## Quick look diff --git a/decode/__init__.py b/decode/__init__.py index 46360cf..f40c5cd 100644 --- a/decode/__init__.py +++ b/decode/__init__.py @@ -10,7 +10,7 @@ "select", "utils", ] -__version__ = "2.16.0" +__version__ = "2.16.1" # submodules diff --git a/decode/qlook.py b/decode/qlook.py index 331194f..9ef0e85 100644 --- a/decode/qlook.py +++ b/decode/qlook.py @@ -1065,17 +1065,29 @@ def load_dems( """ da = load.dems(dems, chunks=None) + if min_frequency is not None: + min_frequency = Quantity(min_frequency).to(frequency_units).value + + if max_frequency is not None: + max_frequency = Quantity(max_frequency).to(frequency_units).value + if da.frame == "altaz": z = np.pi / 2 - convert.units(da.lat, "rad") secz = cast(xr.DataArray, 1 / np.cos(z)) - da = da.assign_coords( - secz=secz.assign_attrs( - long_name="sec(Z)", - units="dimensionless", - ) + secz=secz.assign_attrs(long_name="sec(Z)", units="dimensionless") ) + da = convert.coord_units( + da, + ["d2_mkid_frequency", "frequency"], + frequency_units, + ) + da = convert.coord_units( + da, + ["lat", "lat_origin", "lon", "lon_origin"], + skycoord_units, + ) da = assign.scan(da, by="state") da = convert.frame(da, "relative") da = select.by(da, "d2_mkid_type", "filter") @@ -1091,16 +1103,6 @@ def load_dems( min=min_frequency, max=max_frequency, ) - da = convert.coord_units( - da, - ["d2_mkid_frequency", "frequency"], - frequency_units, - ) - da = convert.coord_units( - da, - ["lat", "lat_origin", "lon", "lon_origin"], - skycoord_units, - ) if data_type == "auto" and "units" in da.attrs: return da diff --git a/pyproject.toml b/pyproject.toml index 3f02e57..90a20a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "decode" -version = "2.16.0" +version = "2.16.1" description = "DESHIMA code for data analysis" authors = [ "Akio Taniguchi ",