Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump astropy from 4.2.1 to 5.3.3 in /neoexchange #638

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Portal for scheduling observations of NEOs (and other Solar System objects) usin

## History

### 3.16.0
* Upgrade Astropy to 5.3.4 and pyslalib to 1.0.9 for newer build support.

### 3.15.2
* Add suport for disabling SSL verification in data pulls for emergency use e.g. for the recent MPC website issues. (Issue #646)

Expand Down
16 changes: 12 additions & 4 deletions neoexchange/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3137,9 +3137,12 @@ def ingest_new_object(orbit_file, obs_file=None, dbg=False):
if obs_file is None:
obs_file = orbit_file.replace('neocp', 'dat')

# If not found, try new-style obs file name
# If not found, try new-style obs file names
if os.path.exists(obs_file) is False:
obs_file = orbit_file.replace('.neocp', '_mpc.dat')
# If still not found, try another new-style obs file name
if os.path.exists(obs_file) is False:
obs_file = orbit_file.replace('.neocp', '_mpc.txt')

local_discovery = False
try:
Expand Down Expand Up @@ -4655,14 +4658,16 @@ def compare_NEOx_horizons_ephems(body, d, sitecode='500', debug=True):
if type(body) != Body:
body = Body.objects.get(name=body)

neox_emp = compute_ephem(d, model_to_dict(body), sitecode, perturb=True, display=debug)
neox_emp = compute_ephem(d, model_to_dict(body), sitecode, perturb=False, display=debug)
neox_perturb_emp = compute_ephem(d, model_to_dict(body), sitecode, perturb=True, display=debug)
horizons_emp = horizons_ephem(body.current_name(), d, d+timedelta(minutes=1), sitecode, '1m')

sep_r = None
sep_ra = None
sep_dec = None
if len(neox_emp) > 0 and horizons_emp is not None and len(horizons_emp) > 0:
if len(neox_emp) > 0 and len(neox_perturb_emp) > 0 and horizons_emp is not None and len(horizons_emp) > 0:
neox_pos = SkyCoord(neox_emp['ra'], neox_emp['dec'], unit=u.rad)
neox_perturb_pos = SkyCoord(neox_perturb_emp['ra'], neox_perturb_emp['dec'], unit=u.rad)
# Find index of nearest in time ephememeris line
horizons_index = np.abs(d-horizons_emp['datetime'].datetime).argmin()
horizons_pos = SkyCoord(horizons_emp['RA'][horizons_index], horizons_emp['DEC'][horizons_index], unit=u.deg)
Expand All @@ -4673,7 +4678,10 @@ def compare_NEOx_horizons_ephems(body, d, sitecode='500', debug=True):
sep_ra, sep_dec = horizons_pos.spherical_offsets_to(neox_pos)
sep_ra = -sep_ra.to(u.arcsec) / cos(horizons_pos.dec.rad)
sep_dec = -sep_dec.to(u.arcsec)
print(f"At {d:} (HORIZONS@{horizons_emp['datetime'][horizons_index]} , sep= {sep_r:.1f} (RA={sep_ra:.1f}, Dec={sep_dec:.1f})\nNEOX: {neox_pos.to_string('hmsdms', sep=' ', precision=4):} V={neox_emp['mag']:.1f}\n JPL: {horizons_pos.to_string('hmsdms', sep=' ', precision=4):} V={horizons_emp[mag_column][horizons_index]:.1f}")
sep_perturb_ra, sep_perturb_dec = horizons_pos.spherical_offsets_to(neox_perturb_pos)
sep_perturb_ra = -sep_perturb_ra.to(u.arcsec) / cos(horizons_pos.dec.rad)
sep_perturb_dec = -sep_perturb_dec.to(u.arcsec)
print(f"At {d:} (HORIZONS@{horizons_emp['datetime'][horizons_index]} , sep= {sep_r:.1f} (RA={sep_ra:.1f}, Dec={sep_dec:.1f})\nNEOX(P): {neox_perturb_pos.to_string('hmsdms', sep=' ', precision=4):} V={neox_perturb_emp['mag']:.1f}\nNEOX(U): {neox_pos.to_string('hmsdms', sep=' ', precision=4):} V={neox_emp['mag']:.1f}\n JPL: {horizons_pos.to_string('hmsdms', sep=' ', precision=4):} V={horizons_emp[mag_column][horizons_index]:.1f}")

return neox_emp, horizons_emp, sep_r, sep_ra, sep_dec

Expand Down
2 changes: 1 addition & 1 deletion neoexchange/neox/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import rollbar


VERSION = '3.15.2'
VERSION = '3.16.0a'

CURRENT_PATH = os.path.dirname(os.path.realpath(__file__))
PRODUCTION = True if CURRENT_PATH.startswith('/var/www') else False
Expand Down
10 changes: 5 additions & 5 deletions neoexchange/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
numpy==1.22.4; sys_platform != 'win32'
numpy==1.22.4+mkl; sys_platform == 'win32'
numpy==1.23.5; sys_platform != 'win32'
numpy==1.23.5+mkl; sys_platform == 'win32'
Django>=4.2.10,<5.0
#mysqlclient~=1.4.3
psycopg2-binary
astropy==4.2.1
astropy<6.0
astroquery>=0.4.4.dev7007
photutils==1.3.0 # Higher versions need astropy>=5.0
pySLALIB
photutils==1.11.0 # Higher versions need python>=3.10
pyslalib>=1.0.9
beautifulsoup4
django-reversion
html5lib
Expand Down