Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def neocp_confirmation(payload):
- r=requests.get('https://www.minorplanetcenter.net/Extended_Files/neocp.json')
- data=r.json()
- lat = payload.latitude
- long = payload.longitude
- location = EarthLocation.from_geodetic(lon=float(long), lat=float(lat))
- observing_date = Time(datetime.datetime.utcnow())
- altaz = AltAz(location=location, obstime=observing_date)
- result = []
- for item in data:
- coord = SkyCoord(float(item["R.A."]) * u.deg, float(item["Decl."]) * u.deg)
- coord_altaz = coord.transform_to(altaz)
- print(item)
- # if int(
- # item["Score"] > payload.min_score
- # and is_visible(payload, coord, observing_date)
- # and float(item["V"] < payload.max_magnitude)
- # ):
- asteroid = {
- "Temp_Desig": item["Temp_Desig"],
- "Score": int(item["Score"]),
- "R.A.": coord.ra.to_string(u.hour),
- "Dec.": coord.dec.to_string(u.degree, alwayssign=True),
- "Alt.": coord_altaz.alt, # this makes RecursionError
- "V": float(item["V"]),
- "N.Obs": int(item["NObs"]),
- "Arc": float(item["Arc"]),
- "Not_Seen_days": float(item["Not_Seen_dys"]),
- }
- # print(asteroid)
- result.append(asteroid)
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement