sot / sparkles

ACA review of star catalogs from proseco
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Allow opening a pickle from Noodle/OCCweb #171

Closed taldcroft closed 2 years ago

taldcroft commented 2 years ago

Description

Prelim pickles are often provided just as a Noodle directory where the file lives. This can take a few clicks to unwind, so this PR allows providing just the path that is provided.

Interface impacts

None (but more flexibility in specifying load_name option).

Testing

Unit tests

Functional tests

(ska3-2022.4) ➜  sparkles git:(open-from-noodle) ✗ python -m sparkles '\\noodle\GRETA\mission\Backstop\ScheduleWorkspaces\MAY0922\aca' --open-html
Processing obsid 45509
Processing obsid 45508
...
Processing obsid 25290
Processing obsid 45488
Writing output review file MAY0922_ACA_prelim_2022_117_10_48_40_240_sparkles/index.html
Open URL in browser: file:///Users/aldcroft/git/sparkles/MAY0922_ACA_prelim_2022_117_10_48_40_240_sparkles/index.html
(ska3-2022.4) ➜  sparkles git:(open-from-noodle) ✗ python -m sparkles '\\noodle\GRETA\mission\Backstop\ScheduleWorkspaces\MAY0922\aca\MAY0922_ACA_prelim_2022_117_10_48_40_240.pkl.gz'        
Processing obsid 45509
Processing obsid 45508
...
Processing obsid 25290
Processing obsid 45488
Writing output review file MAY0922_ACA_prelim_2022_117_10_48_40_240_sparkles/index.html
(ska3-2022.4) ➜  sparkles git:(open-from-noodle) ✗ python -m sparkles https://occweb.cfa.harvard.edu/occweb/FOT/mission_planning/Backstop/ScheduleWorkspaces/MAY0922/aca/
Processing obsid 45509
Processing obsid 45508
...
Processing obsid 25290
Processing obsid 45488
Writing output review file MAY0922_ACA_prelim_2022_117_10_48_40_240_sparkles/index.html```
(ska3-2022.4) ➜  sparkles git:(open-from-noodle) ✗ python -m sparkles https://occweb.cfa.harvard.edu/occweb/FOT/mission_planning/Backstop/ScheduleWorkspaces/MAY0922/aca/MAY0922_ACA_prelim_2022_117_10_48_40_240.pkl.gz
Processing obsid 45509
Processing obsid 45508
...
Processing obsid 25290
Processing obsid 45488
Writing output review file MAY0922_ACA_prelim_2022_117_10_48_40_240_sparkles/index.html```
(ska3-2022.4) ➜  sparkles git:(open-from-noodle) ✗ python -m sparkles junk/APR2020P_2020_100_13_02_31_705.pkl.gz
Reading pickle file junk/APR2020P_2020_100_13_02_31_705.pkl.gz
Processing obsid 47275
Processing obsid 47274
...
Processing obsid -13153
Processing obsid 22544.1
Writing output review file APR2020P_2020_100_13_02_31_705_sparkles/index.html
(ska3-2022.4) ➜  sparkles git:(open-from-noodle) ✗ python -m sparkles junk/APR2020P_2020_100_13_02_31_705       
Reading pickle file junk/APR2020P_2020_100_13_02_31_705.pkl.gz
Processing obsid 47275
Processing obsid 47274
...
Processing obsid -13153
Processing obsid 22544.1
Writing output review file APR2020P_2020_100_13_02_31_705_sparkles/index.html

Multiple files

I could not find a directory on noodle with multiple pickle files, so for this test I temporarily modified the code to run the selection block for len(pkl_files) >= 1 instead of len(pkl_files) > 1:

(ska3-2022.4) ➜  sparkles git:(open-from-noodle) ✗ python -m sparkles '\\noodle\GRETA\mission\Backstop\ScheduleWorkspaces\MAY0922\aca'
Found multiple pickle files for \\noodle\GRETA\mission\Backstop\ScheduleWorkspaces\MAY0922\aca:
  0: MAY0922_ACA_prelim_2022_117_10_48_40_240.pkl.gz
Enter choice: 0
Processing obsid 45509
Processing obsid 45508
...
Processing obsid 25290
Processing obsid 45488
Writing output review file MAY0922_ACA_prelim_2022_117_10_48_40_240_sparkles/index.html
taldcroft commented 2 years ago

I just merged this because I need it for subsequent development but please continue with the review.