Index: /trunk/tools/bases_antartida.dat
===================================================================
--- /trunk/tools/bases_antartida.dat	(revision 2752)
+++ /trunk/tools/bases_antartida.dat	(revision 2752)
@@ -0,0 +1,24 @@
+# https://en.wikipedia.org/wiki/Argentine_Antarctica
+BASE Belgrano II, -77, 52, 25., -34, 37, 37, 39., Base antÃ¡rica Belgrano II, Argentina, Antartic
+BASE Belgrano III, -77, 54, 02., -45, 47, 01, 510., Base antÃ¡rtica Belgrano III, Argentina, Antartic
+BASE Esperanza, -63, 23, 51., -56, 59, 52., 23., Base antÃ¡rica Esperanza, Argentina, Antartic
+BASE Carlini, -62, 14, 18., -58, 40, 4., 10., Base antÃ¡rica Carlini, Argentina, Antartic
+BASE Marambio, -64, 14, 27.65, -56, 37, 36.31, 196., Base antÃ¡rica Marambio, Argentina, Antartic
+BASE Orcadas, -60, 44, 17., -44, 44, 17., 4., Base antÃ¡rica Orcadas, Argentina, Antartic
+BASE San MartÃ­n, -68, 7, 48., -67, 6, 5., 1., Base antÃ¡rica San MartÃ­n, Argentina, Antartic
+BASE Teniente CÃ¡mara, -62, 35, 41., -59, 55, 7., 22., Base antÃ¡rica Teniente CÃ¡mara, Argentina, Antartic
+BASE Deception, -62, 58, 31., -60, 41, 52., 7., Base antÃ¡rica DecepciÃ³n, Argentina, Antartic
+BASE Petrel, -63, 28, 41., -56, 13, 44., 18., Base antÃ¡rtica Petrel - Air Station, Argentina, Antartic
+BASE Primavera, -64, 9, 21., -60, 57, 19., 50., Base antÃ¡rica Primavera, Argentina, Antartic
+BASE Melchior, -64, 19, 32., -62, 58, 34., 8., Base antÃ¡rica Melchior, Argentina, Antartic
+BASE Almirante Brown, -64, 53, 44., -62, 52, 15., 10., Base antÃ¡rica Almirante Brown, Argentina, Antartic 
+BASE Teniente Matienzo, -64, 58, 32., -60, 4, 17., 25., Base antÃ¡rica Teniente Matienzo, Argentina, Antartic
+BASE AlfÃ©rez de NavÃ­o Sobral, -81, 4, 45., -40, 31, 12., 1000., Base antÃ¡rica AlfÃ©rez de NavÃ­o Sobral, Argentina, Antartic
+BASE EstaciÃ³n CientÃ­fica Ellsworth, -77, 39, 0., -41, 2, 0., 42., Base antÃ¡rica EstaciÃ³n CientÃ­fica Ellsworth, Argentina, Antartic
+BASE Refuge Francisco de Gurruchaga, -62, 18, 32., -59, 12, 25., 1., Base antÃ¡rica Refugio Francisco de Gurruchaga, Argentina, Antartic
+BASE BallvÃ©, -62, 12, 38., -58, 55, 34., 45., Base antÃ¡rica BallvÃ©, Argentina, Antartic
+BASE Belgrano I, -77, 46, 0., -38, 11, 0., 32., Base antÃ¡rica Belgrano I, Argentina, Antartic
+BASE Belgrano III, -77, 54, 2., -45, 47, 1., 510., Base antÃ¡rica Belgrano II, Argentina, Antartic
+BASE Camp Livingston, -62, 39, 22., -61, 00, 39., 1., Base antÃ¡rica Camp Livingston, Argentina, Antartic
+BASE Refugio Suecia, -63, 22, 0., -56, 59, 0., 1., Base antÃ¡rica Refugio Suecia, Argentina, Antartic
+BASE Refuge Abrazo de MaipÃº, -63, 23, 17., -57, 34, 58., 1., Base antÃ¡rica Refugio abrazo de MaipÃº, Argentina, Antartic
Index: /trunk/tools/bases_antartida.desc
===================================================================
--- /trunk/tools/bases_antartida.desc	(revision 2752)
+++ /trunk/tools/bases_antartida.desc	(revision 2752)
@@ -0,0 +1,12 @@
+station_name = 0
+lat_deg = 1
+lat_min = 2
+lat_sec = 3
+lon_deg = 4
+lon_min = 5
+lon_sec = 6
+height = 7
+prov = 9
+country = 10  
+nice_name = 8
+sepchar = ,
Index: /trunk/tools/to_OBSstations.py
===================================================================
--- /trunk/tools/to_OBSstations.py	(revision 2752)
+++ /trunk/tools/to_OBSstations.py	(revision 2752)
@@ -0,0 +1,153 @@
+# PyNCplot
+## e.g. # to_OBSstations.py -d bases_antartida.desc -f bases_antartida.dat
+# Python to transform from a given stations list format to standard 'OBSstations.csv'
+# From L. Fita work in different places: CCRC (Australia), LMD (France)
+# More information at: http://www.xn--llusfb-5va.cat/python/PyNCplot
+#
+# pyNCplot and its component nc_var.py comes with ABSOLUTELY NO WARRANTY. 
+# This work is licendes under a Creative Commons 
+#   Attribution-ShareAlike 4.0 International License (http://creativecommons.org/licenses/by-sa/4.0)
+#
+## Python script to indepdententy test different components 
+## L. Fita, CIMA. 
+####### ####### ##### ##### #### ### ## #
+
+from optparse import OptionParser
+import numpy as np
+from netCDF4 import Dataset as NetCDFFile
+import os
+import re
+import subprocess as sub
+import numpy.ma as ma
+import matplotlib as mpl
+mpl.use('Agg')
+from matplotlib.pylab import *
+import matplotlib.pyplot as plt
+from mpl_toolkits.basemap import Basemap
+
+# Importing generic tools file 'generic_tools.py' and the others
+import generic_tools as gen
+import nc_var_tools as ncvar
+import drawing_tools as drw
+import diag_tools as diag
+import geometry_tools as geo
+
+# Importing Fortran modules and the others
+import module_ForDef as fdef
+import module_ForDiag as fdiag
+import module_ForGen as fgen
+import module_ForSci as fsci
+
+parser = OptionParser()
+parser.add_option("-f", "--StFile", dest="Stfile", help="File with the stations values", metavar="FILENAME")
+parser.add_option("-d", "--DescFile", dest="descfile", help="File with the description of the content", metavar="FILENAME")
+(opts, args) = parser.parse_args()
+
+main = 'to_OBSstation.py'
+#######    #######
+## MAIN
+    #######
+# Expected description values
+descstvals = ['station_name', 'WMOid', 'longitude', 'lon_deg', 'lon_min', 'lon_sec', \
+  'latitude', 'lat_deg', 'lat_min', 'lat_sec', 'height', 'prov', 'country',          \
+  'nice_name', 'add1', 'add2']
+DESCstvals = {'station_name': ['S'], 'WMOid': ['I'], 'longitude': ['F'],             \
+  'lon_deg': ['I'], 'lon_min': ['I'], 'lon_sec': ['F'],  'latitude': ['F'],          \
+  'lat_deg': ['I'], 'lat_min': ['I'], 'lat_sec': ['F'], 'height': ['F'],            \
+  'prov': ['S'], 'country': ['S'], 'nice_name': ['S'], 'add1': ['S'], 'add2': ['S']}
+directdescstvals = ['station_name', 'WMOid', 'height', 'prov', 'country',            \
+  'nice_name', 'add1', 'add2']
+
+# Non numeric values
+NOnum = ['sepchar', 'spacec']
+
+ofile = 'sub_OBSstations.csv'
+
+# Reading description 
+of = open(opts.descfile, 'r')
+vals = {}
+for line in of:
+    if len(line) > 2 and line[0:1] != '#':
+        linevals = line.replace('\n','').replace('\t','').replace('\r',              \
+          '').replace(' ','').split('=')
+        if not gen.searchInlist(NOnum, linevals[0]):
+            vals[linevals[0]] = int(linevals[1])
+        else:
+            vals[linevals[0]] = linevals[1]
+
+of.close()
+
+lvals = list(vals.keys())
+if not gen.searchInlist(lvals, 'sepchar'):
+    print gen.errormsg
+    print '  ' + main + ": no split character provided !!"
+    print "    description file '" + opts.descfile + "' must content one entry as "+ \
+      "sepchar = [char] !!"
+    quit(-1)
+if not gen.searchInlist(lvals, 'Sspacechar'): vals['Ssepchar'] = '!'
+
+spacec = vals['Ssepchar']
+# Getting values
+oof = open(ofile, 'w')
+oif = open(opts.Stfile, 'r')
+for line in oif:
+    stval = {}
+    if len(line) > 2 and line[0:1] != '#':
+        linevals = line.replace('\n','').replace('\t','').replace('\r',              \
+          '')
+        linev = linevals.split(vals['sepchar'])
+
+        if vals.has_key(descstvals[2]) and not vals.has_key(descstvals[3]):
+            ic = vals[descstvals[2]]
+            av = np.float(linev[ic])
+            DMS = gen.angle_DegMinSec(av)
+            stval[descstvals[2]] = av
+            for i in range(3): stval[descstvals[3+i]] = DMS[i]
+
+        if vals.has_key(descstvals[3]) and not vals.has_key(descstvals[2]):
+            ic = vals[descstvals[3]]
+            DMS = [int(linev[ic]), int(linev[ic+1]), np.float(linev[ic+2])] 
+            av = gen.DegMinSec_angle(DMS[0], DMS[1], DMS[2])
+            stval[descstvals[2]] = av
+            for i in range(3): stval[descstvals[3+i]] = DMS[i]
+
+        if vals.has_key(descstvals[6]) and not vals.has_key(descstvals[7]):
+            ic = vals[descstvals[6]]
+            av = np.float(linev[ic])
+            DMS = gen.angle_DegMinSec(av)
+            stval[descstvals[6]] = lonv
+            for i in range(3): stval[descstvals[7+i]] = DMS[i]
+
+        if vals.has_key(descstvals[7]) and not vals.has_key(descstvals[6]):
+            ic = vals[descstvals[7]]
+            DMS = [int(linev[ic]), int(linev[ic+1]), np.float(linev[ic+2])] 
+            av = gen.DegMinSec_angle(DMS[0], DMS[1], DMS[2])
+            stval[descstvals[6]] = av
+            for i in range(3): stval[descstvals[7+i]] = DMS[i]
+
+        for Sd in directdescstvals:
+            Ddescv = DESCstvals[Sd]
+            if vals.has_key(Sd):
+                ic = vals[Sd]
+                stval[Sd] = gen.typemod(linev[ic].replace(spacec, '!'), Ddescv[0])
+            else:
+                if Ddescv[0] == 'S': missval = '-'
+                elif Ddescv[0] == 'I': missval = gen.fillValueI
+                elif Ddescv[0] == 'F': missval = gen.fillValueF
+                stval[Sd] = missval
+
+        Sline = ''
+        for Sd in descstvals:
+            if Sd == descstvals[0]: Sline = stval[Sd]
+            else: Sline = Sline + ',' + str(stval[Sd])
+
+        oof.write(Sline+'\n')
+
+oif.close()
+oof.close()
+
+print main + ": successfull written of file '" + ofile + "' !!"
+
+
+#quit() 
+
