From b06b4464dccd416a76d41161091a0f4c4ec91af3 Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Sat, 13 Jul 2024 20:29:41 +0000 Subject: [PATCH 1/4] #170 Use MKID master ID in channel selection --- decode/qlook.py | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/decode/qlook.py b/decode/qlook.py index fc322ff..a0091fe 100644 --- a/decode/qlook.py +++ b/decode/qlook.py @@ -30,15 +30,10 @@ # constants DATA_FORMATS = "csv", "nc", "zarr", "zarr.zip" DEFAULT_DATA_TYPE = "auto" -# fmt: off -DEFAULT_EXCL_MKID_IDS = ( - 0, 18, 26, 73, 130, 184, 118, 119, 201, 202, - 208, 214, 261, 266, 280, 283, 299, 304, 308, 321, -) -# fmt: on DEFAULT_FIGSIZE = 12, 4 DEFAULT_FORMAT = "png" DEFAULT_FREQUENCY_UNITS = "GHz" +DEFAULT_EXCL_MKID_IDS = None DEFAULT_INCL_MKID_IDS = None DEFAULT_OUTDIR = Path() DEFAULT_OVERWRITE = False @@ -126,7 +121,7 @@ def daisy( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. source_radius: Radius of the on-source area. @@ -252,7 +247,7 @@ def pswsc( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. frequency_units: Units of the frequency axis. @@ -333,7 +328,7 @@ def raster( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -450,7 +445,7 @@ def skydip( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -534,7 +529,7 @@ def still( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -617,7 +612,7 @@ def xscan( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -683,7 +678,7 @@ def yscan( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -749,7 +744,7 @@ def zscan( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -817,7 +812,7 @@ def _scan( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -978,7 +973,7 @@ def load_dems( include_mkid_ids: MKID IDs to be included in analysis. Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. - Defaults to bad MKID IDs found on 2023-11-19. + Defaults to no MKID IDs. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. frequency_units: Units of the frequency. @@ -1006,7 +1001,7 @@ def load_dems( da = select.by(da, "d2_mkid_type", "filter") da = select.by( da, - "d2_mkid_id", + "chan", include=include_mkid_ids, exclude=exclude_mkid_ids, ) From d55fc8c5ce501e13978ca8082753cce8a58382ae Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Sat, 13 Jul 2024 20:44:44 +0000 Subject: [PATCH 2/4] #170 Add qlook options for min/max frequencies --- decode/qlook.py | 86 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/decode/qlook.py b/decode/qlook.py index a0091fe..331194f 100644 --- a/decode/qlook.py +++ b/decode/qlook.py @@ -35,6 +35,8 @@ DEFAULT_FREQUENCY_UNITS = "GHz" DEFAULT_EXCL_MKID_IDS = None DEFAULT_INCL_MKID_IDS = None +DEFAULT_MIN_FREQUENCY = None +DEFAULT_MAX_FREQUENCY = None DEFAULT_OUTDIR = Path() DEFAULT_OVERWRITE = False DEFAULT_SKYCOORD_GRID = "6 arcsec" @@ -100,6 +102,8 @@ def daisy( # options for loading include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, # options for analysis source_radius: str = "60 arcsec", @@ -122,6 +126,10 @@ def daisy( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. source_radius: Radius of the on-source area. @@ -152,6 +160,8 @@ def daisy( dems, include_mkid_ids=include_mkid_ids, exclude_mkid_ids=exclude_mkid_ids, + min_frequency=min_frequency, + max_frequency=max_frequency, data_type=data_type, skycoord_units=skycoord_units, ) @@ -231,6 +241,8 @@ def pswsc( # options for loading include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, frequency_units: str = DEFAULT_FREQUENCY_UNITS, # options for saving @@ -248,6 +260,10 @@ def pswsc( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. frequency_units: Units of the frequency axis. @@ -268,6 +284,8 @@ def pswsc( dems, include_mkid_ids=include_mkid_ids, exclude_mkid_ids=exclude_mkid_ids, + min_frequency=min_frequency, + max_frequency=max_frequency, data_type=data_type, frequency_units=frequency_units, ) @@ -308,6 +326,8 @@ def raster( # options for loading include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, # options for analysis chan_weight: Literal["uniform", "std", "std/tx"] = "std/tx", @@ -329,6 +349,10 @@ def raster( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -357,6 +381,8 @@ def raster( dems, include_mkid_ids=include_mkid_ids, exclude_mkid_ids=exclude_mkid_ids, + min_frequency=min_frequency, + max_frequency=max_frequency, data_type=data_type, skycoord_units=skycoord_units, ) @@ -427,6 +453,8 @@ def skydip( # options for loading include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, # options for analysis chan_weight: Literal["uniform", "std", "std/tx"] = "std/tx", @@ -446,6 +474,10 @@ def skydip( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -472,6 +504,8 @@ def skydip( dems, include_mkid_ids=include_mkid_ids, exclude_mkid_ids=exclude_mkid_ids, + min_frequency=min_frequency, + max_frequency=max_frequency, data_type=data_type, ) @@ -511,6 +545,8 @@ def still( # options for loading include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, # options for analysis chan_weight: Literal["uniform", "std", "std/tx"] = "std/tx", @@ -530,6 +566,10 @@ def still( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -556,6 +596,8 @@ def still( dems, include_mkid_ids=include_mkid_ids, exclude_mkid_ids=exclude_mkid_ids, + min_frequency=min_frequency, + max_frequency=max_frequency, data_type=data_type, ) @@ -594,6 +636,8 @@ def xscan( # options for loading include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, # options for analysis chan_weight: Literal["uniform", "std", "std/tx"] = "std/tx", @@ -613,6 +657,10 @@ def xscan( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -640,6 +688,8 @@ def xscan( # options for loading include_mkid_ids=include_mkid_ids, exclude_mkid_ids=exclude_mkid_ids, + min_frequency=min_frequency, + max_frequency=max_frequency, data_type=data_type, # options for analysis chan_weight=chan_weight, @@ -660,6 +710,8 @@ def yscan( # options for loading include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, # options for analysis chan_weight: Literal["uniform", "std", "std/tx"] = "std/tx", @@ -679,6 +731,10 @@ def yscan( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -706,6 +762,8 @@ def yscan( # options for loading include_mkid_ids=include_mkid_ids, exclude_mkid_ids=exclude_mkid_ids, + min_frequency=min_frequency, + max_frequency=max_frequency, data_type=data_type, # options for analysis chan_weight=chan_weight, @@ -726,6 +784,8 @@ def zscan( # options for loading include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, # options for analysis chan_weight: Literal["uniform", "std", "std/tx"] = "std/tx", @@ -745,6 +805,10 @@ def zscan( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -772,6 +836,8 @@ def zscan( # options for loading include_mkid_ids=include_mkid_ids, exclude_mkid_ids=exclude_mkid_ids, + min_frequency=min_frequency, + max_frequency=max_frequency, data_type=data_type, # options for analysis chan_weight=chan_weight, @@ -793,6 +859,8 @@ def _scan( # options for loading include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, # options for analysis chan_weight: Literal["uniform", "std", "std/tx"] = "std/tx", @@ -813,6 +881,10 @@ def _scan( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. chan_weight: Weighting method along the channel axis. @@ -839,6 +911,8 @@ def _scan( dems, include_mkid_ids=include_mkid_ids, exclude_mkid_ids=exclude_mkid_ids, + min_frequency=min_frequency, + max_frequency=max_frequency, data_type=data_type, ) @@ -962,6 +1036,8 @@ def load_dems( *, include_mkid_ids: Optional[Sequence[int]] = DEFAULT_INCL_MKID_IDS, exclude_mkid_ids: Optional[Sequence[int]] = DEFAULT_EXCL_MKID_IDS, + min_frequency: Optional[str] = DEFAULT_MIN_FREQUENCY, + max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY, data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE, frequency_units: str = DEFAULT_FREQUENCY_UNITS, skycoord_units: str = DEFAULT_SKYCOORD_UNITS, @@ -974,6 +1050,10 @@ def load_dems( Defaults to all MKID IDs. exclude_mkid_ids: MKID IDs to be excluded in analysis. Defaults to no MKID IDs. + min_frequency: Minimum frequency to be included in analysis. + Defaults to no minimum frequency bound. + max_frequency: Maximum frequency to be included in analysis. + Defaults to no maximum frequency bound. data_type: Data type of the input DEMS file. Defaults to the ``long_name`` attribute in it. frequency_units: Units of the frequency. @@ -1005,6 +1085,12 @@ def load_dems( include=include_mkid_ids, exclude=exclude_mkid_ids, ) + da = select.by( + da, + "frequency", + min=min_frequency, + max=max_frequency, + ) da = convert.coord_units( da, ["d2_mkid_frequency", "frequency"], From 73f34040075d4a88000f154a642bdd429fc031e3 Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Sat, 13 Jul 2024 20:45:53 +0000 Subject: [PATCH 3/4] =?UTF-8?q?#170=20Update=20package=20version=20(2.15.0?= =?UTF-8?q?=20=E2=86=92=202.16.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CITATION.cff | 2 +- README.md | 2 +- decode/__init__.py | 2 +- pyproject.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 85d27e2..9cd0368 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -3,7 +3,7 @@ message: "If you use this software, please cite it as below." title: "de:code" abstract: "DESHIMA code for data analysis" -version: 2.15.0 +version: 2.16.0 date-released: 2024-07-07 license: "MIT" doi: "10.5281/zenodo.3384216" diff --git a/README.md b/README.md index da31a69..18a2a1e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ DESHIMA code for data analysis ## Installation ```shell -pip install decode==2.15.0 +pip install decode==2.16.0 ``` ## Quick look diff --git a/decode/__init__.py b/decode/__init__.py index 710753b..46360cf 100644 --- a/decode/__init__.py +++ b/decode/__init__.py @@ -10,7 +10,7 @@ "select", "utils", ] -__version__ = "2.15.0" +__version__ = "2.16.0" # submodules diff --git a/pyproject.toml b/pyproject.toml index 35a6f3b..3f02e57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "decode" -version = "2.15.0" +version = "2.16.0" description = "DESHIMA code for data analysis" authors = [ "Akio Taniguchi ", From f3f9318ea0979e3bb528db6a68aab97c95b839ae Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Sat, 13 Jul 2024 20:47:55 +0000 Subject: [PATCH 4/4] #160 Update release date --- CITATION.cff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CITATION.cff b/CITATION.cff index 9cd0368..1d1a083 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,7 +4,7 @@ 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-07 +date-released: 2024-07-13 license: "MIT" doi: "10.5281/zenodo.3384216" url: "https://github.com/deshima-dev/decode"