Skip to content

Commit

Permalink
#191 Merge pull request from deshima-dev/issue186
Browse files Browse the repository at this point in the history
Add moving average (by DataArray.rolling) to qlook commands
  • Loading branch information
astropenguin authored Aug 6, 2024
2 parents 3556fc0 + f24d25e commit 8faf1fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions decode/qlook.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
DEFAULT_INCL_MKID_IDS = None
DEFAULT_MIN_FREQUENCY = None
DEFAULT_MAX_FREQUENCY = None
DEFAULT_ROLLING_TIME = 200
DEFAULT_OUTDIR = Path()
DEFAULT_OVERWRITE = False
DEFAULT_SKYCOORD_GRID = "6 arcsec"
Expand Down Expand Up @@ -121,6 +122,7 @@ def daisy(
max_frequency: Optional[str] = DEFAULT_MAX_FREQUENCY,
data_type: Literal["auto", "brightness", "df/f"] = DEFAULT_DATA_TYPE,
# options for analysis
rolling_time: int = DEFAULT_ROLLING_TIME,
source_radius: str = "60 arcsec",
chan_weight: Literal["uniform", "std", "std/tx"] = "std/tx",
pwv: Literal["0.5", "1.0", "2.0", "3.0", "4.0", "5.0"] = "5.0",
Expand Down Expand Up @@ -149,6 +151,7 @@ def daisy(
Defaults to no maximum frequency bound.
data_type: Data type of the input DEMS file.
Defaults to the ``long_name`` attribute in it.
rolling_time: Moving window size.
source_radius: Radius of the on-source area.
Other areas are considered off-source in sky subtraction.
chan_weight: Weighting method along the channel axis.
Expand Down Expand Up @@ -187,6 +190,10 @@ def daisy(
)
da = select.by(da, "state", exclude="GRAD")

### Rolling
da_rolled = da.rolling(time=int(rolling_time), center=True).mean()
da = da - da_rolled

# fmt: off
is_source = (
(da.lon**2 + da.lat**2)
Expand Down

0 comments on commit 8faf1fa

Please sign in to comment.