예제 #1
0
    def sanity_BallesterosExample(self):
        """
        Checking example for Ballesteros
        """
        from PyAstronomy import pyasl

        b = pyasl.BallesterosBV_T()

        bv = 0.65

        # Convert B-V into effective temperature
        teff = b.bv2T(0.65)
        print("B-V = {0:4.2f} mag -> Teff = {1:4.0f} K".format(bv, teff))

        # Convert effective temperature into B-V color
        teff = 4568.0
        bv = b.t2bv(teff)
        print("Teff = {0:4.0f} K -> B-V = {1:4.2f} mag".format(teff, bv))
예제 #2
0
    def sanity_ramirez2005Example2(self):
        """
      Checking Ramirez, Ballesteros example
    """
        from PyAstronomy import pyasl

        b = pyasl.BallesterosBV_T()
        r = pyasl.Ramirez2005()

        # Convert B-V to effective temperature and back
        for bv in [
                0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95, 1.05, 1.15, 1.25,
                1.35, 1.45
        ]:
            tr = r.colorToTeff("B-V", bv, 0.0)
            tb = b.bv2T(bv)

            print(("B-V [mag] = {3:4.2f} : Teff (R05) = {0:4.0f} K, " + \
                    "Teff (B12) = {1:4.0f} K, dTeff = {2: 4.0f} K").format(tr, tb, tr - tb, bv))
예제 #3
0
pip install pyAstronomy

pip install arviz

import numpy as np
import arviz as az
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
from mpl_toolkits.mplot3d import Axes3D
from google.colab import files
import io
from PyAstronomy import pyasl
import time
r = pyasl.BallesterosBV_T()
b = pyasl.Ramirez2005()

uploaded = files.upload()

data0 = data = np.array(pd.read_csv(io.BytesIO(uploaded['SItable1.csv'])))

import tensorflow.math as tf_m
def mean_fn(x, y, a, b, c, d):
  return (np.exp(x)*1000)**a * b*(y - c)**d #the m relation was through trial and error
#fn from Barnes 2007

pd.read_csv(io.BytesIO(uploaded['SItable1.csv']))
#tolist makes array to list to remove 'dtype=float64' from the end of the array
te = data0[:,2].tolist()
tee= data0[:,3].tolist()