Coder Social home page Coder Social logo

Using It about jyotish HOT 83 OPEN

kunjara avatar kunjara commented on May 29, 2024 2
Using It

from jyotish.

Comments (83)

nagarajan010 avatar nagarajan010 commented on May 29, 2024 10

Hi,
I think I have managed to find how to use the library, below is the process i have used to generate birth chart data

  1. Download the library from github
  2. you need composer to install additional required libraries
  3. go to the downloaded directory, where you can see a composer.json file
  4. run composer install in the directory
  5. After it's finished, create a new index.php file in that directory, add the following code in it
require './vendor/autoload.php';

use Jyotish\Base\Data;
use Jyotish\Base\Locality;
use Jyotish\Base\Analysis;
use Jyotish\Ganita\Method\Swetest;
use Jyotish\Dasha\Dasha;
$Locality = new Locality([
            'longitude' => "11.09",
            'latitude' => "79.6",
            'altitude' => 0,
            ]);
$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
$DateTime->setDate(2017,09,26);
$DateTime->setTime(19,18);
$Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]);
// for linux
// run sudo apt install libswe-dev
// after that use 
// $Ganita = new Swetest(["swetest" => "/usr/bin/"]);
$data = new Data($DateTime, $Locality, $Ganita);
// To Calculate Panchangam
$data->calcParams();
$data->calcRising();
$data->calcPanchanga();
// To calculate Upagraha
$data->calcUpagraha();
// To calculate Birth chart Divisions
$data->calcVargaData(["D1","D2","D3","D4","D7","D9","D10","D12",
"D16","D20","D24","D27","D30","D40","D45","D60"]);

you will get the degrees of planets with correct lagna

Update: Thanks to @mattchambers for pointing out the error in timezone setting

Update: Thanks to @eaglehawkstudio fixed an error in swetest path for windows

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024 5

@buzznirnay
I have done a small example using different features of the library

<?php
require './vendor/autoload.php';
// error_reporting(E_ALL);
// ini_set('display_errors', 1);
use Jyotish\Base\Data;
use Jyotish\Base\Locality;
use Jyotish\Base\Analysis;
use Jyotish\Ganita\Method\Swetest;
use Jyotish\Dasha\Dasha;
$Locality = new Locality([
            'longitude' => "77.80",
            'latitude' => "11.56",
            'altitude' => 0,
            ]);


$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
$DateTime->setDate(2000, 8, 27);
$DateTime->setTime(15,28);
// $Ganita = new Swetest(["swetest" => ""]);
// // for linux
// // run sudo apt install libswe-dev
// // after that use 
$Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]);
// $Ganita = new Swetest(["swetest" => "/usr/bin/"]);
$data = new Data($DateTime, $Locality, $Ganita);
// To Calculate Panchangam
$data->calcParams();
$data->calcRising();
$data->calcPanchanga();
// To calculate Upagraha
$data->calcUpagraha();

$data->calcDasha("vimshottari", null);
		// $data->calcYoga(['mahapurusha','Dhana','RAJA']);
		// $data->calcHora();
	$data->calcExtraLagna();
	// $data->calcBhavaArudha();
	$Analysis = new Analysis($data);
		$new = [
			"data" => $data,
			"Analysis" => $Analysis,
		];


$dasha = $data->getData()['dasha']['vimshottari']['periods'];

?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-4">
				<h3>Panchanga</h3>
				<ul>
					<li>Thiti: <?php echo $data->getData()['panchanga']['tithi']['paksha'] . ' ' .$data->getData()['panchanga']['tithi']['name'] . ' ' .round($data->getData()['panchanga']['tithi']['left'], 2) . ' % left'; ?></li>
					<li>Nakshatra: <?php echo $data->getData()['panchanga']['nakshatra']['name']; ?></li>
					<li>Yoga: <?php echo $data->getData()['panchanga']['yoga']['name']; ?></li>
					<li>Vara: <?php echo $data->getData()['panchanga']['vara']['name']; ?> Lord: <?php echo $data->getData()['panchanga']['vara']['key']; ?></li>
					<li>Karana: <?php echo $data->getData()['panchanga']['karana']['name']; ?></li>
				</ul>
			</div>

			<div class="col-md-4">
				<h5>D1 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($data->getData()['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($data->getData()['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D2 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D2")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D2")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D3 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D3")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D3")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D4 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D4")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D4")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D7 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D7")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D7")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D9 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D9")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D9")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D10 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D10")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D10")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D12 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D12")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D12")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D16 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D16")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D16")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D20 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D20")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D20")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D24 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D24")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D24")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D27 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D27")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D27")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D30 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D30")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D30")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D40 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D40")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D40")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D45 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D45")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D45")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h5>D60 Details</h5>
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>Name</th>
							<th>Degree</th>
							<th>Sign</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($Analysis->getVargaData("D60")['lagna'] as $key => $lagna): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $lagna['longitude']; ?></td>
							<td><?php echo $lagna['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
						<?php foreach ($Analysis->getVargaData("D60")['graha'] as $key => $graha): ?>
						<tr>
							<td><?php echo $key; ?></td>
							<td><?php echo $graha['longitude']; ?></td>
							<td><?php echo $graha['rashi']; ?></td>
						</tr>
						<?php endforeach ?>
					</tbody>
				</table>
			</div>
			<div class="col-md-4">
				<h2 class="sub-heading-dasha">Vimshotri Maha Dasha</h2>
      <ul>
      	<?php foreach ($dasha as $key => $single): ?>
        <li  class="dasha"><?php echo $key ?> - <?php echo $single['start'] ?> - <?php echo $single['end'] ?>

            <ul class="antradasha">
                <?php foreach ($single['periods'] as $key => $one): ?>
                <h2 class="sub-heading-dasha">Antardasha</h2>
                <li><?php echo $key ?> - <?php echo $one['start'] ?> - <?php echo $one['end'] ?>

                    <ul>
                        <h2 class="sub-heading-dasha">Pratyantardasha</h2>

                	<?php foreach ($one['periods'] as $key => $one): ?>
                        <li><?php echo $key ?> - <?php echo $one['start'] ?> - <?php echo $one['end'] ?></li>
      	<?php endforeach ?>
                    </ul> 
                </li>

      	<?php endforeach ?>
            </ul> 
        </li>   
      	<?php endforeach ?>
    </ul>
			</div>
		</div>
	</div>
</body>
</html>

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024 4

@shikhardb

i think you forgot to add the opening php tags at top

like this before require

<?php
require './vendor/autoload.php';

can you check it ?

it was not in my code before sorry!

from jyotish.

kunjara avatar kunjara commented on May 29, 2024 2

Documentation will be after library should be released stable.

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024 2

@AnandMSINGH
Great that you found it :)
Was not able to find how to use the jyotish_draw library, please do let us know if you figure it out

