Parcourir la source

MERIS MODIS SEAWIFS Python version OK

Default Seadas User il y a 8 ans
Parent
commit
d3bd9a75c0
5 fichiers modifiés avec 43 ajouts et 2 suppressions
  1. 22 0
      README.txt
  2. 18 0
      README_python.txt
  3. 1 1
      class_KdJamet.py
  4. 1 0
      iop_Rrs_neuron.h
  5. 1 1
      test_class_KdNN.py

+ 22 - 0
README.txt

@@ -0,0 +1,22 @@
+
+ C coding version for Estimation of the diffuse attenuation coefficient Kd(lambda) with a neural network.
+
+- LOG_KdNeuralNetwork_test.c
+ A small Test case application to validate neuron_kd_switch3.c functions.  You can compile it using : comp_LOG_KdNeuralNetwork_test.sh
+ Must be launch with two arguments, this way :
+ $ LOG_KdNeuralNetwork_test LOG_KdNeuralNetwork_TestCase_Input.csv your_output.csv
+
+ Result are in your_output.csv, which may match LOG_KdNeuralNetwork_TestCase_Output.csv if everithing is OK!
+
+- neuron_kd_switch3.c include three functions :
+ + neuron_lect_LUTswitch3()
+  Read the LUTs used by rinf3_neuron_passe_avant() and rsup3_neuron_passe_avant
+  !!! path to the LUTs files are defined in neuron_switch3.h file, be sure to adapt them to your configuration !!!
+ + float rinf3_neuron_passe_avant(float input[NE])
+  Compute Kd from Neural network weigths if [Rrs490/Rrs55 < .85]
+  input must be initialized with Rrs(443 490 510 555 670) and the Wave-length(nm) at which Kd had to be computed.
+  Kd is returned
+ + float rsup3_neuron_passe_avant(float input[NE])
+  Compute Kd from Neural network weigths if [Rrs490/Rrs55 >= .85]
+  input must be initialized with Rrs(443 490 510 555) and the Wave-length(nm) at which Kd had to be computed.
+  Kd is returned

+ 18 - 0
README_python.txt

@@ -0,0 +1,18 @@
+
+ Python(2) version for Jamet's Kd 
+ 
+- test_class_KdNN.py
+ A small Test case application which use class_KdJamet.py
+ Must be launch with three arguments, this way :
+ $ LOG_KdNeuralNetwork_test LOG_KdNeuralNetwork_TestCase_Input.csv your_output.csv SensorID [idMERIS, idSEAWIFS, idMODIS]
+
+ Result are in your_output.csv, which may match LOG_KdNeuralNetwork_TestCase_Output[Sensor]_Python.csv if everithing is OK !
+
+ See comments in source code for more information.
+
+ Contact for code implementation : david.dessailly@univ-littoral.fr
+
+ Reference :
+ Jamet, C., H. Loisel, and D. Dessailly (2012), Retrieval of the spectral diffuse
+ attenuation coefficient Kd(lambda) in open and coastal ocean waters using a neural network inversion,
+ J. Geophys. Res.,117, C10023, doi:10.1029/2012JC008076

+ 1 - 1
class_KdJamet.py

@@ -45,7 +45,7 @@ class KdJamet:
   def init_variables(self):
     print "class KdJamet.init_variables Method"
     # =======================================================================================================
-    # MERIS / OLCI 
+    # MERIS / OLCI  
     if self.sensor == 'idMERIS':
       self.WL = np.array([413, 443, 490, 510, 560, 665])
       # Variables definiton for network Rrs490/Rrs555 >= .85 -------------------------------------------------

+ 1 - 0
iop_Rrs_neuron.h

@@ -0,0 +1 @@
+../DEV_ALGO/iop_Rrs_neuron.h

+ 1 - 1
test_class_KdNN.py

@@ -12,7 +12,7 @@ K = kdj.KdJamet(sys.argv[3])
 # test case Rrs file (argv[1]) reading  (ie: LOG_KdNeuralNetwork_TestCase_Input.csv)
 tab = np.loadtxt(sys.argv[1], skiprows=1)
 
-# array to store Kd results
+# array to store Kd results 
 KDs = np.zeros(tab.shape,dtype=np.float32)
 # for each line of input file compute the Kd for selected Sensor
 for i in range(tab.shape[0]):