swiggumj/SchedScrape

Add MJD to output

Closed this issue · 9 comments

2020 Jul 25 (MJD 59055): 15:45 - 00:00: P2780 (Session A):

Ok... I need to take a break, but just implemented MJDs only. For the time being, you can pull the latest version and try something like ./SchedScrape.py --henriradovan -p P2780. That will give you a list of MJDs (most recent at the top) corresponding to sessions of your choice. It will match up perfectly with ./SchedScrape.py --all -p P2780. I'll make this cleaner soon. And probably will remove the reference to your name eventually...

And I'll wait to close this issue until the code does what you want it to! Also, is it necessary to have the information parsed the way you have it above? Or would something like the following be sufficient for your needs? E.g.
2020 Jul 25, 15:45 - 00:00, P2780, Session A, MJD 59055
Note that the way I've implemented so far includes MJDs with two decimals, because I thought that might be useful, but integers are easy too.

Thanks Joe, your suggestion for the output would work just fine. And having two decimals is a good idea.

Ok see README, but default functionality is now to print a CSV list of info including project, session, MJD, start (local), stop (local). Does this work @hradovan?

The output looks neat! BTW, I'm getting following ValueError when running it with the command "./SchedScrape.py -p P2780 --all":

Traceback (most recent call last):
File "./SchedScrape.py", line 566, in
main()
File "./SchedScrape.py", line 551, in main
x = Sched(FullSched)
File "./SchedScrape.py", line 90, in init
self.ConvertObsTimes()
File "./SchedScrape.py", line 162, in ConvertObsTimes
self.Duration = np.array([TimeDelta(t).to(u.hour).value for t in dt])
File "./SchedScrape.py", line 162, in
self.Duration = np.array([TimeDelta(t).to(u.hour).value for t in dt])
File "/home/rado/anaconda3/lib/python3.7/site-packages/astropy/time/core.py", line 1535, in init
self._init_from_vals(val, val2, format, scale, copy)
File "/home/rado/anaconda3/lib/python3.7/site-packages/astropy/time/core.py", line 330, in _init_from_vals
precision, in_subfmt, out_subfmt)
File "/home/rado/anaconda3/lib/python3.7/site-packages/astropy/time/core.py", line 374, in _get_time_fmt
raise ValueError('Input values did not match {0}'.format(err_msg))
ValueError: Input values did not match the format class jd

Huh that is bizarre... There is another bug I just found, though it's with the GBO sched scraper. I just tested and this works for me. Based on some quick googling, I'd start by trying to update your numpy/astropy installations. Past that, maybe we can touch base later this afternoon/tomorrow to address it. I'm not sure off the top of my head.

Thanks Joe, I was trying to "conda update astropy" and ran into the "ModuleNotFoundError: No module named 'conda'" problem, which is discussed a lot in forums. It seems to be a bug in conda and I need to read more about that.

Doh, ok. Let me know if there's anything I can do to help.

Clean install of conda (and thus, astropy I suspect) fixed it, though @hradovan showed me another bug, which I'll address in a a separate issue.