from jyotish.

jscuba avatar jscuba commented on May 29, 2024 2

This is a relatively simple way to get this library up and running on AWS Lambda. https://github.com/jscuba/jyotish-lambda

I posted this a few places in the issues. I thought I'd post it here in the "docs" too. I hope it helps.

from jyotish.

kunjara avatar kunjara commented on May 29, 2024 1

Documentation coming soon.

from jyotish.

vtoms avatar vtoms commented on May 29, 2024 1

jyotish.su looks great!! I am very much looking forward to the documentation to use for Panchanga and natal charts. I have been trying to make the swetest.exe work but it always ends up with the wrong output.

from jyotish.

mattchambers avatar mattchambers commented on May 29, 2024 1

@nagarajan010

You're example works great but when I used it, the data returned from the library was inaccurate. I realized it was due to the timezone being stated after the date and time for the DateTime object.

Here's what I did and everything works like a charm using your example.

Thank you

$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('America/New_York'));
$DateTime->setDate(2017,09,26);
$DateTime->setTime(19,18);

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024 1

@mattchambers

Thank you, by using your example am able to get accurate data and I have updated the code in my above post

from jyotish.

eaglehawkstudio avatar eaglehawkstudio commented on May 29, 2024 1

Thank you @nagarajan010 - Now have it working beautifully on Windows. A couple of notes:

  • Mac users - To test locally, I'm utilizing Parallels Desktop (https://www.parallels.com/products/desktop/).
  • When establishing the the path to define $Ganita - had to add a '.' before the first slash to get it working ($Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]);).
  • To work remotely - had to employ a VPS running Windows so the swetest.exe file would execute (as opposed to a shared hosting solution)

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024 1

@imviv3k
i think you have not configured the swetest well, you need to make sure there is a swetest.exe in folder
vendor\kunjara\swetest\win\

from jyotish.

shikhardb avatar shikhardb commented on May 29, 2024 1

@nagarajan010
Yes, I copied the complete code as below

require './vendor/autoload.php';
// error_reporting(E_ALL);
// ini_set('display_errors', 1);
use Jyotish\Base\Data;
use Jyotish\Base\Locality;
use Jyotish\Base\Analysis;
use Jyotish\Ganita\Method\Swetest;
use Jyotish\Dasha\Dasha;
$Locality = new Locality([
'longitude' => "77.80",
'latitude' => "11.56",
'altitude' => 0,
]);

$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
$DateTime->setDate(2000, 8, 27);
$DateTime->setTime(15,28);
// $Ganita = new Swetest(["swetest" => ""]);
// // for linux
// // run sudo apt install libswe-dev
// // after that use
$Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]);
// For Linux
// $Ganita = new Swetest(["swetest" => "/usr/bin/"]);
$data = new Data($DateTime, $Locality, $Ganita);
// To Calculate Panchangam
$data->calcParams();
$data->calcRising();
$data->calcPanchanga();
// To calculate Upagraha
$data->calcUpagraha();

$data->calcDasha("vimshottari", null);
// $data->calcYoga(['mahapurusha','Dhana','RAJA']);
// $data->calcHora();
$data->calcExtraLagna();
// $data->calcBhavaArudha();
$Analysis = new Analysis($data);
$new = [
"data" => $data,
"Analysis" => $Analysis,
];

$dasha = $data->getData()['dasha']['vimshottari']['periods'];

?>

<title>Document</title> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

Panchanga

  • Thiti: getData()['panchanga']['tithi']['paksha'] . ' ' .$data->getData()['panchanga']['tithi']['name'] . ' ' .round($data->getData()['panchanga']['tithi']['left'], 2) . ' % left'; ?>
  • Nakshatra: getData()['panchanga']['nakshatra']['name']; ?>
  • Yoga: getData()['panchanga']['yoga']['name']; ?>
  • Vara: getData()['panchanga']['vara']['name']; ?> Lord: getData()['panchanga']['vara']['key']; ?>
  • Karana: getData()['panchanga']['karana']['name']; ?>
		<div class="col-md-4">
			<h5>D1 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($data->getData()['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($data->getData()['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D2 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D2")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D2")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D3 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D3")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D3")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D4 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D4")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D4")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D7 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D7")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D7")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D9 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D9")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D9")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D10 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D10")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D10")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D12 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D12")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D12")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D16 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D16")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D16")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D20 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D20")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D20")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D24 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D24")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D24")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D27 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D27")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D27")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D30 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D30")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D30")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D40 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D40")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D40")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D45 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D45")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D45")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D60 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D60")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D60")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h2 class="sub-heading-dasha">Vimshotri Maha Dasha</h2>
  <ul>
  	<?php foreach ($dasha as $key => $single): ?>
    <li  class="dasha"><?php echo $key ?> - <?php echo $single['start'] ?> - <?php echo $single['end'] ?>

        <ul class="antradasha">
            <?php foreach ($single['periods'] as $key => $one): ?>
            <h2 class="sub-heading-dasha">Antardasha</h2>
            <li><?php echo $key ?> - <?php echo $one['start'] ?> - <?php echo $one['end'] ?>

                <ul>
                    <h2 class="sub-heading-dasha">Pratyantardasha</h2>

            	<?php foreach ($one['periods'] as $key => $one): ?>
                    <li><?php echo $key ?> - <?php echo $one['start'] ?> - <?php echo $one['end'] ?></li>
  	<?php endforeach ?>
                </ul> 
            </li>

  	<?php endforeach ?>
        </ul> 
    </li>   
  	<?php endforeach ?>
