Commit d49da4fb authored by Babacar Thiam's avatar Babacar Thiam

update interface de manipulation bd

parents
chargementSGDEexcel btl Version installation guide
1- ChargementSGDEexcel with btl file
To use it you want to go to chargeravecbtl folder et read the readme file.
2- ChargementSGDEexcel without btl file
To use it you want to go to chargersansbtl folder et read the readme file.
chargementSGDEexcelsans btl Version 1.2 installation guide
1- Installation on Linux/Unix
To install the ChargementSGDEexcelavecbtl package, you must install
the Python Programming Language environnement on your system.
The Python software is available for download at http://www.python.org.
Once python is installed on your system, simply download the
ChargementSGDEexcelavecbtl package from the gitlasso
The package for Linux/Unix comes
as a gzip tar file. To install, follow these steps:
1- tar zxvf ChargementSGDEexcelavecbtl-1.2.tar.gz
(or gunzip -c ChargementSGDEexcelavecbtl-1.2.tar.gz | tar xvf -)
2- cd ChargementSGDEexcelavecbtl-1.2/src
3- su - root (become superuser)
4- python setup.py install
And ChargementSGDEexcelavecbtl should now be
available for execution.
2- Installation of the source code on Windows
To install the ChargementSGDEexcelavecbtl package, you must install
the Python Programming Language environnement on your system.
The Python software is available for download at http://www.python.org.
Once python is installed on your system, simply download the
ChargementSGDEexcelavecbtl package from the gitlasso
The package for windows comes Windows comes as a zip file.
To install, follow these steps:
1- Download the zip file to a directory such as c:\temp
2- Unzip ChargementSGDEexcelavecbtl-1.2.zip
3- Open a command window
4- cd c:\temp\ChargementSGDEexcelavecbtl-1.2\src
5- python setup.py install
ChargementSGDEexcelavecbtl.py should now be
available for execution and will have been copied to the Scripts directory of your Python
installation (e.g., c:\Python24\Scripts). In order to use
the ChargementSGDEexcelavecbtl.py package from anywhere on your machine, you must
add this directory to your PATH environnement variable.
include README.md
include requirements.txt
#
#Makefile pour construire les paquets de
#distribution de odf2netcdf
all:
python setup.py sdist --formats=gztar,zip
python setup.py bdist_wininst
chargementSGDEexcelsans btl Version 1.2 installation guide
1- Installation on Linux/Unix
To install the ChargementSGDEexcelavecbtl package, you must install
the Python Programming Language environnement on your system.
The Python software is available for download at http://www.python.org.
Once python is installed on your system, simply download the
ChargementSGDEexcelavecbtl package from the gitlasso
The package for Linux/Unix comes
as a gzip tar file. To install, follow these steps:
1- tar zxvf ChargementSGDEexcelavecbtl-1.2.tar.gz
(or gunzip -c ChargementSGDEexcelavecbtl-1.2.tar.gz | tar xvf -)
2- cd ChargementSGDEexcelavecbtl-1.2/src
3- su - root (become superuser)
4- python setup.py install
And ChargementSGDEexcelavecbtl should now be
available for execution.
2- Installation of the source code on Windows
To install the ChargementSGDEexcelavecbtl package, you must install
the Python Programming Language environnement on your system.
The Python software is available for download at http://www.python.org.
Once python is installed on your system, simply download the
ChargementSGDEexcelavecbtl package from the gitlasso
The package for windows comes Windows comes as a zip file.
To install, follow these steps:
1- Download the zip file to a directory such as c:\temp
2- Unzip ChargementSGDEexcelavecbtl-1.2.zip
3- Open a command window
4- cd c:\temp\ChargementSGDEexcelavecbtl-1.2\src
5- python setup.py install
ChargementSGDEexcelavecbtl.py should now be
available for execution and will have been copied to the Scripts directory of your Python
installation (e.g., c:\Python24\Scripts). In order to use
the ChargementSGDEexcelavecbtl.py package from anywhere on your machine, you must
add this directory to your PATH environnement variable.
#! python
# -*- coding: UTF-8 -*-
#####################################
#
#Conversion de fichiers ODF a csv
#
#Auteur: James Caveen
# Ecrit a partir du programme fortran
# odf2txt de C. Lafleur (IML)
#
#$Id$
#
####################################
from googletrans import Translator
import testPostgres as pf
import traceback
import sys
from tkinter import *
from tkinter import ttk, messagebox
from tkinter import *
from tkinter.filedialog import *
import pandas as pd
import recupdatanetcdf as rdn
import testexcel as te
import loadjd as ld
import jeudedonneesdelete as jddd
def geoliste(g):
r=[i for i in range(0,len(g)) if not g[i].isdigit()]
return [int(g[0:r[0]]),int(g[r[0]+1:r[1]]),int(g[r[1]+1:r[2]]),int(g[r[2]+1:])]
def centrefenetre(fen):
fen.update_idletasks()
l,h,x,y=geoliste(fen.geometry())
fen.geometry("%dx%d%+d%+d" % (l,h,(fen.winfo_screenwidth()-l)//2,(fen.winfo_screenheight()-h)//2))
#bd.cursor.execute("select nextval('seq_int')")
#resultat2=bd.cursor.fetchone()
#print(resultat2)
class InterfaceGraphic(Tk):
def __init__(self):
Tk.__init__(self)
#self.minsize(1200,700)
self.title('Gestion des interfaces')
self.creerWidgets()
##interface pour la mission
def creerWidgets(self):
self.mainWindow = Frame(self, bg="blue")
self.mainWindow.pack(fill=BOTH, expand=1)
self.tete = Frame(self.mainWindow, bg="blue")
self.tete.pack(side=TOP, fill=BOTH)
self.label = Label(self.tete,font=('arial',70,'bold'),text="Création netcdf et chargement", bg="blue", fg="white")
self.label.pack(padx=5, pady=5)
self.frameSaisie = Frame(self.mainWindow, bg="blue")
self.frameSaisie.pack(fill=BOTH)
self.frameSaisie1 = Frame(self.mainWindow, bg="blue")
self.frameSaisie1.pack(fill=BOTH)
self.frameResult = Frame(self.frameSaisie, bd=4, relief=SUNKEN)
self.frameResult.pack(side=LEFT,fill=X)
#self.frameButtoninter = Frame(self.frameSaisie, bg="blue")
#self.frameButtoninter.pack(side=LEFT)
#self.btninter = Button(self.frameButtoninter, text="Nouveau", bg="blue", fg="white")
#self.btninter.pack(padx=5, pady=5)
self.frameButtonmission = Frame(self.frameSaisie1, bg="blue")
self.frameButtonmission.pack(side=LEFT)
self.btnmission = Button(self.frameButtonmission,font=('arial',50,'bold'),bd=4, text="charger all", bg="blue", fg="white", command=self.gestionIntervenant)
self.btnmission.grid(row=0,column=0)
self.frameButtontable = Frame(self.frameSaisie, bg="blue")
self.frameButtontable.pack(side=LEFT)
self.btntable = Button(self.frameButtontable,font=('arial',50,'bold'),bd=4, text="excel avec bt et cast", bg="blue", fg="white",command=self.excelavecbtcast)
self.btntable.grid(row=0,column=1)
self.frameButtonsauve = Frame(self.frameSaisie, bg="blue")
self.frameButtonsauve.pack(side=LEFT)
self.btnsauve = Button(self.frameButtonsauve,font=('arial',50,'bold'),bd=4, text="fichier de chargement", bg="blue", fg="white", command=self.filecharger)
self.btnsauve.grid(row=0,column=2)
self.frameButtonprojet = Frame(self.frameSaisie, bg="blue")
self.frameButtonprojet.pack(side=LEFT)
self.btnsauve1 = Button(self.frameButtonprojet,font=('arial',50,'bold'),bd=4, text="chargement de donnees", bg="blue", fg="white", command=self.chargerdata)
self.btnsauve1.grid(row=0,column=3)
self.frameButtonprojet1 = Frame(self.frameSaisie1, bg="blue")
self.frameButtonprojet1.pack(side=LEFT)
self.btnsauve11 = Button(self.frameButtonprojet1,font=('arial',50,'bold'),bd=4, text="test de suppression", bg="blue", fg="white", command=self.deletedata)
self.btnsauve11.grid(row=0,column=4)
self.frameButtonprojet2 = Frame(self.frameSaisie1, bg="blue")
self.frameButtonprojet2.pack(side=LEFT)
self.btnsauve1 = Button(self.frameButtonprojet2,text="Rep des fichiers",font=('arial',50,'bold'),command=self.recupJD_Rep)
self.btnsauve1.grid(row=0,column=5)
self.modified51=StringVar()
#self.frameButtontypes = Frame(self.frameSaisie1, bg="blue")
#self.frameButtontypes.pack(side=LEFT)
#self.btnsauve11111 = Button(self.frameButtontypes,font=('arial',50,'bold'),bd=4, text="delete jd", bg="blue", fg="white", command=self.gestiondeletejd)
#self.btnsauve11111.grid(row=2,column=4)
self.exit_button = Button(self.mainWindow,font=('arial',50,'bold'),bd=4,fg="black",bg="red", text = "Exit", command = self.mainWindow.quit)
self.exit_button.pack()
def recupJD_Rep(self):
rep = askdirectory(title='Choisissez un repertoire')
self.modified51.set(rep)
return rep
def gestionIntervenant(self):
#prob = self.loginEntry.get().strip().split(' ')
try:
#self.inter = gI.IntervenantGraphic()
#self.inter.mainloop()
self.destroy()
self.inter = gI.IntervenantGraphic()
#self.inter.mainloop()
except Exception as err:
print("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (err))
messagebox.showerror("Erreur de saisie", "impossible de lancer cette interface.")
def excelavecbtcast(self):
#prob = self.loginEntry.get().strip().split(' ')
try:
if(self.modified51.get()==""):
messagebox.showerror("Erreur", "choisir le dossier des donnees d'abord en cliquant sur dans rep des fichiers.")
else:
#self.destroy()
self.mission=te.creerAllbtl(self.modified51.get())
except Exception as err:
print("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (err))
messagebox.showerror("Erreur de saisie", "impossible de lancer cette interface.")
def filecharger(self):
#prob = self.loginEntry.get().strip().split(' ')
try:
if(self.modified51.get()==""):
messagebox.showerror("Erreur", "choisir le dossier des donnees d'abord en cliquant sur dans rep des fichiers.")
else:
self.destroy()
self.mission = rdn.recupInterface(self.modified51.get())
except Exception as err:
print("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (err))
messagebox.showerror("Erreur de saisie", "impossible de lancer cette interface.")
def chargerdata(self):
#prob = self.loginEntry.get().strip().split(' ')
try:
if(self.modified51.get()==""):
messagebox.showerror("Erreur", "choisir le dossier des donnees d'abord en cliquant sur dans rep des fichiers.")
else:
#self.destroy()
self.mission = ld.chargementbtl(self.modified51.get())
messagebox.showinfo("chargement", "chargement dans la base fait avec succes.")
except Exception as err:
print("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (err))
messagebox.showerror("Erreur de saisie", "impossible de lancer cette interface.")
def deletedata(self):
#prob = self.loginEntry.get().strip().split(' ')
try:
if(self.modified51.get()==""):
messagebox.showerror("Erreur", "choisir le dossier des donnees d'abord en cliquant sur dans rep des fichiers.")
else:
self.destroy()
self.mission = jddd.recupdelete(self.modified51.get())
except Exception as err:
print("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (err))
messagebox.showerror("Erreur de saisie", "impossible de lancer cette interface.")
def chargerAll(self):
#prob = self.loginEntry.get().strip().split(' ')
try:
if(self.modified51.get()==""):
messagebox.showerror("Erreur", "choisir le dossier des donnees d'abord en cliquant sur dans rep des fichiers.")
else:
self.destroy()
self.mission=te.creerAllbtl(self.modified51.get())
self.mission = rdn.recupInterface(self.modified51.get())
self.mission = ld.chargementbtl(self.modified51.get())
except Exception as err:
print("Requête SQL incorrecte :\n%s\nErreur détectée :\n%s"\
% (err))
messagebox.showerror("Erreur de saisie", "impossible de lancer cette interface.")
if __name__ == '__main__':
huff = InterfaceGraphic()
centrefenetre(huff)
huff.mainloop()
#########################################################
# Classe variable pour les fichiers ODF
#
# Pour chaque variable du fichier, on enmagasine
# le nom, le code, les unites, le Print_field_width, le print_decimal_places
# et on attribue un numero a la variable.
# Ce numero permet de trouver l'objet variable contenant
# les parametres de controle de qualite d'une variable donnee:
# Par exemple, si la variable temperature a le numero 1, ses QQQQ ont
# le numero 2
#
#James Caveen : juillet 2006
#
#Parametres d'instanciation:
# num_var: numero sequentiel de la variable
# nom: Nom complet (e.g., 'Sensor Depth Below...)
# code: Nom court (e.g., DEPH_01)
# unites: unites de la variable
# p_f_w: Print field width (utilise par getvaleur)
# p_d_p: Print decimal places (utilise par getvaleur)
#
#$Id$
#
################################################################
class variable:
def __init__(self,name,units,types,code,gf3,btl2gf3,decimal,desc):
self.name = name
self.units = units
self.type=types
self.code = code
self.gf3 = gf3
self.btl2gf3 = btl2gf3
self.decimal = decimal
self.desc = desc
self.valeurs=[]
def __str__(self):
return "nom:%s Unites: %s type: %s Code: %s gf3: %s btl2gf3: %s decimal: %s desc: %s" % \
(self.name,self.units,self.type,self.code,self.gf3,self.btl2gf3,self.decimal,self.desc)
def getname(self):
'''Obtenir le numero sequentiel de la variable'''
return self.name
def getunits (self):
'''Obtenir le nom complet de la variable,
Par exemple: Sensor depth below surface'''
return self.units
def getcode (self):
'''Obtenir le nom court de la variable.
Par exemple: DEPH01'''
return self.code
def gettype (self):
'''Obtenir les unites de la variable'''
return self.type
def getgf3(self):
'''Obtenir le PFW (floating point width) de la variable'''
return self.gf3
def getbtl2gf3 (self):
'''Obtenir le PDP (Precision decimal places) de la variable'''
return self.btl2gf3
def getdecimal(self):
'''Obtenir le nombre de valeurs associees a la variable'''
return self.decimal
def getdesc(self):
'''Obtenir le nombre de valeurs associees a la variable'''
return self.desc
def replaceallvaleurs(self, valeurs):
'''Remplacer toutes les valeurs de la variable par une
nouvelle liste de valeurs'''
self.valeurs[:] = valeurs
def createVar(self,name_dim,valeurs):
self.nom=self.getname()
self.name_dim.units=self.getunits()
self.name_dim.type=self.gettype()
self.name_dim.code=self.getcode()
self.name_dim.gf3=self.getgf3()
self.name_dim.btl2gf3=self.getbtl2gf3()
self.name_dim.decimal=self.getdecimal()
self.name_dim.desc=self.getdesc()
self.name_dim[:]=self.replaceallvaleurs(valeurs)
return self.name_dim
import testPostgres as pf
import traceback
import sys
from tkinter import *
from tkinter import ttk, messagebox
import pandas as pd
import json
#import excel2nc as ex
#bd.cursor.execute("select nextval('seq_int')")
#resultat2=bd.cursor.fetchone()
#print(resultat2)
def geoliste(g):
r=[i for i in range(0,len(g)) if not g[i].isdigit()]
return [int(g[0:r[0]]),int(g[r[0]+1:r[1]]),int(g[r[1]+1:r[2]]),int(g[r[2]+1:])]
def centrefenetre(fen):
fen.update_idletasks()
l,h,x,y=geoliste(fen.geometry())
fen.geometry("%dx%d%+d%+d" % (l,h,(fen.winfo_screenwidth()-l)//2,(fen.winfo_screenheight()-h)//2))
class ConnGraphic(Tk):
def __init__(self):
Tk.__init__(self)
#self.minsize(1200,700)
self.title('connexion a la base de donnees')
self.creerWidgets()
##interface pour la mission
def creerWidgets(self):
self.mainWindow = Frame(self, bg="blue")
self.mainWindow.pack(fill=BOTH, expand=1)
self.frameSaisie = Frame(self.mainWindow, bg="blue")
self.frameSaisie.pack(fill=BOTH)
self.frameResult10 = Frame(self.mainWindow)
self.frameResult10.pack(fill=BOTH)
self.frameResult = Frame(self.frameResult10, bd=4, relief=SUNKEN)
self.frameResult.pack(side=LEFT,fill=X)
self.ent_label = Label(self.frameResult,font=('arial',50,'bold'),bd=4,bg="blue", fg="white", text="Information de connection:")
#self.ent_label.configure(font=('Helvetica', 12),bg="blue", fg="white")
self.ent_label.pack(side=TOP,padx=5, pady=5)
self.frameResult00 = Frame(self.frameResult, bd=4, relief=SUNKEN)
self.frameResult00.pack(fill=BOTH,padx=5, pady=5)
self.modified_label53321 = Label(self.frameResult00,font=('arial',50,'bold'),bd=4, text = "host:")
#self.modified_label53321.configure(font=('Helvetica', 12))
#self.modified_label53321.pack(side=LEFT,padx=5, pady=5)
self.modified5332100=StringVar()
self.modified_entry53321= Entry(self.frameResult00,font=('arial',50,'bold'),textvariable=self.modified5332100)
self.modified_label53321.grid(row =0)
self.modified_entry53321.grid(row =0, column=1)
#self.modified_entry53321.pack(side=LEFT,padx=5, pady=5)
#self.modified_entry53321.focus()
#self.frameResult21 = Frame(self.frameResult10, bd=2, relief=SUNKEN)
#self.frameResult21.pack(side=LEFT,fill=Y)
self.modified_label51 = Label(self.frameResult00,font=('arial',50,'bold'),bd=4, text = "db info:")
#self.modified_label51.configure(font=('Helvetica', 12))
#self.modified_label51.pack(side=LEFT,padx=25, pady=25)
self.modified_label51.grid(row =1, column =0)
self.modified51=StringVar()
self.modified_entry51=Entry(self.frameResult00,font=('arial',50,'bold'),textvariable=self.modified51)
self.modified_entry51.grid(row =1, column =1)
self.modified_label4 = Label(self.frameResult00,font=('arial',50,'bold'),bd=4, text = "User:")
#self.modified_label4.configure(font=('Helvetica', 12))
#self.modified_label4.pack(side=LEFT,padx=25, pady=25)
#self.modified_label4.grid(row =0,column =4)
self.modified4=StringVar()
self.modified_entry4 = Entry(self.frameResult00,font=('arial',50,'bold'),bd=4,textvariable=self.modified4)
self.modified_entry4.grid(row =2, column =1)
self.modified_label4.grid(row =2, column =0)
#self.modified_entry4.pack(side=LEFT,padx=25, pady=25)
#self.modified_entry4.focus()
# self.modified_entry4.grid(row =1,column =4)
#self.frameResult2112 = Frame(self.frameResult, bd=2, relief=SUNKEN)
#self.frameResult2112.pack(side=LEFT,fill=Y)
self.modified_label5 = Label(self.frameResult00,font=('arial',50,'bold'),bd=4, text = "Password:")
#self.modified_label5.configure(font=('Helvetica', 12))
self.modified_label5.grid(row =3, column =0)
#self.modified_label5.pack(side=LEFT,padx=25, pady=25)
self.modified5=StringVar()
self.modified_entry5= Entry(self.frameResult00,font=('arial',50,'bold'),textvariable=self.modified5,show="*")
self.modified_entry5.grid(row =3, column =1)
self.btnan = Button(self.mainWindow,font=('arial',50,'bold'),bd=4, text="Se connecter", bg="blue", fg="white", command=self.seconnecter)
self.btnan.pack()
#self.btntablenew = Button(self.mainWindow, text="initialiser",font=('arial',50,'bold'),bd=4, bg="blue", fg="white",command=self.nouveauD)
#self.btntablenew.pack()
#self.frameButtontable1 = Frame(self.frameSaisie, bg="blue")
#self.frameButtontable1.pack(side=LEFT)
#self.btnacceuille = Button(self.frameResult00, text="Acceuil",font=('arial',50,'bold'),bd=4, bg="red", fg="white",command=self.acceuil)
#self.btnacceuille.grid(row=3,column=2)
self.exit_button = Button(self.mainWindow,font=('arial',50,'bold'),bd=4,bg="red",fg="black", text = "Exit", command = self.destroy)
self.exit_button.pack()
def nouveauD(self):
#self.dose.set("")
self.modified5332100.set("")
self.modified51.set("")
self.modified4.set("")
self.modified5.set("")
def seconnecter(self):
playlist = {}
playlist["identifiant"] = {}
playlist["identifiant"]["user"]=self.modified4.get()
playlist["identifiant"]["password"]=self.modified5.get()
playlist["dbinfo"] = {}
playlist["dbinfo"]["db"]=self.modified51.get()
playlist["dbinfo"]["host"]=self.modified5332100.get()
with open('conn1.json', 'w', encoding='utf-8') as f:
json.dump(playlist, f, indent=4)
self.destroy()
#ex.bd.cursor.execute("select nom from groupe order by nom")
#resultat1=ex.bd.cursor.fetchall()
#print("bonjour",resultat1)
#a=pf.recupconf("conn1.json")
#bd=pf.GestionBD(a[0],a[1],a[2],a[3])
#print(a)
import xlrd
from netCDF4 import Dataset
import numpy as np
import pandas as pd
import os, os.path
import glob
import testbtl as tb
from classe_variable import variable
"""creation des attributs pour les variables dans le fichier btl """
"""les codes"""
def mescodebtl():
code1=('Fichier','Latitude','Longitude','unique','Date','PrDM','PRES_SDEV','TEMP','TE90_SDEV','Sal00','Date','Time',"CNTR","nCNTR","Sigma-t00","FlECO-AFL","Ph","pH",'Upoly0','Upoly1','Sbeox0ML/L','CStarTr0','Par','TEMP_RT','SECC')
code2=('Q_TEMP','Sal','Q_PSAL','OXY_','Q_OXY',"CHL_","Q_CHL","PHA_","Q_PHA",'NOx_','Q_NOx','TEMP_','TEMP_QC')
code3=('Salinity','Oxygen',"Si","PO4",'NOx','Silicates','Si_',"Nitrates")
res=list(code1)
res.extend(list(code2))
res.extend(list(code3))
return res
def mesgf3code(code):
a={}
for j in code:
a[creerLaVariable(j).getgf3()]=j
return a
def mescodegf3(l,code):
return l[code]
"""les attributs des variables """
def creerLaVariable(code):
if code=="Fichier":
return variable('Filename','none','CTD','Fichier','(none)',1,0,'filename: CTD')
elif code=="Latitude":
return variable('latitude','degrees','CTD','Latitude','LATD',1,5,'latitude: CTD')
elif code=="Longitute":
return variable('longitude','degrees','CTD','Longitute','LOND',1,5,'longitude: CTD')
elif code=="unique":
return variable('uniquesample number', 'none','CTD','unique','IDEN',1,0,'unique sample number')
elif code=="zbouteille":
return variable('pressure depth of the water sample','db','CTD','zbouteille','PRES',1,1,'nominal or exact water sample depth')
elif code=="Date":
return variable('GMT date of the water sample', 'none','CTD','Date','UNKN',1,0,'date: CTD')
elif code=="Time":
return variable( 'GMT time of the water sample', 'none','CTD','Time','UNKN',1,0,'time: CTD')
elif code=="PrDM":
return variable('CTD pressure', 'db','CTD','PrDM','PRES',1,1,'pressure: CTD')
elif code=="TEMP":
return variable('CTD temperature ITS-90', 'deg C','CTD','TE90','TE090C',1,2,'temperature: CTD')
elif code=="TE90_SDEV":
return variable('CTD standard deviation temperature', 'deg C','CTD','TE90_SDEV','SDEV',1,3,'standard deviation temperature: CTD')
elif code=="Salinity":
return variable('bottle sample salinity PSS-78', 'PSU','labo','PSAL_BS','PSAL',1,2,'')
elif code=="Si":
d='silicate content: Strickland and Parsons (1972)'+\
'\nsilicate content: American Public Health Association (1989)'+\
'\nsilicate content: AA3; Strickland and Parsons (1972)'+\
'\nsilicate content: not corrected for salinity'+\
'\nsilicate content: unknown method.'+\
'\nsilicate content: Strickland and Parsons (1968)'+\
'\nsilicate content: Strain & Clement.1996.Can Data Rep Fish Aquat Sci 1004'
return variable('bottle sample silicate (SIO4-SI) content', 'mmol/m**3','labo','Si_','SLCA',1,2,d)
elif code=="Si_":
d='silicate content: Strickland and Parsons (1972)'+\
'\nsilicate content: American Public Health Association (1989)'+\
'\nsilicate content: AA3; Strickland and Parsons (1972)'+\
'\nsilicate content: not corrected for salinity'+\
'\nsilicate content: unknown method.'+\
'\nsilicate content: Strickland and Parsons (1968)'+\
'\nsilicate content: Strain & Clement.1996.Can Data Rep Fish Aquat Sci 1004'
return variable('bottle sample silicate (SIO4-SI) content', 'mmol/m**3','labo','Si_','SLCA',1,2,d)
elif code=="Silicates":
d='silicate content: Strickland and Parsons (1972)'+\
'\nsilicate content: American Public Health Association (1989)'+\
'\nsilicate content: AA3; Strickland and Parsons (1972)'+\
'\nsilicate content: not corrected for salinity'+\
'\nsilicate content: unknown method.'+\
'\nsilicate content: Strickland and Parsons (1968)'+\
'\nsilicate content: Strain & Clement.1996.Can Data Rep Fish Aquat Sci 1004'
return variable('bottle sample silicate (SIO4-SI) content', 'mmol/m**3','labo','Si_','SLCA',1,2,d)
elif code=="PO4":
return variable('bottle sample phosphate (PO4-P) content', 'mmol/m**3','labo','PO4_','PHOS',1,2,'')
elif code=="Sal00":
return variable('CTD salinity PSS-78', 'PSU','CTD','Sal00','PSAL_01',1,2,'salinity: CTD')
elif code=="CNTR":
return variable('scan number','none','CTD','CNTR','CNTR',1,0,'scan number: CTD')
elif code=="nCNTR":
return variable('number of scans averaged','none','CTD','nCNTR','NUM_',1,0,'number of