Implentment new function

This commit is contained in:
Jianshun Gao 2023-05-16 15:51:13 +02:00
parent 9854f5a660
commit 85fdcac992
4 changed files with 679 additions and 2730 deletions

View File

@ -392,11 +392,11 @@ class FitAnalyser():
)
def _fit_1D(self, data, params, x):
return self.fitModel.fit(data=data, x=x, params=params)
return self.fitModel.fit(data=data, x=x, params=params, nan_policy='omit')
def _fit_2D(self, data, params, x, y):
data = data.flatten(order='F')
return self.fitModel.fit(data=data, x=x, y=y, params=params)
return self.fitModel.fit(data=data, x=x, y=y, params=params, nan_policy='omit')
def fit(self, dataArray, paramsArray, x=None, y=None, input_core_dims=None, dask='parallelized', vectorize=True, keep_attrs=True, daskKwargs=None, **kwargs):

View File

@ -113,7 +113,7 @@ def update_hdf5_file():
pass
def read_hdf5_file(filePath, group=None, datesetOfGlobal=None, preprocess=None, join="outer", parallel=True, engine="h5netcdf", phony_dims="access", excludeAxis=[], **kwargs):
def read_hdf5_file(filePath, group=None, datesetOfGlobal=None, preprocess=None, join="outer", parallel=True, engine="h5netcdf", phony_dims="access", excludeAxis=[], maxFileNum=None, **kwargs):
filePath = np.sort(np.atleast_1d(filePath))
@ -129,6 +129,9 @@ def read_hdf5_file(filePath, group=None, datesetOfGlobal=None, preprocess=None,
for i in range(len(fullFilePath)):
fullFilePath[i] = fullFilePath[i].replace("\\", "/")
if not maxFileNum is None:
fullFilePath = fullFilePath[0:int(maxFileNum)]
kwargs.update(
{

File diff suppressed because one or more lines are too long

View File

@ -130,4 +130,10 @@ def extract_temperature_from_fit():
def extract_condensate_fraction_from_fit():
pass
pass
def swap_xy(dataSet):
dataSet = dataSet.rename_dims(dict(x='__x'))
dataSet = dataSet.rename_dims(dict(y='x'))
dataSet = dataSet.rename_dims(dict(__x='y'))
return dataSet