</ul>
		</div>
	</div>
</div>

And the error which I am getting is :

image

from jyotish.

vadimbashirof avatar vadimbashirof commented on May 29, 2024 1

I found a way to use this plugin with php 7.2
If you have the following error:
Fatal error: Cannot use it in src\Base\Object.php on line 14

Take the following steps:

  1. Rename the src\Bas\Object.php file to src\Bas\BaseObject.php
  2. Now in this file src\Bas\BaseObject.php
    line 14 'class Object' => 'class BaseObject'
  3. Open src\Bhava\Object\BhavaObject.php
    9 line use Jyotish\Base\Object; => use Jyotish\Base\BaseObject;
    16 line class BhavaObject extends Object { => class BhavaObject extends BaseObject {
  4. Open src\Graha\Object\GrahaObject.php
    10 line use Jyotish\Base\Object; => use Jyotish\Base\BaseObject;
    21 line class GrahaObject extends Object => class GrahaObject extends BaseObject
  5. Open src\Rashi\Object\RashiObject.php
    19 line class RashiObject extends \Jyotish\Base\Object => class RashiObject extends \Jyotish\Base\BaseObject
  6. Open src\Base\Traits\EnvironmentTrait.php
    line 38 * @return \Jyotish\Base\Object => * @return \Jyotish\Base\BaseObject
  7. Start php 7.2

from jyotish.

rajeev-k-tomy avatar rajeev-k-tomy commented on May 29, 2024

I am also planning to use it.. I just want to know whether this repo is ready for using in production environment !!

from jyotish.

klodha avatar klodha commented on May 29, 2024

Is it possible to get hindu month name for current tithi using this api?

from jyotish.

mahen3d avatar mahen3d commented on May 29, 2024

is it possible to add the matching capability to this ? plus ability to change the charkra to East indian style will be great.

from jyotish.

kunjara avatar kunjara commented on May 29, 2024

is it possible to add the matching capability to this? plus ability to change the charkra to East indian style will be great.

You can choose one of three styles: East, North or South

from jyotish.

sathishnagarajan01 avatar sathishnagarajan01 commented on May 29, 2024

This is great library, i know little bit about astrology, i got your library which is ganita and base is the core for passing the arguments of date, time, timezone, etc... , eventhough some confusion occurs, so we all waiting for your documentation, Thank you for this great work.

from jyotish.

Kalianey avatar Kalianey commented on May 29, 2024

What is the main function to call to get a chart calculation? Like on your demo website, which function are you calling with the button Calculate -> Chakra (Chart)? Some pointers would be great :)

from jyotish.

rohithdiya avatar rohithdiya commented on May 29, 2024

Hi, how do i use your library to calculate Rasi of a person based on his date of birth, time of birth and place of birth ?

from jyotish.

rahulyhg avatar rahulyhg commented on May 29, 2024

any documentation?

from jyotish.

Kalianey avatar Kalianey commented on May 29, 2024

With this code I get a lot of notices (like 50) and the data is incomplete:
Notice: Undefined index: Sy in /Applications/XAMPP/xamppfiles/htdocs/jyotish-master/src/Graha/Upagraha.php on line 76 Notice: Undefined offset: 2 in /Applications/XAMPP/xamppfiles/htdocs/jyotish-master/src/Ganita/Method/Swetest.php on line 283 Notice: Undefined index: graha in /Applications/XAMPP/xamppfiles/htdocs/jyotish-master/src/Ganita/Method/Swetest.php on line 251 etc... Any idea why?

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@Kalianey
i think as you are in mac you need to find a mac version of Swetest and replace in that folder

from jyotish.

mattchambers avatar mattchambers commented on May 29, 2024

@Kalianey

what OS are you developing in and plan to deploy in?

from jyotish.

eaglehawkstudio avatar eaglehawkstudio commented on May 29, 2024

Thank you for the instructions above Having the same issue as @Kalianey - On Mac OSX locally and Linux remotely. Any luck finding a mac version of Swetest?

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@eaglehawkstudio I have not been able to find any solution to make it work in mac, my suggestion is to use a Linux or Windows machine to develop

from jyotish.

imviv3k avatar imviv3k commented on May 29, 2024

I just followed the above given steps but getting the following error.

Notice: Undefined variable: DateTime in C:\xampp\htdocs\astro1\jyotish\index.php on line 15

Fatal error: Call to a member function setTimezone() on null in C:\xampp\htdocs\astro1\jyotish\index.php on line 15

Please help! Thanks

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@imviv3k please add this like before you set the time zone
$DateTime = new DateTime();
The code has been corrected to include this line in the post above

from jyotish.

imviv3k avatar imviv3k commented on May 29, 2024

Hellow @nagarajan010
After setting that line of code i am getting the following output,
Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 281

Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 6 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 281

Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 6 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 4 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 281

Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 6 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 281

Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 6 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Warning: Division by zero in C:\xampp\htdocs\astro1\jyotish\src\Panchanga\AngaDefiner.php on line 267

and nothing is being displayed thereafter. I will be very much thankful for your kind help.

from jyotish.

rahulyhg avatar rahulyhg commented on May 29, 2024

@imviv3k
mail me details will guide you.

from jyotish.

imviv3k avatar imviv3k commented on May 29, 2024

thanks a lot for replying
first image shows the root folder where i have created index.php file. (code taken from above post)
but i can see swetest.exe file is there in vendor\kunjara\swetest\win\ folder.
1
2

from jyotish.

astrosanthosh avatar astrosanthosh commented on May 29, 2024

changing swetest.exe to the folder where index.php is there will solve your problem.

from jyotish.

imviv3k avatar imviv3k commented on May 29, 2024

@astrosanthosh that did not help!

from jyotish.

astrosanthosh avatar astrosanthosh commented on May 29, 2024

I mean in the folder where exec command used, this folder
C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method

from jyotish.

krishnaguragain avatar krishnaguragain commented on May 29, 2024

The error is produced by an empty array at Swetest.php:281
Please use isset there.

from jyotish.

krishnaguragain avatar krishnaguragain commented on May 29, 2024

Something like
str_replace(' ', '', (isset($matches[2]))?$matches[2]:NULL).' '.str_replace(' ', '',(isset($matches[3]))?$matches[3]:NULL);
instead of
str_replace(' ', '', $matches[2]).' '.str_replace(' ', '', $matches[3]);

from jyotish.

imviv3k avatar imviv3k commented on May 29, 2024

@rahulyhg will you please drop me your email at vivek@vivekpublicschool(dot)edu(dot)in
g will you please drop me your email at vivek@vivekpublicschool(dot)edu(dot)in

from jyotish.

rahulyhg avatar rahulyhg commented on May 29, 2024

@imviv3k
mail sent.

from jyotish.

southglitz avatar southglitz commented on May 29, 2024

any one please help me to use this software please southglitz at gmail dot com

from jyotish.

buzznirnay avatar buzznirnay commented on May 29, 2024

@nagarajan010 Request you to help me with the error. I am using PHP 7.0.30 to build the library and run it through APACHE. Now it throws me an error saying that Fatal error: Cannot use 'Object' as class name as it is reserved in C:\xampp\htdocs\Jyotish\src\Base\Object.php on line 14

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@buzznirnay please post the code you use and the error message you get, else its hard to find out the issue

from jyotish.

buzznirnay avatar buzznirnay commented on May 29, 2024

@nagarajan010 Thanks for the swift response.

I have used the same steps as provided by you above. I have used the same index.php file as defined by you. It was giving me some error regarding the object cannot be used as a class name. Researched and found out I have to downgrade to 7.0.25. Now I am on XAMPP7.0.2 and PHP 7.0.25. Now on going to localhost/jyotish/index.php shows a blank page.

What to do ? Please suggest? Let me know what codes you want in case you need any.

Solution will be really appreciated

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@buzznirnay
after this line

$data->calcVargaData(["D1","D2","D3","D4","D7","D9","D10","D12",
"D16","D20","D24","D27","D30","D40","D45","D60"]);

add

var_dump($data);

and you will see the data of each varga

from jyotish.

buzznirnay avatar buzznirnay commented on May 29, 2024

object(Jyotish\Base\Data)#5 (4) { ["DateTime":"Jyotish\Base\Data":private]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2017-09-26 19:18:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Asia/Kolkata" } ["Locality":"Jyotish\Base\Data":private]=> object(Jyotish\Base\Locality)#3 (3) { ["longitude":protected]=> float(11.09) ["latitude":protected]=> float(79.6) ["altitude":protected]=> float(0) } ["Ganita":"Jyotish\Base\Data":private]=> object(Jyotish\Ganita\Method\Swetest)#4 (10) { ["swe":protected]=> array(2) { ["swetest"]=> string(29) "./vendor/kunjara/swetest/win/" ["sweph"]=> string(29) "./vendor/kunjara/swetest/win/" } ["inputAyanamsha":protected]=> array(10) { ["Fagan"]=> string(1) "0" ["Lahiri"]=> string(1) "1" ["Deluce"]=> string(1) "2" ["Raman"]=> string(1) "3" ["Ushashashi"]=> string(1) "4" ["Krishnamurti"]=> string(1) "5" ["Djwhalkhul"]=> string(1) "6" ["Yukteshwar"]=> string(1) "7" ["Jnbhasin"]=> string(1) "8" ["Sassanian"]=> string(2) "16" } ["inputPlanets":protected]=> array(8) { ["Sy"]=> string(1) "0" ["Ch"]=> string(1) "1" ["Ma"]=> string(1) "4" ["Bu"]=> string(1) "2" ["Gu"]=> string(1) "5" ["Sk"]=> string(1) "3" ["Sa"]=> string(1) "6" ["Ra"]=> string(1) "m" } ["outputPlanets":protected]=> array(8) { ["Sun"]=> string(2) "Sy" ["Moon"]=> string(2) "Ch" ["Mars"]=> string(2) "Ma" ["Mercury"]=> string(2) "Bu" ["Jupiter"]=> string(2) "Gu" ["Venus"]=> string(2) "Sk" ["Saturn"]=> string(2) "Sa" ["meanNode"]=> string(2) "Ra" } ["outputHouses":protected]=> array(12) { ["house1"]=> int(1) ["house2"]=> int(2) ["house3"]=> int(3) ["house4"]=> int(4) ["house5"]=> int(5) ["house6"]=> int(6) ["house7"]=> int(7) ["house8"]=> int(8) ["house9"]=> int(9) ["house10"]=> int(10) ["house11"]=> int(11) ["house12"]=> int(12) } ["outputLagna":protected]=> array(2) { ["Ascendant"]=> string(2) "Lg" ["MC"]=

@nagarajan010 please HELP
I am getting something like this. Is this the expected output. If yes, then how to display the data on the webpage? If no, please suggest what to do?

Beginner here so please bear with me

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@buzznirnay

i will post a full example some time today

from jyotish.

buzznirnay avatar buzznirnay commented on May 29, 2024

@nagarajan010 That will be so helpful. Will be waiting for the same.

from jyotish.

buzznirnay avatar buzznirnay commented on May 29, 2024

@nagarajan010 It works like magic!! Thanks a ton for your help.

Just wondering whether are there any more data which can be called

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@buzznirnay
I have forgot to add upagarhas and there are arudha and bhava arudhas and hora calculations
but arudha calculation is done using degrees which i dont use

and the library by default uses lahiri ayanamsha

when you use php it auto calculates all the day light savings time for the year, but its not very good for war time around year 1945

from jyotish.

shikhardb avatar shikhardb commented on May 29, 2024

@nagarajan010 I tried to do with your example. But i get this error:

image

@buzznirnay Would you be able to explain how you did it?

from jyotish.

buzznirnay avatar buzznirnay commented on May 29, 2024

@shikhardb What is the environment that you are using? What version of PHP are you using? Have you build the library after downloading the files. Have you got a sweetest.exe file in those libraries

from jyotish.

shikhardb avatar shikhardb commented on May 29, 2024

@buzznirnay My PHP version is 5.6.31
I'm running on WampServer Version 3.1.0
On a Windows 10 machine.
I have the swetest.exe also.
I downloaded all dependencies by composer.phar

Am I still missing something?

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@shikhardb
please post your code here
the error message is saying it cant find the variable $data are you sure you have copied the full code from example ?
also did you check and make sure if the swetest.exe path is correct ?

from jyotish.

buzznirnay avatar buzznirnay commented on May 29, 2024

@shikhardb you found it!!!

from jyotish.

shikhardb avatar shikhardb commented on May 29, 2024

@nagarajan010 Works perfect. Thanks. 🙂

from jyotish.

AnandMSINGH avatar AnandMSINGH commented on May 29, 2024

Hello Friends, could anyone please check why is the calculate rising is failing for the given parameters?

$Locality = new Locality([
'longitude' => 25.8973,
'latitude' => 81.9453,
'altitude' => 0,
]);
$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
$DateTime->setDate(1985,01,21);
$DateTime->setTime(05,10,00);

$data->calcParams();
$data->calcRising(); this fails
$data->calcPanchanga();

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@AnandMSINGH
Try removing the seconds

from jyotish.

AnandMSINGH avatar AnandMSINGH commented on May 29, 2024

Thanks @nagarajan010, but that's not the issue. Latitude and Longitude were placed incorrectly. It's working now.

Have you tried using their jyotish_draw library too? I am exploring how that can be used :)

