old_contents: #!/usr/bin/env python3
  
  import sys
  import os
  
  import matplotlib.pyplot as plt
  
  sys.path.append('./climatemaps')
  
  import climatemaps
  
  
  DATA_OUT_DIR = './website/data'
  
  TYPES = {
      'precipitation': {
          'filepath': 'data/precipitation/cpre6190.dat',
          'config': climatemaps.contour.ContourPlotConfig(0, 120, colormap=plt.cm.jet_r)
      },
      'cloud': {
          'filepath': 'data/cloud/ccld6190.dat',
          'config': climatemaps.contour.ContourPlotConfig(10, 90, colormap=plt.cm.jet_r)
      },
      'mintemp': {
          'filepath': 'data/mintemp/ctmn6190.dat',
          'config': climatemaps.contour.ContourPlotConfig(-300, 300, colormap=plt.cm.jet)
      },
      'maxtemp': {
          'filepath': 'data/maxtemp/ctmx6190.dat',
          'config': climatemaps.contour.ContourPlotConfig(-200, 400, colormap=plt.cm.jet)
      },
      # 'cloud': './data/cloud/ccld6190.dat',
      # 'mintemp': './data/mintemp/ctmn6190.dat',
      # 'maxtemp': './data/maxtemp/ctmx6190.dat',
  }
  
  
  def main():
      for data_type, settings in TYPES.items():
          for month in range(1, 13):
              latrange, lonrange, Z = climatemaps.data.import_climate_data(settings['filepath'], month)
              filepath_out = os.path.join(DATA_OUT_DIR, 'contour_' + data_type +'_' + str(month) + '.json')
              test_config = climatemaps.contour.ContourPlotConfig()
              contourmap = climatemaps.contour.Contour(settings['config'], lonrange, latrange, Z)
              contourmap.create_contour_data(filepath_out)
  
  
  if __name__ == "__main__":
      main()
  
new_contents: #!/usr/bin/env python3
  
  import sys
  import os
  
  import matplotlib.pyplot as plt
  
  sys.path.append('./climatemaps')
  
  import climatemaps
  
  
  DATA_OUT_DIR = './website/data'
  
  TYPES = {
      'precipitation': {
          'filepath': 'data/precipitation/cpre6190.dat',
          'conversion_factor': 0.1,  # (millimetres/day) *10
          'config': climatemaps.contour.ContourPlotConfig(0, 12, colormap=plt.cm.jet_r, unit='mm/day')
      },
      'cloud': {
          'filepath': 'data/cloud/ccld6190.dat',
          'conversion_factor': 1,
          'config': climatemaps.contour.ContourPlotConfig(10, 90, colormap=plt.cm.jet_r, unit='%')
      },
      'mintemp': {
          'filepath': 'data/mintemp/ctmn6190.dat',
          'conversion_factor': 0.1,
          'config': climatemaps.contour.ContourPlotConfig(-30, 30, colormap=plt.cm.jet, unit='C')
      },
      'maxtemp': {
          'filepath': 'data/maxtemp/ctmx6190.dat',
          'conversion_factor': 0.1,
          'config': climatemaps.contour.ContourPlotConfig(-20, 40, colormap=plt.cm.jet, unit='C')
      },
      'wetdays': {
          'filepath': 'data/wetdays/cwet6190.dat',
          'conversion_factor': 0.1,
          'config': climatemaps.contour.ContourPlotConfig(0, 30, colormap=plt.cm.jet_r, unit='days')
      },
  }
  
  
  def main():
      for data_type, settings in TYPES.items():
          for month in range(1, 13):
              latrange, lonrange, Z = climatemaps.data.import_climate_data(settings['filepath'], month, settings['conversion_factor'])
              filepath_out = os.path.join(DATA_OUT_DIR, 'contour_' + data_type +'_' + str(month) + '.json')
              contourmap = climatemaps.contour.Contour(settings['config'], lonrange, latrange, Z)
              contourmap.create_contour_data(filepath_out)
  
  
  if __name__ == "__main__":
      main()
  
subject: Create conversion factor to get to nice units