Skip to content

Commit

Permalink
Merge branch 'simonsobs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
chervias authored Oct 10, 2023
2 parents 5980881 + 1d3eb9d commit c44d40e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
pyshort: "310"
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.0
with:
access_token: ${{ github.token }}

Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
# pyshort: "310"
# steps:
# - name: Cancel Previous Runs
# uses: styfle/cancel-workflow-action@0.11.0
# uses: styfle/cancel-workflow-action@0.12.0
# with:
# access_token: ${{ github.token }}

Expand Down
6 changes: 6 additions & 0 deletions sotodlib/coords/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@ def get_wcs_kernel(proj, ra=None, dec=None, res=None):
if proj == 'car':
wcs.wcs.crpix = [1.0, 0.5]

# Check if the resolution is sensible, for SHTs
res = res * 180./np.pi # Easier to do this check in degs
div = 90./res - np.round(90./res)
if abs(div) > 1e-8:
raise ValueError(f"The requested resolution {res} deg does not divide 90 deg evenly.")

return wcs


Expand Down
6 changes: 5 additions & 1 deletion sotodlib/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ def get_glitch_flags(
)
# get the threshods based on n_sig x nlev = n_sig x iqu x 0.741
fvec = np.abs(fvec)
iqr_range = 0.741 * stats.iqr(fvec, axis=1)
if fvec.shape[1] > 50000:
ds = int(fvec.shape[1]/20000)
else:
ds = 1
iqr_range = 0.741 * stats.iqr(fvec[:,::ds], axis=1)
# get flags
msk = fvec > iqr_range[:, None] * n_sig
flag = RangesMatrix([Ranges.from_bitmask(m) for m in msk])
Expand Down
8 changes: 6 additions & 2 deletions sotodlib/io/bookbinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@ def bind(self, outdir, times, frame_idxs, file_idxs):
if 'Corrected_Azimuth' in block.data:
az = np.interp(times, block.times, block.data['Corrected_Azimuth'])
el = np.interp(times, block.times, block.data['Corrected_Elevation'])
if 'Corrected_Corotation' in block.data:
boresight = np.interp(times, block.times, block.data['Corrected_Boresight'])
if 'Corrected_Boresight' in block.data:
boresight = np.interp(
times,
block.times,
block.data['Corrected_Boresight']
)
if 'Corrected_Corotation' in block.data:
corotation = np.interp(times, block.times, block.data['Corrected_Corotation'])

Expand Down
2 changes: 2 additions & 0 deletions sotodlib/site_pipeline/preprocess_tod.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sotodlib.site_pipeline.util as sp_util
from sotodlib.preprocess import _Preprocess, PIPELINE, processes

logger = sp_util.init_logger("preprocess")

def _build_pipe_from_configs(configs):
pipe = []
Expand Down Expand Up @@ -248,6 +249,7 @@ def main(
configs, context = _get_preprocess_context(configs)
if logger is None:
logger = sp_util.init_logger("preprocess")
globals()['logger'] = logger

if obs_id is not None:
tot_query = f"obs_id=='{obs_id}'"
Expand Down

0 comments on commit c44d40e

Please sign in to comment.