from jyotish.

mohnot avatar mohnot commented on May 29, 2024

The Natal/Divisional charts generated using these libraries differ from the one used in other (major) Indian apps/websites like astrosage etc. This is primarily arising owing to difference in degrees and lagna. Could any one please help us rectify the Charts generated ?

Here is one example :

Date of Birth : 26 June 2018 , Time of Birth : 16:48 , Place of birth : Bharatpur India

Natal Chart
Kunjara Kundali : Lagna is Virgo
Most other websites : Langa is Scorpio

The difference exists in all Divisional charts too.

Will request the developer of these libraries and other fellow developers to help us with the changes needed in the php code to rectify this.

Thanks !

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

@mohnot
i think you have mixed up the latitide and longitude just swap them should give you correct lagna

from jyotish.

vadimbashirof avatar vadimbashirof commented on May 29, 2024

Hello! I want to use this library in a project on Laravel 5.7 using php> = 7.1.3.
When I use php = 7.0, everything works fine for me. When I use php 7.2, then I see this line

Fatal error: Cannot use it in jyotish\src\Base\Object.php on line 14

Is this something you can fix to make it work with php 7.2?

from jyotish.

govindarajan78 avatar govindarajan78 commented on May 29, 2024

Hi,
How to change the Ayanamsa to KP

Thanks,
Govind

from jyotish.

xxrocks avatar xxrocks commented on May 29, 2024

How to access public functions like getRahuKala() ?

from jyotish.

nanoakhi avatar nanoakhi commented on May 29, 2024

Hi,
I think I have managed to find how to use the library, below is the process i have used to generate birth chart data

  1. Download the library from github
  2. you need composer to install additional required libraries
  3. go to the downloaded directory, where you can see a composer.json file
  4. run composer install in the directory
  5. After it's finished, create a new index.php file in that directory, add the following code in it
require './vendor/autoload.php';

use Jyotish\Base\Data;
use Jyotish\Base\Locality;
use Jyotish\Base\Analysis;
use Jyotish\Ganita\Method\Swetest;
use Jyotish\Dasha\Dasha;
$Locality = new Locality([
            'longitude' => "11.09",
            'latitude' => "79.6",
            'altitude' => 0,
            ]);
$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
$DateTime->setDate(2017,09,26);
$DateTime->setTime(19,18);
$Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]);
// for linux
// run sudo apt install libswe-dev
// after that use 
// $Ganita = new Swetest(["swetest" => "/usr/bin/"]);
$data = new Data($DateTime, $Locality, $Ganita);
// To Calculate Panchangam
$data->calcParams();
$data->calcRising();
$data->calcPanchanga();
// To calculate Upagraha
$data->calcUpagraha();
// To calculate Birth chart Divisions
$data->calcVargaData(["D1","D2","D3","D4","D7","D9","D10","D12",
"D16","D20","D24","D27","D30","D40","D45","D60"]);

you will get the degrees of planets with correct lagna

Update: Thanks to @mattchambers for pointing out the error in timezone setting

Update: Thanks to @eaglehawkstudio fixed an error in swetest path for windows

May i know step by step process.I am unable to do where to start and where to put index.php
Kindly Help

from jyotish.

nanoakhi avatar nanoakhi commented on May 29, 2024

@nagarajan010
Yes, I copied the complete code as below

require './vendor/autoload.php';
// error_reporting(E_ALL);
// ini_set('display_errors', 1);
use Jyotish\Base\Data;
use Jyotish\Base\Locality;
use Jyotish\Base\Analysis;
use Jyotish\Ganita\Method\Swetest;
use Jyotish\Dasha\Dasha;
$Locality = new Locality([
'longitude' => "77.80",
'latitude' => "11.56",
'altitude' => 0,
]);

$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
$DateTime->setDate(2000, 8, 27);
$DateTime->setTime(15,28);
// $Ganita = new Swetest(["swetest" => ""]);
// // for linux
// // run sudo apt install libswe-dev
// // after that use
$Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]);
// For Linux
// $Ganita = new Swetest(["swetest" => "/usr/bin/"]);
$data = new Data($DateTime, $Locality, $Ganita);
// To Calculate Panchangam
$data->calcParams();
$data->calcRising();
$data->calcPanchanga();
// To calculate Upagraha
$data->calcUpagraha();

$data->calcDasha("vimshottari", null);
// $data->calcYoga(['mahapurusha','Dhana','RAJA']);
// $data->calcHora();
$data->calcExtraLagna();
// $data->calcBhavaArudha();
$Analysis = new Analysis($data);
$new = [
"data" => $data,
"Analysis" => $Analysis,
];

$dasha = $data->getData()['dasha']['vimshottari']['periods'];

?>

