Tuesday, June 4, 2019

July 2nd/3rd 2019 brings an interesting Solar Eclipse. With Saturn, Pluto and Ketu in opposition to Sun, Moon, Rahu with Venus creeping into their midst, these combinations will mark a different Summer. I have learned one thing about eclipses - they reveal secrets and generate fear. If you have read the ancient Ramayana epic, it has chapters on Hanuman attempting to destroy the ill aspects of Rahu and Sani. The anecdotes clearly state if you bring upon strength, then fighting the fear that Rahu instills or the negation Sani brings, are easily manageable. Its been a two-year battle with me, none of it was easy, but there is an opportunity on July 2nd, extending to Jul 3rd, to make the best of it.

Monday, October 15, 2018

Unique Dasa combinations


A Dasa is an Asterism based progression, quite unique to Vedic Astrology. Every graha or planetary body gets a weighted period on which it acts on a native. Those set periods can be recursively divided in similar weighted manner into sub periods and their sub periods, bringing an event’s occurrence to within a few days. Of course, one can recursively traverse the function to get to sub units of time, but for ease of understanding most ancient texts like this blog, limited it to three grahas only.

Understanding a Dasa period is not easy as many factors influence the period it represents. It’s sub divisions make the challenge exponential and further sub divisions further increase the complexity.

Any Dasa combination of Mars, Jupiter and Saturn overwhelms one half of the natal zodiac. These grahas are the lords of 8th, 9th, 10th sign; lords of 11th, 12th and 1st sign. From Scorpio to Aries is completely under the influence of the three Grahas, in their Dasa rulership. Of course, depending on how the houses are distributed from the ascendant (lagna), the combination of the three Grahas can exert lopsided pressures on one half of the native’s chart. I have witnessed some incredible results during the Dasa-Antara-Pratyantara of the three. If the period lasts 6 months, each month gets a unique (3 x 2) influence. Gain in wealth in one month with extra losses in another month, or loss of wealth followed by a gain; loss of health followed by an incredible recovery and similar yin-yang combinations occur within that short span of time.

A similar combination to the one described comes from Sun, Moon and Mercury dasa period. They involve a third of the native’s chart starting from the 3rd to the 6th sign. If such a region lies between 1st to 4th or 2nd to 5th house, the results could be really good.

Naksya - star based astrology spanning 30,000 years is now in beta



Just added more features to Naksya.com. It can also be associated with Jotiz.com. One of the key features of Naksya is its ability to span 30,000 years of astronomical data. Thanks to NASA’s Jet Propulsion Laboratory data and Astrodient, I was able to port their C++ libraries into Node JS and thus run a site that I believe will be of immense help to researchers. The Node JS libraries have been given back to the open source community.

Naksya is all about Nakshatra only. In this application, there are no standard 12 divisional zodiacs. Everything is Aster based or Fixed Star based. As an astrologer, you can compute a person’s birth chart and see it on a 27 divisional chart. Just to help folks navigate, a reference to the 12 signs is also in the chart. The chart tells you where your grahas were in Nakshatra(s) at time of birth and at a time of transit. It also gives you calculations which are forgotten – strength from birth position to transiting (bala’s acquired during transits), besides strength from the two luminaries Moon and Sun.

There is no concept of Ascendant in Naksya.

Also added the rising transits of Fixed Stars – such as Sirius, Andromeda, Orion (stars) etc. With Naksya, one can literally traverse down forgotten history to the Kuruskhetra war which happened in 3020 BCE. To enter such a year, you key in the year as -3020 and month and day as usual. We all understand that month and day were differently computed 5000 years back, (perhaps didn’t even exist and that’s another story). Naksya gives you a relative scale to think. To go into a period that is 10,000 years back, enter the year as -10000. Or, fast forward 10,000 years, enter the year as 10000.

As I write, Naksya is the only web application that can handle years -14,9999 to 14,9999 – that’s 30,000 years. I will be adding ‘eclipses’ to the Application shortly. As you can understand, it has been very rough getting such a site out with such phenomenal ranges and complex software.

Right now, the software requires an unlock key to run. If your interest is in star based or nakshatra based astronomy (or astrology), please let me know. I will be happy to give you a key. The intent is to make the software open to public in future – of course through some login credentials. In return, please send your opinion. There is always room for improvement. Since this is a computational engine, there will be some rough edges.

All mobile lovers will love the responsive page – https://www.naksya.com

