hebcal / hebcal-es6

perpetual Jewish Calendar with holidays, Shabbat and holiday candle lighting and havdalah times, Torah readings, and more
https://hebcal.github.io/api/core/
GNU General Public License v2.0
98 stars 14 forks source link

Netz HaNireh #420

Open YizYah opened 5 months ago

YizYah commented 5 months ago

Is there any way to calculate the time for Netz HaNireh? The time when the sun is actually first seen.

mjradwin commented 5 months ago

Hebcal's zmanim calculations are a port from the excellent implementation by @KosherJava. The topic of הנץ הנראה is discussed in a Q&A forum

https://kosherjava.com/zmanim-project/zmanim-q-a-forum/#comment-209547

Hanetz Hanireh is something not yet supported by the API. Calculations for it are complex and require detailed digital elevation model to compute. I look forward to anyone contributing support for this to my open source zmanim code.

If you are able to develop an accurate calculation, we will be happy to include it (and I suspect the KosherJava folks will also be happy to have it too)!

aepshtin commented 3 months ago

Sorry for my English...

Hanetz Hanire depends on the observer's elevation. The higher the elevation, the earlier the sun will be visible.

However, there are certain cities in Israel where mountains in front of the observer are taken into account, causing the Sun to be seen later.

The same is exactly true for sunset. The higher the observer's elevation, the later the sunset will be. Mountains in front of the observer will cause the sunset to be earlier.

Regarding midday, the observer's elevation, has no significance.

In fact, the library already supports the calculation of the observer's elevation. Like this:

new Zmanim (gloc: GeoLocation, date: Date | HDate, useElevation?: boolean);

However, I would suggest instead, to add another time: the regular Neith time and the Neitz Hanire time, without changing the time of the regular Neitz.

In most of the calanders, they write the two Neitzs. the reguler and the Nirhe.

In fact, it should be remembered that all of this depends on customs and traditions. In the end, the simple user will want the library to display like the calendar hanging in his synagogue...

I write the same text in hebrew too: נץ הנראה תלוי בגובה של הצופה. ככל שהגובה שלו גבוה יותר, הנץ יהיה מוקדם יותר.

אמנם יש ערים מסוימות בישראל שבהם מתחשבים בהרים שנמצאים מול הצופה, וגורמים לנץ להיראות מאוחר יותר.

אותו דבר בדיוק לגבי השקיעה. ככל והגובה של הצופה גבוה יותר, השקיעה תהיה מאוחרת יותר. והרים ממול הצופה, יגרמו לשקיעה להיות מוקדם יותר.

לגבי חצות היום, אין כלל משמעות לגובה הצופה.

למעשה, הספריה כבר תומכת כעת בחישוב של גובה הצופה. ככה:

constructor(gloc: GeoLocation, date: Date | HDate, useElevation?: boolean);

אבל הייתי מציע במקום זה להוסיף עוד זמן. הנץ רגיל, והנץ הנראה. ולא לשנות את הזמן של הנץ עצמו.

למעשה צריך לזכור שכל זה תלוי במנהגים ומסורות. בסופו של דבר, המשתמש הפשוט, ירצה שהספרייה תציג כמו הלוח שנה שתלוי בבית הכנסת שלו...