<title>Document</title> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> ### Panchanga * Thiti: getData()['panchanga']['tithi']['paksha'] . ' ' .$data->getData()['panchanga']['tithi']['name'] . ' ' .round($data->getData()['panchanga']['tithi']['left'], 2) . ' % left'; ?> * Nakshatra: getData()['panchanga']['nakshatra']['name']; ?> * Yoga: getData()['panchanga']['yoga']['name']; ?> * Vara: getData()['panchanga']['vara']['name']; ?> Lord: getData()['panchanga']['vara']['key']; ?> * Karana: getData()['panchanga']['karana']['name']; ?>
		<div class="col-md-4">
			<h5>D1 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($data->getData()['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($data->getData()['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D2 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D2")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D2")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D3 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D3")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D3")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D4 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D4")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D4")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D7 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D7")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D7")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D9 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D9")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D9")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D10 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D10")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D10")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D12 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D12")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D12")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D16 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D16")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D16")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D20 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D20")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D20")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D24 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D24")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D24")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D27 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D27")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D27")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D30 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D30")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D30")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D40 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D40")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D40")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D45 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D45")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D45")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D60 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D60")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D60")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h2 class="sub-heading-dasha">Vimshotri Maha Dasha</h2>
  <ul>
  	<?php foreach ($dasha as $key => $single): ?>
    <li  class="dasha"><?php echo $key ?> - <?php echo $single['start'] ?> - <?php echo $single['end'] ?>

        <ul class="antradasha">
            <?php foreach ($single['periods'] as $key => $one): ?>
            <h2 class="sub-heading-dasha">Antardasha</h2>
            <li><?php echo $key ?> - <?php echo $one['start'] ?> - <?php echo $one['end'] ?>

                <ul>
                    <h2 class="sub-heading-dasha">Pratyantardasha</h2>

            	<?php foreach ($one['periods'] as $key => $one): ?>
                    <li><?php echo $key ?> - <?php echo $one['start'] ?> - <?php echo $one['end'] ?></li>
  	<?php endforeach ?>
                </ul> 
            </li>

  	<?php endforeach ?>
        </ul> 
    </li>   
  	<?php endforeach ?>
</ul>
		</div>
	</div>
</div>

And the error which I am getting is :

image

Hi Can u help me how to use this project .I have Wamp instaled but when i accessing from www. Its nothing so anything.what is wrong

from jyotish.

chakracharyulu avatar chakracharyulu commented on May 29, 2024

when I was run window swisstest file getting error its showing splc_18.se is not found in the path. using Moshier eph.
how can I find out tithi, vara, nakshatra, yoga, Karna, start time and end time?
I was developed Android Panchang app but we have stopped at the point of Masa Calculations.
How can I calculate Masa, Adhika masa and Kshaya Masa?
do you know the calculations of masa, please provide any language code.

from jyotish.

krishnaguragain avatar krishnaguragain commented on May 29, 2024

@chakracharyulu Please go through this script. You can find here http://www.cc.kyoto-su.ac.jp/~yanom/sanskrit/pancanga/pancanga3.14

from jyotish.

arunwebber avatar arunwebber commented on May 29, 2024

Hi,
I think I have managed to find how to use the library, below is the process i have used to generate birth chart data

  1. Download the library from github
  2. you need composer to install additional required libraries
  3. go to the downloaded directory, where you can see a composer.json file
  4. run composer install in the directory
  5. After it's finished, create a new index.php file in that directory, add the following code in it
require './vendor/autoload.php';

use Jyotish\Base\Data;
use Jyotish\Base\Locality;
use Jyotish\Base\Analysis;
use Jyotish\Ganita\Method\Swetest;
use Jyotish\Dasha\Dasha;
$Locality = new Locality([
            'longitude' => "11.09",
            'latitude' => "79.6",
            'altitude' => 0,
            ]);
$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
$DateTime->setDate(2017,09,26);
$DateTime->setTime(19,18);
$Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]);
// for linux
// run sudo apt install libswe-dev
// after that use 
// $Ganita = new Swetest(["swetest" => "/usr/bin/"]);
$data = new Data($DateTime, $Locality, $Ganita);
// To Calculate Panchangam
$data->calcParams();
$data->calcRising();
$data->calcPanchanga();
// To calculate Upagraha
$data->calcUpagraha();
// To calculate Birth chart Divisions
$data->calcVargaData(["D1","D2","D3","D4","D7","D9","D10","D12",
"D16","D20","D24","D27","D30","D40","D45","D60"]);

you will get the degrees of planets with correct lagna

Update: Thanks to @mattchambers for pointing out the error in timezone setting

Update: Thanks to @eaglehawkstudio fixed an error in swetest path for windows

This is not working on ubuntu as there is an exe file associatted with it

from jyotish.

arunwebber avatar arunwebber commented on May 29, 2024

Hi,
I think I have managed to find how to use the library, below is the process i have used to generate birth chart data

  1. Download the library from github
  2. you need composer to install additional required libraries
  3. go to the downloaded directory, where you can see a composer.json file
  4. run composer install in the directory
  5. After it's finished, create a new index.php file in that directory, add the following code in it
require './vendor/autoload.php';

use Jyotish\Base\Data;
use Jyotish\Base\Locality;
use Jyotish\Base\Analysis;
use Jyotish\Ganita\Method\Swetest;
use Jyotish\Dasha\Dasha;
$Locality = new Locality([
            'longitude' => "11.09",
            'latitude' => "79.6",
            'altitude' => 0,
            ]);
$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
$DateTime->setDate(2017,09,26);
$DateTime->setTime(19,18);
$Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]);
// for linux
// run sudo apt install libswe-dev
// after that use 
// $Ganita = new Swetest(["swetest" => "/usr/bin/"]);
$data = new Data($DateTime, $Locality, $Ganita);
// To Calculate Panchangam
$data->calcParams();
$data->calcRising();
$data->calcPanchanga();
// To calculate Upagraha
$data->calcUpagraha();
// To calculate Birth chart Divisions
$data->calcVargaData(["D1","D2","D3","D4","D7","D9","D10","D12",
"D16","D20","D24","D27","D30","D40","D45","D60"]);

you will get the degrees of planets with correct lagna

Update: Thanks to @mattchambers for pointing out the error in timezone setting

Update: Thanks to @eaglehawkstudio fixed an error in swetest path for windows

I am getting the error invalid numeric litrals

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

