Skip to content

Commit

Permalink
#173 Merge pull request from deshima-dev/astropenguin/issue172
Browse files Browse the repository at this point in the history
Fix qlook options for min/max frequencies
  • Loading branch information
astropenguin authored Jul 14, 2024
2 parents a8ecf41 + 1f1964b commit 8d15c42
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion decode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"select",
"utils",
]
__version__ = "2.16.0"
__version__ = "2.16.1"


# submodules
Expand Down
32 changes: 17 additions & 15 deletions decode/qlook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <taniguchi@a.phys.nagoya-u.ac.jp>",
Expand Down

0 comments on commit 8d15c42

Please sign in to comment.