@@ -330,9 +330,9 @@ def init(self, fai_cfg=None, lima_cfg=None):
330330 self .config_grp ["type" ] = "text/json"
331331 self .config_grp ["data" ] = json .dumps (self .fai_cfg .as_dict (), indent = 2 , separators = (",\r \n " , ": " ))
332332
333- if isinstance (fai_cfg , WorkerConfig ) :
333+ if type (fai_cfg ) is WorkerConfig :
334334 self ._init_azimuthal ()
335- elif isinstance (fai_cfg , WorkerFiberConfig ) :
335+ elif type (fai_cfg ) is WorkerFiberConfig :
336336 self ._init_fiber ()
337337
338338 def _init_azimuthal (self ):
@@ -415,22 +415,31 @@ def _init_fiber(self):
415415 oop_name = oop .space
416416 ip_unit = ip .unit_symbol
417417 oop_unit = oop .unit_symbol
418+
419+ if self .fai_cfg .do_2D :
420+ self .do2D = True
418421
419422 if self .fai_cfg .do_2D or (not self .fai_cfg .do_2D and self .fai_cfg .vertical_integration ):
420423 self .outofplane_ds = self .nxdata_grp .require_dataset ("out-of-plane" , (self .fai_cfg .npt_oop ,), numpy .float32 )
424+ kw = {
425+ "unit" : oop_unit ,
426+ "interpretation" : "scalar" ,
427+ "name" : oop_name ,
428+ "long_name" : f"Diffraction out-of-plane direction { oop_name } ({ oop_unit } )"
429+ }
421430 self .outofplane_ds .attrs .update ({
422431 "unit" : oop_unit ,
423432 "interpretation" : "scalar" ,
424433 "name" : oop_name ,
425- "long_name" : "Diffraction out-of-plane direction %s (%s)" % ( oop_name , oop_unit )
434+ "long_name" : f "Diffraction out-of-plane direction { oop_name } ( { oop_unit } )"
426435 })
427436 if self .fai_cfg .do_2D or (not self .fai_cfg .do_2D and not self .fai_cfg .vertical_integration ):
428437 self .inplane_ds = self .nxdata_grp .require_dataset ("in-plane" , (self .fai_cfg .npt_ip ,), numpy .float32 )
429438 self .inplane_ds .attrs .update ({
430439 "unit" : ip_unit ,
431440 "interpretation" : "scalar" ,
432441 "name" : ip_name ,
433- "long_name" : "Diffraction in- plane direction %s (%s)" % ( ip_name , ip_unit )
442+ "long_name" : f "Diffraction out-of- plane direction { ip_name } ( { ip_unit } )"
434443 })
435444
436445 if self .fai_cfg .do_2D :
@@ -445,26 +454,26 @@ def _init_fiber(self):
445454 if self .fai_cfg .do_2D :
446455 chunk = 1 , self .fast_scan_width , self .fai_cfg .npt_oop , self .fai_cfg .npt_ip
447456 self .ndim = 4
448- axis_definition = ["." , "fast" , "oop " , "ip " ]
457+ axis_definition = ["." , "fast" , "out-of-plane " , "in-plane " ]
449458 elif self .fai_cfg .vertical_integration :
450459 chunk = 1 , self .fast_scan_width , self .fai_cfg .npt_oop
451460 self .ndim = 3
452- axis_definition = ["." , "fast" , "oop " ]
461+ axis_definition = ["." , "fast" , "out-of-plane " ]
453462 elif not self .fai_cfg .vertical_integration :
454463 chunk = 1 , self .fast_scan_width , self .fai_cfg .npt_ip
455464 self .ndim = 3
456- axis_definition = ["." , "fast" , "ip " ]
465+ axis_definition = ["." , "fast" , "in-plane " ]
457466 else :
458467 if self .fai_cfg .do_2D :
459- axis_definition = ["." , "oop " , "ip " ]
468+ axis_definition = ["." , "out-of-plane " , "in-plane " ]
460469 chunk = 1 , self .fai_cfg .npt_oop , self .fai_cfg .npt_ip
461470 self .ndim = 3
462471 elif self .fai_cfg .vertical_integration :
463- axis_definition = ["." , "ip " ]
472+ axis_definition = ["." , "in-plane " ]
464473 chunk = 1 , self .fai_cfg .npt_ip
465474 self .ndim = 2
466475 elif not self .fai_cfg .vertical_integration :
467- axis_definition = ["." , "oop " ]
476+ axis_definition = ["." , "out-of-plane " ]
468477 chunk = 1 , self .fai_cfg .npt_oop
469478 self .ndim = 2
470479
0 commit comments