Hi,
I think I have managed to find how to use the library, below is the process i have used to generate birth chart data

  1. Download the library from github
  2. you need composer to install additional required libraries
  3. go to the downloaded directory, where you can see a composer.json file
  4. run composer install in the directory
  5. After it's finished, create a new index.php file in that directory, add the following code in it
require './vendor/autoload.php';

use Jyotish\Base\Data;
use Jyotish\Base\Locality;
use Jyotish\Base\Analysis;
use Jyotish\Ganita\Method\Swetest;
use Jyotish\Dasha\Dasha;
$Locality = new Locality([
            'longitude' => "11.09",
            'latitude' => "79.6",
            'altitude' => 0,
            ]);
$DateTime = new DateTime();
$DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
$DateTime->setDate(2017,09,26);
$DateTime->setTime(19,18);
$Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]);
// for linux
// run sudo apt install libswe-dev
// after that use 
// $Ganita = new Swetest(["swetest" => "/usr/bin/"]);
$data = new Data($DateTime, $Locality, $Ganita);
// To Calculate Panchangam
$data->calcParams();
$data->calcRising();
$data->calcPanchanga();
// To calculate Upagraha
$data->calcUpagraha();
// To calculate Birth chart Divisions
$data->calcVargaData(["D1","D2","D3","D4","D7","D9","D10","D12",
"D16","D20","D24","D27","D30","D40","D45","D60"]);

you will get the degrees of planets with correct lagna

Update: Thanks to @mattchambers for pointing out the error in timezone setting

Update: Thanks to @eaglehawkstudio fixed an error in swetest path for windows

This is not working on ubuntu as there is an exe file associatted with it

for linux
run the below command in terminal and replace the path of swetest to the linux executable location then try using the code
sudo apt install libswe-dev

from jyotish.

nagarajan010 avatar nagarajan010 commented on May 29, 2024

when I was run window swisstest file getting error its showing splc_18.se is not found in the path. using Moshier eph.
how can I find out tithi, vara, nakshatra, yoga, Karna, start time and end time?
I was developed Android Panchang app but we have stopped at the point of Masa Calculations.
How can I calculate Masa, Adhika masa and Kshaya Masa?
do you know the calculations of masa, please provide any language code.

se

you can google and download the missing .se data files and add them

from jyotish.

dlinx avatar dlinx commented on May 29, 2024

What is D1 to D12?
I am refering to this => $data->calcVargaData(["D1","D2","D3","D4","D7","D9","D10","D12", "D16","D20","D24","D27","D30","D40","D45","D60"]);

from jyotish.

nanoakhi avatar nanoakhi commented on May 29, 2024

I have downloaded the clone and placed in my wamp directory then i installed composer
and created index.php with below code:

Whats wrong facing this issues last many days .Heartily gratitude if anyone assist me

"77.80", 'latitude' => "11.56", 'altitude' => 0, ]); $DateTime = new DateTime(); $DateTime->setTimezone(new DateTimeZone('Asia/Kolkata')); $DateTime->setDate(2000, 8, 27); $DateTime->setTime(15,28); // $Ganita = new Swetest(["swetest" => ""]); // // for linux // // run sudo apt install libswe-dev // // after that use $Ganita = new Swetest(["swetest" => "./vendor/kunjara/swetest/win/"]); // $Ganita = new Swetest(["swetest" => "/usr/bin/"]); $data = new Data($DateTime, $Locality, $Ganita); // To Calculate Panchangam $data->calcParams(); $data->calcRising(); $data->calcPanchanga(); // To calculate Upagraha $data->calcUpagraha(); $data->calcDasha("vimshottari", null); // $data->calcYoga(['mahapurusha','Dhana','RAJA']); // $data->calcHora(); $data->calcExtraLagna(); // $data->calcBhavaArudha(); $Analysis = new Analysis($data); $new = [ "data" => $data, "Analysis" => $Analysis, ]; $dasha = $data->getData()['dasha']['vimshottari']['periods']; ?> <title>Document</title> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

