Esempio n. 1
0
    def __init__(self, bpob, bdob, btob, blatitude, blongitude, gpob, gdob, gtob, glatitude, glongitude, bname='VARA', gname='VADHU'):
        vara = Astro(bpob, bdob, btob, blatitude, blongitude, bname)
        bcharts = np.copy(vara.charts)
        bvarga = np.copy(vara.varga)
        vadhu = Astro(gpob, gdob, gtob, glatitude, glongitude, gname)
        gcharts = np.copy(vadhu.charts)
        gvarga = np.copy(vadhu.varga)
        brasi = vara.rasi
        bstar = vara.nakshatra
        grasi = vadhu.rasi
        gstar = vadhu.nakshatra


        varna_koota(brasi, grasi)
        vashya_koota(brasi, grasi)
        tara_koota(bstar, gstar)
        yoni_koota(bstar, gstar)
        graha_koota(brasi, grasi)
        gana_koota(bstar, gstar)
        rasi_koota(brasi, grasi)
        nadi_koota(bstar, gstar)
        dasa(vara.dasbuk, vadhu.dasbuk)
        kuja_dosh(bvarga,gvarga)

        en = False
        en_class = "red"
        if bstar == gstar:
            en = True
        if en:
            if bstar in [nakshatra_name[3], nakshatra_name[5], nakshatra_name[7], nakshatra_name[9], nakshatra_name[15], nakshatra_name[21], nakshatra_name[25], nakshatra_name[26]]:
                en_class = "green"
            elif bstar in [nakshatra_name[0], nakshatra_name[2], nakshatra_name[4], nakshatra_name[6], nakshatra_name[13], nakshatra_name[16], nakshatra_name[24]]:
                en_class = 'yellow'

        to_class = "green"
        if total_points() < 19:
            to_class = "red"

        self.koota = koota
        self.total = total_points()
        self.vara_name = bname
        self.vadhu_name = gname
        self.bdasa = bdasa
        self.gdasa = gdasa
        self.bname = bname
        self.gname = gname
        self.bcharts = bcharts
        self.gcharts = gcharts
        self.bkuja = bkuja
        self.gkuja = gkuja
        self.filename = f'Match-{bname}-{gname}'
        self.en = en
        self.en_class = en_class
        self.star = bstar
        self.to_class = to_class
Esempio n. 2
0
def getJataka(d):
    pb = "BENGALURU"
    dt = d.strftime("%d.%m.%Y")
    tm = d.strftime("%H:%M")
    la = "12.97"
    lo = "77.63"
    return Astro(pb,dt,tm,la,lo,"")
Esempio n. 3
0
 def initAstrocytes(self):
     """config is numbered input synapses aranged in shape of 
     syns are tuples of non-overlapping synapses"""
     sf = self
     config = permutation(sf.indim * sf.hiddim).reshape(sf.astrodim, sf.indim)
     config = convertToIndices(config, sf.hiddim)
     self.astros = [Astro(syns, self.lag_iters) for syns in config]
     self.astroOuts = empty((self.indim, self.hiddim))