Sunday, May 1, 2016

Web Responsive, SSL driven Jotiz 4.5


Presenting Jotiz 4.5 (https://www.jotiz.com) - a completely revamped astrology software that is Web Responsive. It works on all devices – laptops, tablets, small-footprint smart phones, iPad, iPhone, Samsung… Lots of changes, device friendly and fully secure. Yes – Jotiz uses SSL SHA-2 certificates and the protocol is https – which means your communication with the website is completely secure. It has remained free from the beginning; it will remain free for all users without any advertisements as long as possible.

In an unrented garage in a small town suburban home, Jotiz had a small beginning. It was 1986 and the rains were incessant. Built on C-Language using the most versatile compiler – Borland’s Turbo C, the first application ran in DOS. It had no name I can remember; it was a mere astrology software. A gentleman who by profession was a trader had coerced me into writing a software of which I had very little knowledge. In a book-fair, I found several books by B.V. Raman which became my gospel for many years. With the popularity of Intel 386 processors and the advent of Windows 3.1, the astrology software – Mystic was rebuilt with Borland C++ compiler. I remember the excitement of buttons, windows, scrollbars that appeared in a first ever Windows GUI Vedic Astrology system. In 1994 before the announcement of Windows 95, Borland aggressively announced Delphi and a new breed of Mystic was announced in 1995 overlapping Microsoft Windows 95 announcement. It was revolutionary – menus, dialogs, 256 bit images, panels, Paradox data engine took over the interface of Mystic. For a few years it remained dormant until Internet became mainstream and GoMystic appeared in 1998 as a Java applet with fancy calculations. The GoMystic Prediction Engine was registered with the US Copyright Office in early 2000. From an applet to a PHP server based system in 2003 to a complete web responsive system is what it has become – almost 27 years in the making.
It must be perfect then.

Far from it. I still find holes, panaceas, faulty logic – which tells you how complex the system is. Or is it? Why should nature make such a complex system to describe our Karma, our fate? Here’s my answer – every book, manuscript that I have read is concealed in riddles. Most have been authored mindlessly without any divine knowledge or thought. The last few years have been the true revelation for me – I believe I have finally cracked the code. Here is Jotiz (grown from its “nascent-no-named” humble beginning to later day “Mystic”) and finally AquaPisces (https://www.aquapisces.com).
AquaPisces is yet another story. The teachings and doctrines of Parasara, Charaka, Patanjali, William Lilly, Raphael, Varaha Mihira converge into AquaPisces. 

This is first ever attempt in bringing the concepts of astrology, ayurveda, TCM and American native herbal medicine under one roof. Algorithmically it was a challenge, making it web responsive and device friendly was yet another.

Here’s hoping you enjoy Jotiz and AquaPisces as much I enjoyed and struggled in making it.

Today with 15,000 native data, 13,000 + known users, and approximately 25,000 anonymous users Jotiz has come a long way. The new site contains all the previous versions and the new web responsive site built with Bootstrap, JQuery, PHP, MySQL and a bunch of new algorithms. 

Tuesday, May 12, 2015

DIY - Jotiz CardioMachine with Arduino Due and TI MSP 432 and MSP 430

DIY - Jotiz CardioMachine with Arduino Due and TI MSP 432 and MSP 430


I present here a series of blogs that are intended to enable the use of ‘things’ in the Internet of Things IoT complementing Jotiz.

The idea of a Microcontroller based Cardiogram Reading machine was something I had planned on for quite a while. There is little to doubt that Panchanga and Kaala have a definite influence on a person’s mind, spirit and heart. Based on that key-note, I went about assembling a small machine that could fit into your palm, read EKG through electrodes on your body and correlate heart readings to the Panchanga and Kaala of time.

There were several architectural alternatives, which I went through and I present them all to you.

1. Arduino Mega (8 Bit) MCU with Olimex EKG/EMG front-end shield.
2. Arduino Due (32 Bit SAMX) MCU with Olimex EKG/EMG front end shield
3. TI MSP 430 (16 Bit) Launchpad with SparkFun EKG front end board
4. TI MSP 423 (32 Bit) Launchpad with SparkFun EKG front end board

The TI Launchpads were connected headless to the EKG front ends. The data was collected over the serial port through a program written in Java, which would plot and render the data on the cloud. To the Arduino boards, I added shields I had created which had LCD and OLEDs mounted additional to the EKG front ends.

Links and Bill of Material: 

1. Energia - http://energia.nu/
2. Arduino - http://www.arduino.cc/
3. Arduino Mega - http://www.arduino.cc/en/Main/arduinoBoardMega
4. Arduino Due - http://www.arduino.cc/en/Main/arduinoBoardDue
5. Sainsmart Due - http://www.sainsmart.com/sainsmart-due-atmel-sam3x8e-arm-cortex-m3-board.html
6. Sintron Mega 2560 R3 ATmega2560 with USB Cable
7. Olimex EKG Frontend - https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/
8. SparkFun AD8232 EKG - https://learn.sparkfun.com/tutorials/ad8232-heart-rate-monitor-hookup-guide
9. Hammond Manufacturing 1553BRDBKBAT Enclosure
10. Gikfun Prototype Shield DIY KIT for Arduino
11. Diymall 0.96" Inch I2c IIC Serial 128x64 OLED
12. SainSmart 1.8" TFT Color LCD Display Module with SPI Interface & MicroSD
13. Radioshack Enclosure Project Skeleton Kit (Two-Tray)
14. TI MSP 430 G2 series - http://www.ti.com/lsds/ti/microcontrollers_16-bit_32-bit/msp/ultra-low_power/msp430g2x_i2x/overview.page
15. Texas Instruments MSP432 Launchpad - http://www.ti.com/tool/MSP-EXP432P401R

Three layered Jotiz-Cardio machine on Arduino (Sintron) Mega
with Olimex EKG/EMG Shield and 0.96 inch OLED

Three layered Jotiz-Cardio machine on Arduino (Sainsmart) Due
with Olimex EKG/EMG shield and 0.96 inch OLED on top shield

MSP 432 Launchpad (32 Bit) with Sparkfun AD8232 EKG Board

MSP 430 Launchpad (16 Bit) with Sparkfun AD8232 EKG Board

MSP 430 Launchpad with Sparkfun EKG inside Hammond Enclosure
with three electrodes attached

How the program works:


Arduino 32 Bit (Single channel) with Olimex EKG Shield


  screen.firstPage();
  do {
    draw();
    screen.setColorIndex(1);
  } while ( screen.nextPage() );

  starttime = millis();
  Serial.begin(57600);
  Serial.setTimeout(2000);
  Serial.println("Vedic Heart Machine");
  Serial.println(">> Please input Time : Example \"21,53,0,25,4,2015,-4\"");
  if (!pTime) {
    processTime();
    pTime = true;
  }
  if (!pDone) {
    doPanchanga();
    pDone = true;
  }
}

void doPanchanga() {
  Serial.print("PCH, Date ");
  Serial.print(nYY);
  Serial.print("-");
  Serial.print(nMM);
  Serial.print("-");
  Serial.print(nDD);
  Serial.print(" Hour ");
  Serial.print(nHour);
  Serial.print(":");
  Serial.print(nMin);
  Serial.print(" TimeZone ");
  Serial.println(nTZ);

  pch.initialize_panchanga(nDD, nMM, nYY, nHour, nMin, nTZ);

  delay(200);
  pDone = true;

  // Set the timer for EKG Reading
  // TC1 : timer counter. Can be TC0, TC1 or TC2
  // 0   : channel. Can be 0, 1 or 2
  // TC3_IRQn: irq number.
  // 250 : frequency (in Hz)
  // The interrupt service routine is TC3_Handler.
  startTimer(TC1, 0, TC3_IRQn, 250);
}

void processTime() {
  nHour = Serial.parseInt();
  nMin = Serial.parseInt();
  nSec = Serial.parseInt();
  nDD = Serial.parseInt();
  nMM = Serial.parseInt();
  nYY = Serial.parseInt();
  nTZ = Serial.parseInt();
  if (nYY == 0) nYY = 2015;
  if (nDD == 0) nDD = 25;
  if (nMM == 0) nMM = 4;
  if (nHour == 0) nHour = 23;
  if (nMin == 0) nMin = 36;
  if (nTZ == 0) nTZ = -4;
  setTime(nHour, nMin, 0, nDD, nMM, nYY);
}

  activetime = millis() - starttime;
  if (timerInitiated) {
    inADC = analogRead(0);
    Serial.print("ADC,");
    Serial.print(inADC);
    Serial.print(",");
    Serial.println(activetime);
  }

Arduino 8-Bit Mega with Olimex EKG and OLED


#define SAMPFREQ 256                      // ADC sampling rate 256
#define TIMER2VAL (1024/(SAMPFREQ))       // Set 256Hz sampling frequency                   
volatile unsigned char CurrentCh = 0;     //Current channel being sampled.
volatile unsigned int ADC_Value = 0;             //ADC current value
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH  16

// Needed by Panchanga
uint8_t nDay = 6;
uint8_t nDD = 11;
uint8_t nMM = 4;
unsigned int nYY = 2015;
uint8_t nHour = 23;
uint8_t nMin = 18;
int nTZ = -4;
char buf[2];
char sbuf[15];
Panchanga pch;
  noInterrupts(); 
  FlexiTimer2::set(TIMER2VAL, Timer2_Overflow_ISR);
  FlexiTimer2::start();
  interrupts(); 
  doPanchanga();
  ADC_Value = analogRead(CurrentCh);
  // Spit out the values
  Serial.print("ADC, ");   
  Serial.println(ADC_Value);

MSP 432 with Sparkfun AD8232 EKG


int starttime;
int activetime;
int previoustime = 0;
int cnt = 0;
volatile unsigned int inADC = 0;
  pinMode(2, INPUT); // Setup for leads off detection LO +
  pinMode(3, INPUT); // Setup for leads off detection LO -
  if ((digitalRead(2) == 1) || (digitalRead(3) == 1)) {
    // Leads not connected
    // Serial.println('!');
  } else{
    // send the value of analog input 0:
    inADC = analogRead(A0);  // PIN_06
    // inADC = map(inADC, -4096, 4096, 1024, 1024);
    Serial.print("ADC,");
    Serial.print(inADC);
    Serial.print(",");
    Serial.println(activetime);
    ++cnt;
  }
  //Wait for a bit to keep serial data from saturating
  delay(1);

Based on the quality of time as determined by the Panchanga many health problems can be determined. Jotiz is being expanded to included uncharted medical astrology.

Read more about this in the upcoming book “Vedic Machine”

TI CC3200 LaunchPad IoT using Jotiz RESTful Services

TI CC3200 LaunchPad IoT with Sharp LCD using Jotiz RESTful Services

I present here a series of blogs that are intended to enable the use of ‘things’ in the Internet of Things IoT complementing Jotiz.

The CC3200 Launchpad from Texas Instruments is new generation 32 bit MCU with SoC and WiFi built it. In this article, I present the CC3200 micro-controller and its ability to read the Jotiz web service which gives the Panchanga. The development board is the size of a credit card and comes as an attractive red PCB. I also attached a Sharp 96x96 LCD booster pack on the MCU board to display the results. All this, I put into an acrylic enclosure with spacers and screws.

The Simplelink WiFi CC3200 Launchpad was connected to a Windows 7 laptop through the USB port. Remember to download the drivers for CC3200 from TI website. To develop the program, the Open Source Energia based on the Arduino IDE was used.


Links:

1.      Energia - http://energia.nu/
2.      Arduino - http://www.arduino.cc/
3.      Texas Instruments CC3200 Launchpad - http://www.ti.com/tool/cc3200-launchxl

How the program works:


It uses the WiFi library, JSON and the Sharp booster pack libraries. It fetches the Panchanga data from the Jotiz REST service, extracts the relevant information from the encoded JSON and displays on the LCD.

Based on the quality of time as determined by the Panchanga many common day to day decisions like attending an interview, choosing the right moment to discuss an idea or a raise, travelling, buying property, investing can be done with less negative consequences.

Excerpts from the code

  // Initializing the LCD and WiFi
  LCD_SharpBoosterPack_SPI myScreen;
  uint8_t k = 0;
  WiFiClient client;
  char server[] = "jotiz.com";
  boolean offline = false;
  
  #elif defined(__CC3200R1M1RGC__)
  SPI.begin();
  SPI.setClockDivider(SPI_CLOCK_DIV2); 
// for __CC3200R1M1RGC__ DIV2 = 4 MHz !
  SPI.setBitOrder(MSBFIRST);
  SPI.setDataMode(SPI_MODE0);
  #endif

  if (WiFi.status() == WL_NO_SHIELD) {
    myScreen.text(10, 25, "FAIL");
    while(true);
  }

  while (wifiStatus != WL_CONNECTED) {
    wifiStatus = WiFi.begin(WIFI_SSID, WPA_PASSWORD);
    if (wifiStatus == WL_CONNECTED) {
      myScreen.text(10, 25, "Wifi: OK");
    } 
    delay(300);
  }

  if (!offline) {
    while (WiFi.localIP() == INADDR_NONE) {
      delay(300);
    }

    IPAddress ip = WiFi.localIP();

    if (client.connect(server, 80)) {
      client.println("GET /rest/resource.php?method=panch&format=json HTTP/1.1");
      client.println("Host: jotiz.com");
      client.println("Content-Type: application/json");
      client.println("Connection: close");
      client.println();
    } 

  if (!offline) {
    for (int i=0; i < 47; i++) {
      String jsonstr = "";
      while (client.available()) {
        char c = client.read();
        jsonstr += String(c);
      }
      String js = jsonstr.substring(jsonstr.indexOf("{"));
      char* jstr = strcpy((char*)malloc(js.length()+1), js.c_str());

      aJsonObject* root = aJson.parse((char *)jstr);
      aJsonObject* dd = aJson.getObjectItem(root, "dd");
      aJsonObject* mm = aJson.getObjectItem(root, "mm");
      aJsonObject* yy = aJson.getObjectItem(root, "yy");
      aJsonObject* hh = aJson.getObjectItem(root, "hh");
      aJsonObject* mt = aJson.getObjectItem(root, "mt");
      aJsonObject* dw = aJson.getObjectItem(root, "dw");

      aJsonObject* ui = aJson.getObjectItem(root, "unodeInausp");
      aJsonObject* si = aJson.getObjectItem(root, "saturnInausp");
      aJsonObject* di = aJson.getObjectItem(root, "deathBearing");
      aJsonObject* da = aJson.getObjectItem(root, "directionInausp");

      char buf1[10] = "";
      strcat(buf1, yy->valuestring);
      strcat(buf1, "-");
      strcat(buf1, mm->valuestring);
      strcat(buf1,  "-");
      strcat(buf1, dd->valuestring);

      myScreen.text(10, 25, buf1);
      char buf2[5] = "";

      strcat(buf2, hh->valuestring);
      strcat(buf2,  ":");
      strcat(buf2, mt->valuestring);
      myScreen.text(10, 35, buf2);

      myScreen.text(10, 45, "Rahu");
      myScreen.text(70, 45, ui->valuestring);
      blinkLed(LED1);
      myScreen.text(10, 55, "Saturn");
      myScreen.text(70, 55, si->valuestring);
      blinkLed(LED2);
      myScreen.text(10, 65, "Death");
      myScreen.text(70, 65, di->valuestring);
      blinkLed(LED3);
      myScreen.text(10, 75, "Direction");
      myScreen.text(70, 75, da->valuestring);
      myScreen.flush();

      free(dw);
      ..
      ..
      free (jstr);
      delay (500);

      free(mm);
      .. 
      ..
    }


MyScreen is the LCD screen - SHARP 96x96 pixels. The board on startup initializes the WiFi client, sends the SSID and Password to authenticate as an user and obtains an IP address. After getting the IP address, it uses the internet to connect to Jotiz and make a RESTful request. The JSON string received is broken up into its elements and displayed. 

Read more about this in the upcoming book “Vedic Machine

DIY - MSP430 Launchpad with BMP180 (A farmer's Almanac) complementing Jotiz

Do it Yourself - MSP430 Launchpad with BMP180 complementing Jotiz

I present here a series of blogs that are intended to enable the use of ‘things’ in the Internet of Things IoT complementing Jotiz.

To start with, I have used a MSP430FR5969(c) Launchpad(c)(r) from Texas Instruments. The development board is the size of a credit card and comes as an attractive red PCB. I also attached a Sharp 96x96 LCD booster pack on the MCU board to display the results and a Bosch BMP180 pressure and temperature sensor from Adafruit. All this, I put into an acrylic enclosure with hex spacers and M3 screws.


Links: 

1. Energia - http://energia.nu/
2. Guide to MSP430FR5969 - http://energia.nu/pin-maps/guide_msp430fr5969launchpad/
3. Arduino - http://www.arduino.cc/
4. Adafruit - https://www.adafruit.com/

How the program works:


It uses the wire library, the bmp085 and the Sharp booster pack libraries. It computes the Rahu Kaala, Gullika Kaala, Yamaghantaka and Shoola directions along with the sensors collecting pressure and temperature data from the ambient surroundings.

Based on the quality of time as determined by the Kaala and the pressure and temperature readings, house plants, green house plants and outdoor plants can be watered or checked for damages.

Excerpts from the code

  // Setting the pin modes of the pins connected to the BMP Sensor
  pinMode(P1_6, OUTPUT);
  pinMode(P1_7, OUTPUT);
  digitalWrite(P1_7, LOW);

  // Barometer Sensor
  digitalWrite(P1_7, HIGH);
  …
  …
  // After initializing the sensor, show the pressure and temperature
  showPressureTemp();
  …
  // display the results on the LCD
  myScreen.begin();
  myScreen.setFont(1);
  myScreen.text(10, 5, "Vedic");
  myScreen.setFont(0);
  myScreen.text(10, 30, "Jotiz Clock");
  myScreen.text(10, 40, "(c)devb inc");
  myScreen.flush();  

  delay(2000);
  myScreen.clearBuffer();

  // check for quality of time 
  doTime();
  …
  …

  // compute time
void doTime() {
  float h1;
  nMin++;
  if (nMin > 59) {
      nHour++;
      nMin = 0;
  }
  if (nHour > 23) {
      nDay++;
      nHour = 0;
  }
  if (nDay > 6) nDay = 0;
  h1 = nHour + (nMin / 60);

  switch (nDay) {
  case 0:
    if ((h1 >= 16.5) && (h1 <= 18)) showTime("Rahu  ","W","Sun");
    else if (h1 >= 15 && h1 < 16.5) showTime("Gulika","W","Sun");
    else if ((h1 >= 12 && h1 <= 13.5) || (h1 >= 18 && h1 <= 19.5)) 
showTime("Yama  ","W","Sun");
    else showTimeOnly("Sun");
    break;
  case 1:
    if (h1 >= 7.5 && h1 <= 9) showTime("Rahu  ","E","Mon");
    else if (h1 >= 13.5 && h1 < 15) showTime("Gulika","E","Mon");
    else if ((h1 >= 10.5 && h1 <= 12) || (h1 >= 3 && h1 <= 4.5)) 
showTime("Yama  ","E","Mon");
    else showTimeOnly("Mon");
    break;
  case 2:
    if (h1 >= 15 && h1 <= 16.5) showTime("Rahu  ","N","Tue");
    else if (h1 >= 12 && h1 < 13.5) showTime("Gulika","N","Tue");
    else if ((h1 >= 9 && h1 <= 10.5) || (h1 >= 1.5 && h1 <= 3)) 
showTime("Yama  ","N","Tue");
    else showTimeOnly("Tue");
    break;
  case 3:
    if (h1 >= 12 && h1 <= 13.5) showTime("Rahu  ","N","Wed");
    else if (h1 >= 10.5 && h1 < 12) showTime("Gulika","N","Wed");
    else if (h1 >= 7.5 && h1 <= 9) showTime("Yama  ","N","Wed");
    else showTimeOnly("Wed");
    break;
  case 4:
    if (h1 >= 13.5 && h1 <= 15) showTime("Rahu  ","S","Thu");
    else if (h1 >= 9 && h1 < 10.5) showTime("Gulika","S","Thu");
    else if ((h1 >= 6 && h1 <= 7.5) || (h1 >= 22 && h1 <= 24)) 
showTime("Yama  ","S","Thu");
    else showTimeOnly("Thu");
    break;
  case 5:
    if (h1 >= 10.5 && h1 <= 12) showTime("Rahu  ","W","Fri");
    else if (h1 >= 7.5 && h1 < 9) showTime("Gulika","W","Fri");
    else if ((h1 >= 15 && h1 <= 16.5) || (h1 >= 19.5 && h1 <= 21)) 
showTime("Yama  ","W","Fri");
    else showTimeOnly("Fri");
    break;
  case 6:
    if (h1 >= 9 && h1 <= 10.5) showTime("Rahu  ","E","Sat");
    else if (h1 >= 6 && h1 < 7.5) showTime("Gulika","E","Sat");
    else if ((h1 >= 13.5 && h1 <= 15) || (h1 >= 19.5 && h1 <= 21)) 
showTime("Yama  ","E","Sat");
    else showTimeOnly("Sat");
    break;
  default: 
    break;
  }
}

ShowTime has three parameters - the Kaala event, direction to avoid and the weekday.
Read more about this in the upcoming book “Vedic Machine