Panchanga

  • Thiti: getData()['panchanga']['tithi']['paksha'] . ' ' .$data->getData()['panchanga']['tithi']['name'] . ' ' .round($data->getData()['panchanga']['tithi']['left'], 2) . ' % left'; ?>
  • Nakshatra: getData()['panchanga']['nakshatra']['name']; ?>
  • Yoga: getData()['panchanga']['yoga']['name']; ?>
  • Vara: getData()['panchanga']['vara']['name']; ?> Lord: getData()['panchanga']['vara']['key']; ?>
  • Karana: getData()['panchanga']['karana']['name']; ?>
		<div class="col-md-4">
			<h5>D1 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($data->getData()['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($data->getData()['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D2 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D2")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D2")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D3 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D3")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D3")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D4 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D4")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D4")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D7 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D7")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D7")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D9 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D9")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D9")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D10 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D10")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D10")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D12 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D12")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D12")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D16 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D16")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D16")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D20 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D20")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D20")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D24 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D24")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D24")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D27 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D27")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D27")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D30 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D30")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D30")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D40 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D40")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D40")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D45 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D45")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D45")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h5>D60 Details</h5>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>Name</th>
						<th>Degree</th>
						<th>Sign</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($Analysis->getVargaData("D60")['lagna'] as $key => $lagna): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $lagna['longitude']; ?></td>
						<td><?php echo $lagna['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
					<?php foreach ($Analysis->getVargaData("D60")['graha'] as $key => $graha): ?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $graha['longitude']; ?></td>
						<td><?php echo $graha['rashi']; ?></td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
		<div class="col-md-4">
			<h2 class="sub-heading-dasha">Vimshotri Maha Dasha</h2>
  <ul>
  	<?php foreach ($dasha as $key => $single): ?>
    <li  class="dasha"><?php echo $key ?> - <?php echo $single['start'] ?> - <?php echo $single['end'] ?>

        <ul class="antradasha">
            <?php foreach ($single['periods'] as $key => $one): ?>
            <h2 class="sub-heading-dasha">Antardasha</h2>
            <li><?php echo $key ?> - <?php echo $one['start'] ?> - <?php echo $one['end'] ?>

                <ul>
                    <h2 class="sub-heading-dasha">Pratyantardasha</h2>

            	<?php foreach ($one['periods'] as $key => $one): ?>
                    <li><?php echo $key ?> - <?php echo $one['start'] ?> - <?php echo $one['end'] ?></li>
  	<?php endforeach ?>
                </ul> 
            </li>

  	<?php endforeach ?>
        </ul> 
    </li>   
  	<?php endforeach ?>
</ul>
		</div>
	</div>
</div>

Capture

from jyotish.

MonMohon avatar MonMohon commented on May 29, 2024

@nanoakhi
please add at top
`<?php

require './vendor/autoload.php';
use Jyotish\Base\Data;
use Jyotish\Base\Locality;
use Jyotish\Base\Analysis;
use Jyotish\Ganita\Method\Swetest;
use Jyotish\Dasha\Dasha;
$Locality = new Locality(['longitude' => "77.80", 'latitude' => "11.56", 'altitude' => 0, ]);
`

from jyotish.

chirag-chopra avatar chirag-chopra commented on May 29, 2024

Hellow @nagarajan010
After setting that line of code i am getting the following output,
Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 281

Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 6 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 281

Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 6 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 4 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 281

Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 6 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 281

Notice: Undefined offset: 2 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 3 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 283

Notice: Undefined offset: 5 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Notice: Undefined offset: 6 in C:\xampp\htdocs\astro1\jyotish\src\Ganita\Method\Swetest.php on line 284

Warning: Division by zero in C:\xampp\htdocs\astro1\jyotish\src\Panchanga\AngaDefiner.php on line 267

and nothing is being displayed thereafter. I will be very much thankful for your kind help.

I am getting same error....
please anyone help....

I just want vimshottari code...
PLEASE PLEASE HELP!

from jyotish.

purursharma avatar purursharma commented on May 29, 2024

The Natal/Divisional charts generated using these libraries differ from the one used in other (major) Indian apps/websites like astrosage etc. This is primarily arising owing to difference in degrees and lagna. Could any one please help us rectify the Charts generated ?

Here is one example :

Date of Birth : 26 June 2018 , Time of Birth : 16:48 , Place of birth : Bharatpur India

Natal Chart
Kunjara Kundali : Lagna is Virgo
Most other websites : Langa is Scorpio

The difference exists in all Divisional charts too.

Will request the developer of these libraries and other fellow developers to help us with the changes needed in the php code to rectify this.

Thanks !

I also agree that the data is not correct, if one use the script available in this threads. I am sure that the api provides the correct data, one must only be able to use it. Was anyone able to use the api correctly? Please support.

from jyotish.

krishnaguragain avatar krishnaguragain commented on May 29, 2024

Yeah, it works.

from jyotish.

purursharma avatar purursharma commented on May 29, 2024

Yeah, it works.

Could u pls help me with that, may be share a piece of correct code. I would be very thankful to you.

from jyotish.

jscuba avatar jscuba commented on May 29, 2024

The Natal/Divisional charts generated using these libraries differ from the one used in other (major) Indian apps/websites like astrosage etc. This is primarily arising owing to difference in degrees and lagna. Could any one please help us rectify the Charts generated ?
Here is one example :

Date of Birth : 26 June 2018 , Time of Birth : 16:48 , Place of birth : Bharatpur India

Natal Chart
Kunjara Kundali : Lagna is Virgo
Most other websites : Langa is Scorpio
The difference exists in all Divisional charts too.
Will request the developer of these libraries and other fellow developers to help us with the changes needed in the php code to rectify this.
Thanks !

I also agree that the data is not correct, if one use the script available in this threads. I am sure that the api provides the correct data, one must only be able to use it. Was anyone able to use the api correctly? Please support.

I think you need to give the library the local date/time for the locality of the chart you're pulling. You can use moment-timezone to adjust for timezone.

from jyotish.

purursharma avatar purursharma commented on May 29, 2024

I am using the local timezone using the script provided in thread. The Script works well, only the output of lagna and dashas is incorrect. Maybe some one who has a correct running script can support.

  • require './vendor/autoload.php';
  • //error_reporting(E_ALL);
  • // ini_set('display_errors', 1);
  • use Jyotish\Base\Data;
  • use Jyotish\Base\Locality;
  • use Jyotish\Base\Analysis;
  • use Jyotish\Ganita\Method\Swetest;
  • use Jyotish\Ganita\Time;
  • use Jyotish\Dasha\Dasha;
  • $Locality = new Locality([
  •         'longitude' => "77.21",
    
  •         'latitude' => "28.67",
    
  •         'altitude' => 0,
    
  •         ]);
    
  • $DateTime = new DateTime();
  • $DateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
  • $DateTime->setDate(1978,10,28);
  • $DateTime->setTime(07,30);
  • $Ganita = new Swetest(["swetest" => "/usr/bin/"]);
  • $data = new Data($DateTime, $Locality, $Ganita);
  • // To Calculate Panchangam
  • $data->calcParams();
  • $data->calcRising();
  • $data->calcPanchanga();
  • // To calculate Upagraha
  • $data->calcUpagraha();
  • $data->calcDasha("vimshottari", null);
  •   // $data->calcYoga(['mahapurusha','Dhana','RAJA']);
    
  •   // $data->calcHora();
    
  • $data->calcExtraLagna();
  • // $data->calcBhavaArudha();
  • $Analysis = new Analysis($data);
  •   $new = [
    
  •   	"data" => $data,
    
  •   	"Analysis" => $Analysis,
    
  •   ];
    
  • $dasha = $data->getData()['dasha']['vimshottari']['periods'];

from jyotish.

Abhirama108 avatar Abhirama108 commented on May 29, 2024

Hi, How to change the Ayanamsa to KP

Thanks, Govind

Change Ayanamsa like that:

$Ganita->setOptionAyanamsha('Raman');

from jyotish.

qwertynik avatar qwertynik commented on May 29, 2024

@Abhirama108
Any ideas if this library support using tropical calculations for signs and sidereal for Nakshatras?

from jyotish.

sushantdanekar avatar sushantdanekar commented on May 29, 2024

THank you

from jyotish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.