Esempio n. 4
0
def jataka(id=0):
    if id == 0:
        name = request.form.get('name')
        pob = request.form.get('pob')
        dob = request.form.get('dob')
        DB = dob.split('-')
        dtb = DB[2] + '.' + DB[1] + '.' + DB[0]
        tob = request.form.get('tob')
        if request.form['save'] == "yes":
            conn = sqlite3.connect(db)
            rec = conn.cursor().execute(
                "SELECT * FROM record WHERE Place=? AND Date=? AND Time=?", (
                    pob,
                    dtb,
                    tob,
                )).fetchall()
            if len(rec) == 0:
                try:
                    conn.cursor().execute(
                        "INSERT INTO record (name, place, date, time) VALUES (?,?,?,?)",
                        (name, pob, dtb, tob))
                    conn.commit()
                    conn.close()
                    flash("RECORD SAVED")
                except Error:
                    flash("COULDN'T SAVE RECORD")
            else:
                conn.close()
                for serial, name, place, date, time in rec:
                    flash("Record Exists : Name = " + name +
                          ", Place of Birth = " + place + ", Date = " + date +
                          ", Time = " + time)
    else:
        conn = sqlite3.connect(db)
        rec = conn.cursor().execute("SELECT * FROM record WHERE serial = ?",
                                    (id, )).fetchall()
        conn.close()
        for serial, nm, pls, date, time in rec:
            name = nm
            pob = pls
            dtb = date
            tob = time

    conn = sqlite3.connect(db)
    places = conn.cursor().execute("SELECT * FROM latlong WHERE city = ?",
                                   (pob, )).fetchall()
    conn.close()
    for serial, city, lat, long in places:
        latitude = lat
        longitude = long
        kundali = Astro(pob, dtb, tob, latitude, longitude, name)
    return render_template('horoscope.html', kund=kundali)
Esempio n. 5
0
def match():
    bname = request.form.get('vara-name')
    bpob = request.form.get('vara-pob')
    bdob = request.form.get('vara-dob')
    bDB = bdob.split('-')
    bdtb = bDB[2] + '.' + bDB[1] + '.' + bDB[0]
    btob = request.form.get('vara-tob')
    gname = request.form.get('vadhu-name')
    gpob = request.form.get('vadhu-pob')
    gdob = request.form.get('vadhu-dob')
    gDB = gdob.split('-')
    gdtb = gDB[2] + '.' + gDB[1] + '.' + gDB[0]
    gtob = request.form.get('vadhu-tob')
    conn = sqlite3.connect(db)
    bplaces = conn.cursor().execute("SELECT * FROM latlong WHERE city = ?",
                                    (bpob, )).fetchall()
    gplaces = conn.cursor().execute("SELECT * FROM latlong WHERE city = ?",
                                    (gpob, )).fetchall()
    conn.close()
    for serial, city, lat, long in bplaces:
        blatitude = lat
        blongitude = long
    for serial, city, lat, long in gplaces:
        glatitude = lat
        glongitude = long
    if bname == "":
        bname = "VARA"
    if gname == "":
        gname = "VADHU"
    vadhu = Astro(gpob, gdtb, gtob, glatitude, glongitude, gname)
    vara = Astro(bpob, bdtb, btob, blatitude, blongitude, bname)
    vadhuvara = Match(bpob, bdtb, btob, blatitude, blongitude, gpob, gdtb,
                      gtob, glatitude, glongitude, bname, gname)
    return render_template("vadhuvara.html",
                           vv=vadhuvara,
                           vara=vara,
                           vadhu=vadhu)
Esempio n. 6
0
from tides import Tides
from astro import Astro
from cal_draw import generate_annual_calendar
import argparse
import os

parser = argparse.ArgumentParser()
parser.add_argument('filename',
                    help='Path to a NOAA annual tide tables text file.')
args = parser.parse_args()

if not os.path.isfile(args.filename):
    raise IOError('Cannot find {}'.format(args.filename))
print('Making Sun * Moon * Tide Calendar with input file \
{}.'.format(args.filename))

tides = Tides(args.filename)
print('{}, {}'.format(tides.station_name, tides.state))
sun = Astro(str(tides.latitude), str(tides.longitude), tides.timezone,
            tides.year, 'Sun')
print('Sun calculations complete.')
moon = Astro(str(tides.latitude), str(tides.longitude), tides.timezone,
             tides.year, 'Moon')
print('Moon calculations complete.')

print('Starting to draw calendar now.')
output_filename = 'SunMoonTide_{}_{}.pdf'.format(tides.year, tides.station_id)
generate_annual_calendar(tides, sun, moon, output_filename)
print('Calendar complete. Find output `{}` in the current working \
directory.'.format(output_filename))