ska-sa / astrokat

General observation framework for the MeerKAT telescope
BSD 2-Clause "Simplified" License
2 stars 4 forks source link

Improve reference pointing functionality #116

Closed bngcebetsha closed 1 year ago

bngcebetsha commented 1 year ago

The function call to reference_pointing_scan was placed among the "scans" and led to a confusion in how many tracks of the target during calls reversescan. We now move the check if the observation is "reference_pointing" to earlier in our logic.

Reference pointing gives the expected telstateError result - http://10.8.67.104:8081/tailtask/20230206-0001/progress

Before fix

MASTER.txt

After fix

after_fix.txt

JIRA: MT-3289

lanceWilliams commented 1 year ago

@bngcebetsha could you explain why casting the function output to bool fixes the testing issue?

bngcebetsha commented 1 year ago

@bngcebetsha could you explain why casting the function output to bool fixes the testing issue?

hi @lanceWilliams ,....the targets_visible variable is of type bool and for some slews in the test, targets_visible is None - which causes failures "cannot use + operator on NoneType" sort of error.

I tested out what the return value is if I do bool(None) and the answer is False....I think this is safe to do as True + False = True.

ludwigschwardt commented 1 year ago

Hi @bngcebetsha, why is targets_visible None? Let's see if we can rather fix that instead, instead of casting None to False...

bngcebetsha commented 1 year ago

Hi @bngcebetsha, why is targets_visible None? Let's see if we can rather fix that instead, instead of casting None to False...

@ludwigschwardt I agree, this is how I run the tests

python3 -m venv env
source env/bin/activate
pip install -e .

$ python -m unittest astrokat.test.test_scans

spassmoor commented 1 year ago

Yes the changes look Good