EranOfek / AstroPack

Astronomy & Astrophysics Software Pacakge
Other
19 stars 4 forks source link

Scheduler: Selecting targets after ingesting ToO targets leads to crash #524

Closed RuslanKonno closed 1 week ago

RuslanKonno commented 1 week ago

Steps to reproduce on e.g. last0

S=telescope.Scheduler S.loadTable('/home/ocs/Scheduler/ObservationSchedule.csv','replace') S.loadTable('/home/ocs/ToOs/output/ToO.csv','merge_replace') [TargetInd, Priority, Tbl, Struct] = S.selectTarget(2460633.16,'MountNum',3, 'SelectMethod','minam')

Error:

Matrix dimensions must agree.

Error in telescope.Scheduler/weight (line 1912)
            Flag_HA = HA_Day> Obj.List.Catalog.MinHA1 & HA_Day<Obj.List.Catalog.MaxHA1 & Obj.List.Catalog.NightCounter==0;

Error in telescope.Scheduler/selectTarget (line 1809)
            W   = Obj.weight(JD);

Looks like Obj.HA only knows the pre-ToO target list and is compared against the post-ToO target list, so the matrix dimensions are different and the > operator throws an error.

EranOfek commented 1 week ago

The problem was that the RA and Dec properties were not updated after the list was changed. The setter of the list is now take care of that, and also verified that the RA/Dec will be saved as double instead of table. [dev1 98d78b0f9]