@@ -90,25 +90,27 @@ def hci(
9090 # start timer
9191 time_start = time .time ()
9292
93- if "://" in output_dataset :
94- protocol = output_dataset .split ("://" )[0 ]
93+ if "://" in str ( output_dataset ) :
94+ protocol = str ( output_dataset ) .split ("://" )[0 ]
9595 prefix = f"{ protocol } ://"
9696 else :
9797 protocol = "file"
9898 prefix = ""
9999
100100 fs = fsspec .filesystem (protocol )
101- basedir = fs .expand_path ("/" .join (output_dataset .split ("/" )[:- 1 ]))[0 ]
101+ basedir = fs .expand_path ("/" .join (str ( output_dataset ) .split ("/" )[:- 1 ]))[0 ]
102102 if not fs .exists (basedir ):
103103 fs .makedirs (basedir )
104104
105- oname = output_dataset .split ("/" )[- 1 ]
105+ oname = str ( output_dataset ) .split ("/" )[- 1 ]
106106
107107 output_dataset = f"{ prefix } { basedir } /{ oname } "
108108
109109 # this should be a file system
110110 if log_directory is None :
111111 log_directory = Path (basedir ) / "pfb_logs"
112+ else :
113+ log_directory = Path (log_directory )
112114 log_directory .mkdir (parents = True , exist_ok = True )
113115 timestamp = time .strftime ("%Y%m%d-%H%M%S" )
114116 logname = f"{ str (log_directory )} /hci_{ timestamp } .log"
@@ -384,6 +386,7 @@ def tmpf(x):
384386 cell_deg ,
385387 integrations_per_image = integrations_per_image ,
386388 )
389+
387390 log .info ("Scaffolding complete" )
388391
389392 n_stokes = len (remprod )
@@ -477,8 +480,8 @@ def tmpf(x):
477480 ny = ny ,
478481 freq = freqs [ms_name ][idt ][freq_slice ],
479482 utime = utimes [ms_name ][idt ][time_slice ],
480- tbin_idx = row_index ,
481- tbin_counts = row_counts ,
483+ rbin_idx = row_index ,
484+ rbin_counts = row_counts ,
482485 cell_rad = cell_rad ,
483486 radec = radecs [ms_name ][idt ],
484487 antpos = antpos [ms_name ],
@@ -488,7 +491,7 @@ def tmpf(x):
488491 timeid = ti ,
489492 msid = ims ,
490493 attrs = attrs ,
491- # Parameters previously from opts:
494+ integrations_per_image = integrations_per_image ,
492495 nthreads = nthreads ,
493496 precision = precision ,
494497 sigma_column = sigma_column ,
@@ -602,7 +605,6 @@ def make_dummy_dataset(
602605 nx ,
603606 ny ,
604607 cell_deg ,
605- time_chunk ,
606608 spatial_chunk = 128 ,
607609 integrations_per_image = 1 ,
608610):
@@ -638,7 +640,7 @@ def make_dummy_dataset(
638640 fitr = enumerate (zip (freq_mapping [ms_name ][idt ]["start_indices" ], freq_mapping [ms_name ][idt ]["counts" ]))
639641 for fi , (flow , fcounts ) in fitr :
640642 freq_slice = slice (flow , flow + fcounts )
641- out_freqs .append (np .mean (freqs [ms ][idt ][freq_slice ]))
643+ out_freqs .append (np .mean (freqs [ms_name ][idt ][freq_slice ]))
642644 ntasks += 1
643645
644646 for t0 in range (tlow , tlow + tcounts , integrations_per_image ):
@@ -823,4 +825,4 @@ def make_dummy_dataset(
823825 # Write scaffold and metadata to disk.
824826 cds = f"{ output_dataset } "
825827 dummy_ds .to_zarr (cds , mode = "w" , compute = False )
826- return cds , attrs
828+ return attrs , ntasks , n_times , n_freqs
0 commit comments