@@ -683,23 +683,27 @@ def _add_scanline_acq_time(self, dataset, dataset_id):
683683 acq_time = get_cds_time (days = tline ["Days" ], msecs = tline ["Milliseconds" ])
684684 add_scanline_acq_time (dataset , acq_time )
685685
686+ @cached_property
687+ def _acq_time_hrv (self ):
688+ tline = self ._dask_array ["hrv" ]["acq_time" ].compute ()
689+ return tline .reshape (self .mda ["hrv_number_of_lines" ])
690+
691+ @cached_property
692+ def _acq_time_visir (self ):
693+ return self ._dask_array ["visir" ]["acq_time" ].compute ()
694+
686695 def _get_acq_time_hrv (self ):
687696 """Get raw acquisition time for HRV channel."""
688- tline = self ._dask_array ["hrv" ]["acq_time" ]
689- tline0 = tline [:, 0 ]
690- tline1 = tline [:, 1 ]
691- tline2 = tline [:, 2 ]
692- return da .stack ((tline0 , tline1 , tline2 ), axis = 1 ).reshape (
693- self .mda ["hrv_number_of_lines" ]).compute ()
697+ return self ._acq_time_hrv
694698
695699 def _get_acq_time_visir (self , dataset_id ):
696700 """Get raw acquisition time for VIS/IR channels."""
697701 # Check if there is only 1 channel in the list as a change
698702 # is needed in the array assignment, i.e. channel id is not present
699703 if len (self .mda ["channel_list" ]) == 1 :
700- return self ._dask_array [ "visir" ][ "acq_time" ]. compute ()
704+ return self ._acq_time_visir
701705 i = self .mda ["channel_list" ].index (dataset_id ["name" ])
702- return self ._dask_array [ "visir" ][ "acq_time" ][ :, i ]. compute ()
706+ return self ._acq_time_visir [ :, i ]
703707
704708 def _update_attrs (self , dataset , dataset_info ):
705709 """Update dataset attributes."""
0 commit comments