@@ -302,19 +302,24 @@ def run(self, diaSourceCatalog, ssObjects, visitInfo, bbox, wcs):
302302 unAssocObjectMask = np .logical_not (maskedObjects ['associated' ].value )
303303 dtypes = [type (d ) if d is not np .ma .core .MaskedConstant else float
304304 for d in maskedObjects [0 ][all_cols ].values ()]
305- ssSourceData = np . ma . filled ( np . array ( ssSourceData ), None )
305+
306306 colnames = ["designation" , "phaseAngle" , "helioRange" , "topoRange" ]
307307 colnames += stateVectorColumns + mpcorbColumns
308308 colnames += ["ephRa" , "ephDec" , "ephRateRa" , "ephRateDec" , "ephVmag" , "topoRangeRate" ]
309- ssSourceData = Table (ssSourceData , names = colnames , dtype = dtypes )
309+ ssSourceData = Table (rows = ssSourceData , names = colnames , dtype = dtypes )
310+
310311 if 'MPCORB_created_at' in ssSourceData .columns :
311312 ssSourceData ['MPCORB_created_at' ] = 0
312313 ssSourceData ['MPCORB_updated_at' ] = 0
313314 ssSourceData ['MPCORB_fitting_datetime' ] = 0
314- for c in ['MPCORB_created_at' , 'MPCORB_updated_at' , 'MPCORB_fitting_datetime' ,
315- 'MPCORB_u_param' ]:
316- ssSourceData [c ] = ssSourceData [c ].astype (np .float64 ).astype (np .int64 )
317315 ssSourceData ['MPCORB_orbit_type_int' ] = - 1 # TODO: DM-54214. Mixed string and nan types.
316+
317+ if hasattr (ssSourceData ['MPCORB_orbit_type_int' ], 'filled' ):
318+ ssSourceData ['MPCORB_orbit_type_int' ] = ssSourceData ['MPCORB_orbit_type_int' ].filled (- 1 )
319+
320+ if hasattr (ssSourceData ['ephVmag' ], 'filled' ):
321+ ssSourceData ['ephVmag' ] = ssSourceData ['ephVmag' ].filled (np .nan ).astype (float )
322+
318323 ssSourceData ['MPCORB_orbit_type_int' ] = ssSourceData ['MPCORB_orbit_type_int' ].astype (np .int64 )
319324 ssSourceData ['ssObjectId' ] = Column (data = ssObjectIds , dtype = int )
320325 ssSourceData ["ra" ] = ras
@@ -382,7 +387,6 @@ def run(self, diaSourceCatalog, ssObjects, visitInfo, bbox, wcs):
382387
383388 # Join on diaSourceId, keeping all rows of ssSourceData
384389 ssSourceData = join (ssSourceData , dia , keys = source_column , join_type = "left" , uniq_col_name = "" )
385-
386390 return pipeBase .Struct (
387391 ssoAssocDiaSources = diaSourceCatalog [assocSourceMask ],
388392 unAssocDiaSources = diaSourceCatalog [~ assocSourceMask ],
0 commit comments