text: # -*- coding: utf-8 -*-
  """Project1.ipynb
  
  Automatically generated by Colaboratory.
  
  Original file is located at
      https://colab.research.google.com/github/kevingray92/ATMS-597-SP-2020/blob/add_numpy/Project1.ipynb
  """
  
  # Project 1
  
  # We need a class that basically defines 6 functions.
  # The functions will convert:
  # 1. Kelvin to Fahrenheit   (Kevin will work on this)
  # 2. Kelvin to Celsius      (Kevin will work on this)
  # 3. Fahrenheit to Kelvin   (Rylan will work on this)
  # 4. Fahrenheit to Celsius  (Rylan will work on this)
  # 5. Celsius to Kelvin      (Joyce will work on this)
  # 6. Celsius to Fahrenheit  (Joyce will work on this)
  
  import numpy as np
  
  class convert:
      """A class for various conversions between temperature units"""
      def K_to_F(K): # define a function
          F = [] # declare an empty list
          for i in K: # start a for loop
              x = ((i-273.15)*(9.0/5.0))+32.0 # this is the calculation for the conversion
              F.append(x) # append new value to the empty list declared earlier
          return(F) # return the list of new values
      
      def K_to_C(K):
          C = []
          for i in K:
              x = i-273.15
              C.append(x)
          return(C)
  
      def F_to_K(F):
          K = []
          for i in F:
              x = ((i - 32) * (5/9)) + 273.15
              K.append(x)
          return(K)
  
      def F_to_C(F):
          C = []
          for i in F:
              x = ((i - 32) * (5/9))
              C.append(x)
          return(C)
      
      def C_to_K(C):
          K = []
          for i in C:
              x = i+273.15
              K.append(x)
          return(K)
          
      def C_to_F(C):
          F = []
          for i in C:
              x = i*(9.0/5.0)+32.0
              F.append(x)
          return(F)
  
  x = convert # assign the class to a variable x
  
  x.K_to_C([273.15, 274.15]) # call the K_to_C function from the x variable
  
  a = x.K_to_F([273.15, 274.15]) # another example.
  print(a, type(a))
  
  x.F_to_K([32]) # another example.
  
  x.F_to_C([32, 100]) # another example.
  
  ar1 = np.arange(10) # set up a numpy array.
  ar1
  
  x.C_to_K(ar1) # check that the functions work on a numpy array.
  
  x.C_to_F(ar1) # another example and test of the last function.
  
  