@@ -904,69 +904,6 @@ def _rescale_and_set_minmax(self, data):
904904 data [data > self .vmax ] = 0
905905 return data
906906
907- def _data_concatenate (self , data , data_to_concat , tindex ):
908- if data [tindex ] is not None :
909- if isinstance (data , np .ndarray ):
910- data [tindex ] = None
911- elif isinstance (data , list ):
912- del data [tindex ]
913- if tindex == 0 :
914- data = np .concatenate ([data_to_concat , data [tindex + 1 :, :]], axis = 0 )
915- elif tindex == 1 :
916- data = np .concatenate ([data [:tindex , :], data_to_concat ], axis = 0 )
917- else :
918- raise ValueError ("data_concatenate is used for computeTimeChunk, with tindex in [0, 1]" )
919- return data
920-
921- def computeTimeChunk (self , data , tindex ):
922- g = self .grid
923- timestamp = self .timestamps
924- if timestamp is not None :
925- summedlen = np .cumsum ([len (ls ) for ls in self .timestamps ])
926- if g ._ti + tindex >= summedlen [- 1 ]:
927- ti = g ._ti + tindex - summedlen [- 1 ]
928- else :
929- ti = g ._ti + tindex
930- timestamp = self .timestamps [np .where (ti < summedlen )[0 ][0 ]]
931-
932- filebuffer = NetcdfFileBuffer (
933- self ._dataFiles [g ._ti + tindex ],
934- self .dimensions ,
935- self .indices ,
936- netcdf_engine = self .netcdf_engine ,
937- timestamp = timestamp ,
938- interp_method = self .interp_method ,
939- data_full_zdim = self .data_full_zdim ,
940- )
941- filebuffer .__enter__ ()
942- time_data = filebuffer .time
943- time_data = g .time_origin .reltime (time_data )
944- filebuffer .ti = (time_data <= g .time [tindex ]).argmin () - 1
945- if self .netcdf_engine != "xarray" :
946- filebuffer .name = self .filebuffername
947- buffer_data = filebuffer .data
948- if len (buffer_data .shape ) == 2 :
949- buffer_data = np .reshape (buffer_data , sum (((1 , 1 ), buffer_data .shape ), ()))
950- elif len (buffer_data .shape ) == 3 and g .zdim > 1 :
951- buffer_data = np .reshape (buffer_data , sum (((1 ,), buffer_data .shape ), ()))
952- elif len (buffer_data .shape ) == 3 :
953- buffer_data = np .reshape (
954- buffer_data ,
955- sum (
956- (
957- (
958- buffer_data .shape [0 ],
959- 1 ,
960- ),
961- buffer_data .shape [1 :],
962- ),
963- (),
964- ),
965- )
966- data = self ._data_concatenate (data , buffer_data , tindex )
967- self .filebuffers [tindex ] = filebuffer
968- return data
969-
970907 def ravel_index (self , zi , yi , xi ):
971908 """Return the flat index of the given grid points.
972909
0 commit comments