Skip to content

Commit

Permalink
Mask FLG_INVALID points when assembling GDPs (workaround for #244)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpavogt committed Oct 7, 2022
1 parent 35ad070 commit 8d6b60b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/dvas/tools/gdps/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
from .gdps import combine
from ...plots import gdps as dpg
from ...plots import utils as dpu
from ...hardcoded import PRF_VAL, FLG_INCOMPATIBLE
#from ..tools import wrap_angle
from ...hardcoded import PRF_VAL, FLG_INCOMPATIBLE, FLG_INVALID

# Setup local logger
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -203,9 +202,9 @@ def gdp_incompatibilities(gdp_prfs, alpha=0.0027, m_vals=None, rolling=True,
raise DvasError(f'Ouch ! m_vals must be a list, not: {type(m_vals)}')

# If warranted select which flags we want to mask in the rolling process.
mask_flgs = None
mask_flgs = [FLG_INVALID]
if rolling:
mask_flgs = FLG_INCOMPATIBLE
mask_flgs += [FLG_INCOMPATIBLE]

# How many gdp Profiles do I have ?
n_prf = len(gdp_prfs)
Expand Down
5 changes: 3 additions & 2 deletions src/dvas_recipes/uaii2022/gdps.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from dvas.tools.gdps import stats as dtgs
from dvas.tools.gdps import gdps as dtgg
from dvas.hardcoded import PRF_TDT, PRF_ALT, PRF_VAL, PRF_UCR, PRF_UCS, PRF_UCT, PRF_UCU
from dvas.hardcoded import TAG_CWS, TAG_GDP, FLG_INCOMPATIBLE
from dvas.hardcoded import TAG_CWS, TAG_GDP, FLG_INCOMPATIBLE, FLG_INVALID
from dvas.errors import DBIOError

# Import from dvas_recipes
Expand Down Expand Up @@ -151,8 +151,9 @@ def build_cws(start_with_tags, m_vals=None, strategy='all-or-none', method='wei
index=valids[~valids[str(gdp_prf.info.oid)]].index)

# Let us now create a high-resolution CWS for these synchronized GDPs
# We shall mask any incompatible value, but also any invalid one (see e.g. #244)
cws, covmats = dtgg.combine(gdp_prfs, binning=1, method=method,
mask_flgs=FLG_INCOMPATIBLE,
mask_flgs=[FLG_INCOMPATIBLE, FLG_INVALID],
chunk_size=dynamic.CHUNK_SIZE, n_cpus=dynamic.N_CPUS)

# Let's tag this CWS in the same way as the GDPs, so I can find them easily together
Expand Down

0 comments on commit 8d6b60b

Please sign in to comment.