@@ -319,12 +319,12 @@ def _parse_opt_obs(optical_str):
319
319
"""
320
320
321
321
obs_table = Table .read (optical_str , format = "ascii.fixed_width_no_header" ,
322
- col_starts = [ 0 , 11 , 13 , 15 , 17 , 22 , 25 , 40 , 50 , 53 , 56 , 64 , 75 , 83 , 87 ,
323
- 95 , 103 , 106 , 110 , 117 , 128 , 136 , 140 , 147 , 156 , 161 , 164 ,
324
- 170 , 177 , 180 , 187 , 194 , 196 ],
325
- col_ends = [ 10 , 12 , 14 , 16 , 21 , 24 , 39 , 49 , 52 , 55 , 63 , 74 , 82 , 86 , 94 , 102 ,
326
- 105 , 109 , 116 , 127 , 135 , 139 , 146 , 155 , 160 , 163 , 169 , 176 , 179 ,
327
- 186 , 193 , 195 , 197 ],
322
+ col_starts = [0 , 11 , 13 , 15 , 17 , 22 , 25 , 40 , 50 , 53 , 56 , 64 , 75 , 83 , 87 ,
323
+ 95 , 103 , 106 , 110 , 117 , 128 , 136 , 140 , 147 , 156 , 161 , 164 ,
324
+ 170 , 177 , 180 , 187 , 194 , 196 ],
325
+ col_ends = [10 , 12 , 14 , 16 , 21 , 24 , 39 , 49 , 52 , 55 , 63 , 74 , 82 , 86 , 94 , 102 ,
326
+ 105 , 109 , 116 , 127 , 135 , 139 , 146 , 155 , 160 , 163 , 169 , 176 , 179 ,
327
+ 186 , 193 , 195 , 197 ],
328
328
names = ['Design.' , 'K' , 'T' , 'N' , 'Date' , 'MM' , 'DD.ddd' ,
329
329
'Date Accuracy' , 'RA HH' , 'RA MM' , 'RA SS.sss' , 'RA Accuracy' ,
330
330
'RA RMS' , 'RA F' , 'RA Bias' , 'RA Resid' , 'DEC sDD' , 'DEC MM' ,
@@ -402,14 +402,14 @@ def _parse_rov_obs(rov_str):
402
402
NOTE: THIS IS UNTESTED (can't find an object with these rows)
403
403
"""
404
404
405
- rov_table = Table .read (rov_str , format = "ascii.fixed_width_no_header" ,
405
+ rov_table = Table .read (rov_str , format = "ascii.fixed_width_no_header" ,
406
406
col_starts = [0 , 11 , 13 , 15 , 17 , 22 , 25 , 34 , 45 , 56 , 65 ],
407
407
col_ends = [10 , 12 , 14 , 16 , 21 , 24 , 33 , 44 , 55 , 64 , 68 ],
408
408
names = ['Design.' , 'K' , 'T' , 'N' , 'Date' , 'MM' , 'DD.dddddd' ,
409
409
'E longitude' , 'Latitude' , 'Altitude' , 'Obs Code' ])
410
410
411
411
# Combining the date column
412
- date_array = [f"{ x } /{ y } /{ z } " for x ,y , z in rov_table ["Date" , "MM" , "DD.dddddd" ]]
412
+ date_array = [f"{ x } /{ y } /{ z } " for x , y , z in rov_table ["Date" , "MM" , "DD.dddddd" ]]
413
413
rov_table ["Date" ] = convert_time (date_array , conversion_string = '%Y/%m/%d' )
414
414
rov_table .remove_columns (["MM" , "DD.dddddd" ])
415
415
@@ -426,15 +426,15 @@ def _parse_radar_obs(radar_str):
426
426
radar_str = radar_str [radar_str .find ('\n ' )+ 1 :] # First row is header
427
427
radar_table = Table .read (radar_str , format = "ascii.fixed_width_no_header" ,
428
428
col_starts = [0 , 11 , 13 , 15 , 17 , 22 , 25 , 28 , 37 , 54 , 64 ,
429
- 73 , 75 , 87 , 99 , 106 , 112 , 124 ],
429
+ 73 , 75 , 87 , 99 , 106 , 112 , 124 ],
430
430
col_ends = [10 , 12 , 14 , 16 , 21 , 24 , 27 , 36 , 53 , 63 , 72 ,
431
431
74 , 86 , 98 , 105 , 111 , 123 , 125 ],
432
- names = ["Design" , "K" , "T" , "N" , "Datetime" , "MM" , "DD" ,
433
- "hh:mm:ss" , "Measure" , "Accuracy" , "rms" , "F" ,
432
+ names = ["Design" , "K" , "T" , "N" , "Datetime" , "MM" , "DD" ,
433
+ "hh:mm:ss" , "Measure" , "Accuracy" , "rms" , "F" ,
434
434
"Bias" , "Resid" , "TRX" , "RCX" , "Chi" , "S" ])
435
435
436
436
# Combining the datetime columns
437
- date_array = [f"{ x } /{ y } /{ z } { t } " for x ,y , z , t in radar_table ["Datetime" , "MM" , "DD" , "hh:mm:ss" ]]
437
+ date_array = [f"{ x } /{ y } /{ z } { t } " for x , y , z , t in radar_table ["Datetime" , "MM" , "DD" , "hh:mm:ss" ]]
438
438
radar_table ["Datetime" ] = Time .strptime (date_array , '%Y/%m/%d %H:%M:%S' )
439
439
radar_table .remove_columns (["MM" , "DD" , "hh:mm:ss" ])
440
440
@@ -472,10 +472,10 @@ def parse_observations(resp_str, verbose=False):
472
472
Returns
473
473
-------
474
474
response : list(Table)
475
- List of response tables.
475
+ List of response tables.
476
476
"""
477
477
478
- output_tables = list () # Setting up to collect the output tables
478
+ output_tables = list () # Setting up to collect the output tables
479
479
480
480
# Split the meta data from the data table(s)
481
481
header , dat_tabs = resp_str .split ("END_OF_HEADER" )
@@ -528,7 +528,7 @@ def parse_physical_properties(resp_str):
528
528
529
529
if resp_str == '' :
530
530
raise ValueError ('Object not found: the name of the object is wrong or misspelt' )
531
-
531
+
532
532
# Split apart the table and reference data
533
533
tbl , refs = resp_str .split ("REFERENCES" )
534
534
@@ -539,7 +539,7 @@ def parse_physical_properties(resp_str):
539
539
for elt in tbl_list :
540
540
row = elt .split ("," )
541
541
if len (row ) > 4 :
542
- for i in range (1 ,len (row )- 2 ):
542
+ for i in range (1 , len (row )- 2 ):
543
543
repaired_string += f"{ row [0 ]} ,{ row [i ]} ,{ row [- 2 ]} ,{ row [- 1 ]} \n "
544
544
else :
545
545
repaired_string += elt + "\n "
@@ -611,7 +611,7 @@ def parse_orbital_properties(resp_str):
611
611
"""
612
612
613
613
table_lst = list ()
614
-
614
+
615
615
header , body = resp_str .split ("END_OF_HEADER" )
616
616
617
617
# Parse Header
@@ -676,14 +676,13 @@ def parse_orbital_properties(resp_str):
676
676
677
677
ngr_tbl = _make_prop_table (ngr_names , ngr_vals , section )
678
678
table_lst .append (ngr_tbl )
679
-
679
+
680
680
for row in ngr_tbl :
681
681
if float (row ["Value" ]):
682
682
cols .append (row ["Property" ])
683
683
684
684
kep_n = 5
685
685
686
-
687
686
# Equinoctial or Keplarian specific code
688
687
if "Equinoctial" in ek_section :
689
688
@@ -749,7 +748,7 @@ def parse_ephemerides(resp_str):
749
748
750
749
if "No ephemerides file" in resp_str :
751
750
raise ValueError ('No ephemerides file found for this object.' )
752
-
751
+
753
752
# Splitting the string into lines up to the nines which is where the table data starts
754
753
resp_list = re .split ("\n " , resp_str , maxsplit = 9 )
755
754
@@ -759,7 +758,7 @@ def parse_ephemerides(resp_str):
759
758
760
759
# Want to combine the column names and units
761
760
colnames = [(' ' .join (x )).strip () for x in zip ([resp_list [6 ][x :y ].strip () for x , y in col_inds ],
762
- [resp_list [7 ][x :y ].strip () for x , y in col_inds ])]
761
+ [resp_list [7 ][x :y ].strip () for x , y in col_inds ])]
763
762
764
763
ephem_table = Table .read (resp_list [9 ], format = "ascii.fixed_width_no_header" ,
765
764
col_starts = col_inds [:, 0 ], col_ends = col_inds [:, 1 ], names = colnames )
@@ -847,12 +846,12 @@ def parse_summary(resp_str):
847
846
obs_ind = prop_list .index ("Observatory" )
848
847
except ValueError :
849
848
obs_ind = len (prop_list )
850
-
849
+
851
850
obs_props = prop_list [obs_ind :]
852
851
prop_list = prop_list [:obs_ind ]
853
852
854
853
# Building the table
855
- summary_tab = Table (names = ["Physical Properties" , "Value" , "Units" ],
854
+ summary_tab = Table (names = ["Physical Properties" , "Value" , "Units" ],
856
855
data = np .array (prop_list ).reshape ((len (prop_list )// 3 , 3 )))
857
856
858
857
# Dealing with the special cases
@@ -864,7 +863,7 @@ def parse_summary(resp_str):
864
863
"(from Earth center)" )
865
864
866
865
# Adding the other properties as metadata
867
- for i in range (0 ,len (obs_props ), 2 ):
866
+ for i in range (0 , len (obs_props ), 2 ):
868
867
summary_tab .meta [obs_props [i ]] = obs_props [i + 1 ]
869
868
870
869
return summary_tab
0 commit comments