Open irfanimaduddin opened 4 years ago
It's impossible to debug without the exact code. Please provide the code with some explanation what are you trying to do.
Sorry, lupa. Saya berusaha untuk memvisualisasikan kontak 1 dan 4 dari referensi yang sudah ada. Tetapi ternyata ilustrasi dan waktu tidak sesuai. Berikut kodenya.
siak = EarthLocation(lat=0.9277778*u.deg, lon=104.4175*u.deg, height=1*u.m) #Pulau Penyengat
tz = pytz.timezone('Asia/Jakarta')
waktu_tebakan = Time(tz.localize(datetime.datetime(2019,12, 26, 13, 53, 0)))
altAzframe = AltAz(obstime=waktu_tebakan, location=siak)
matahariAltAz = get_sun(waktu_tebakan).transform_to(altAzframe)
bulanAltAz = get_moon(waktu_tebakan).transform_to(altAzframe)
separasi = matahariAltAz.separation(bulanAltAz).to(u.arcmin)
separasi
from astropy import constants
R_matahari = constants.R_sun
R_bulan = 1737.1 * u.km
def ukuran_tampak(R, jarak):
return (R/jarak).to(u.arcmin, u.dimensionless_angles())
ukuranMatahari = ukuran_tampak(R_matahari, matahariAltAz.distance)
ukuranMatahari
ukuranBulan = ukuran_tampak(R_bulan, bulanAltAz.distance)
ukuranBulan
lingkaranMatahari = plt.Circle((matahariAltAz.az.deg, matahariAltAz.alt.deg),
ukuranMatahari.to(u.deg).value,
fc='yellow')
lingkaranBulan = plt.Circle((bulanAltAz.az.deg, bulanAltAz.alt.deg),
ukuranBulan.to(u.deg).value,
fc='black', alpha=.5)
ax = plt.subplot(aspect=1)
ax.add_patch(lingkaranMatahari)
ax.add_patch(lingkaranBulan)
jarakTerbesar = max(separasi.deg, ukuranMatahari.to(u.deg).value, ukuranBulan.to(u.deg).value)
plt.xlim(matahariAltAz.az.deg-.9, matahariAltAz.az.deg+.5)
plt.ylim(matahariAltAz.alt.deg-.65, matahariAltAz.alt.deg+.625)
plt.text(matahariAltAz.az.deg-.75, matahariAltAz.alt.deg-.35, 'r_matahari = %s arcmin' %(ukuranMatahari.value),
color='black', verticalalignment='center', horizontalalignment='left')
plt.text(matahariAltAz.az.deg-.75, matahariAltAz.alt.deg-.425, 'r_bulan = %s arcmin' %(ukuranBulan.value),
color='black', verticalalignment='center', horizontalalignment='left')
plt.text(matahariAltAz.az.deg-.75, matahariAltAz.alt.deg-.5, 'separasi = %s arcmin' %(separasi.value),
color='black', verticalalignment='center', horizontalalignment='left')
plt.text(matahariAltAz.az.deg-.75, matahariAltAz.alt.deg-.575, 'waktu = '+waktu_tebakan.value.strftime('%H:%M:%S UTC'),
color='black', verticalalignment='center', horizontalalignment='left')
#plt.title('D_matahari = %s; D_bulan = %s; sep = %s' %(ukuranMatahari.value, ukuranBulan.value, separasi.value))
plt.xlabel('Azimut (derajat)')
plt.ylabel('Altitud (derajat)')
plt.savefig('Pulau Penyengat (kontak_4 gambar).png')
if you just want to calculate the first and the fourth contact, please see the updated notebook https://github.com/ubutnux/gmc2019/commit/a004fce56cbe85436a46dc846175983775a7af28.
You have to be very careful with that big plot. When you are dealing with a big field of view you have to project 3 dimensional spaces into 2 dimensional spaces. I just don't have time right now to deal with the coordinate transformation. You can read the detail information on astropy WCS module.
I see. Thanks a lot!
Irfan Imaduddin Bosscha Observatory Institut Teknologi Bandung Lembang, Indonesia 40391
Pada tanggal Rab, 28 Agu 2019 pukul 00.34 ubutnux notifications@github.com menulis:
if you just want to calculate the first and the fourth contact, please see the updated notebook a004fce https://github.com/ubutnux/gmc2019/commit/a004fce56cbe85436a46dc846175983775a7af28 .
You have to be very careful with that big plot. When you are dealing with a big field of view you have to project 3 dimensional spaces into 2 dimensional spaces. I just don't have time right now to deal with the coordinate transformation. You can read the detail information on astropy WCS module.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ubutnux/gmc2019/issues/1?email_source=notifications&email_token=AGXMY2AVUG3RMWX6PPKM6ODQGVQUBA5CNFSM4IP3ACE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5IQ23I#issuecomment-525405549, or mute the thread https://github.com/notifications/unsubscribe-auth/AGXMY2E3LGZM5FKRXKC4WVLQGVQUBANCNFSM4IP3ACEQ .
Mas, gambar ilustrasi dengan nilai separasi yang didapat tidak cocok (terutama kontak 1 dan 4). Begitu pula dengan waktu kontaknya.
Kontak 1 (Gambar)
Kontak 1 (Asli)
![Pulau Penyengat (kontak_1 asli)](https://user-images.githubusercontent.com/28232808/63737197-d29f5480-c8af-11e9-9310-1e1ab8454555.png)
Kontak 4 (Gambar)
Kontak 4 (Asli)
![Pulau Penyengat (kontak_4 asli)](https://user-images.githubusercontent.com/28232808/63737200-d29f5480-c8af-11e9-93af-6bc40bf5a858.png)