Skip to content
Snippets Groups Projects
Commit 28ac52a9 authored by Edoardo Pasetto's avatar Edoardo Pasetto
Browse files

Delete meris.py

parent c4b5af00
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 23 10:41:37 2022
@author: Utente
"""
import numpy as np
import os
os.chdir('C:\\Users\\Utente\\Desktop\\Julich\\Synthetic\\MERIS')
import library as lib
#mu and sigmas refer to the underlying normal distribution, not the distribution itself
wl_array=[412.5,442.5,490,510,560,620,665,681.25]
n_samples=630
C_mu=-0.86
X_mu=-1.21
Y_mu=-1.75
C_sigma=0.3
X_sigma=0.3
Y_sigma=0.3
corr_CX=0.8
corr_CY=0.8
##########################################à
mu=np.array([C_mu,X_mu,Y_mu])
cov=np.zeros((len(mu),len(mu)))
# for i in range(len(mu)):
# cov[i,i]=mu[i]
cov[0,0]=C_sigma
cov[1,1]=X_sigma
cov[2,2]=Y_sigma
cov_CX=corr_CX*C_sigma*X_sigma
cov_CY=corr_CY*C_sigma*Y_sigma
#######################################
cov[0,1]=cov_CX
cov[1,0]=cov_CX
cov[0,2]=cov_CY
cov[2,0]=cov_CY
###################################
generator=np.random.default_rng()
samples=generator.multivariate_normal(mean=mu,cov=cov,size=n_samples)
#samples_a=np.random.multivariate_normal(mean=mu,cov=cov,size=n_samples)
oap=np.exp(samples)
#%%
################################
R=np.zeros((oap.shape[0],len(wl_array)))
for i in range(R.shape[0]):
C,X,Y=oap[i,:]
R[i,:]=lib.get_reflectance_vector(wl_array, C, X, Y)
##############################
#remember to convert to apply the logarithm the dataset!!
C_array=oap[:,0]
save_path='C:\\Users\\Utente\\Desktop\\Julich\\Synthetic\\MERIS\dataset\\'
np.save(save_path+'target.npy',C_array)
np.save(save_path+'input.npy',R)
np.save(save_path+'oap.npy',oap)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment