Skip to content

Commit

Permalink
relax sympy requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
landmanbester committed Dec 10, 2024
1 parent be12d8a commit c86d361
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pfb/utils/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def synthesize_uvw(station_ECEF, time, a1, a2,

# Pirated from
# https://github.com/ratt-ru/solarkat/blob/main/solarkat-pipeline/find_sun_stimela.py
# obs_lat and obs_lon hardcoded for MeerKAT
def get_coordinates(obs_time,
obs_lat=-30.71323598930457,
obs_lon=21.443001467965008,
Expand All @@ -124,7 +125,7 @@ def format_coords(ra0,dec0):


loc = EarthLocation.from_geodetic(obs_lat,obs_lon) #,obs_height,ellipsoid)
t = Time(obs_time/86400.0,format='mjd') # where is this factor from?
t = Time(obs_time/86400.0,format='mjd') # factor converts Jsecs to Jdays 24 * 60**2
with solar_system_ephemeris.set('builtin'):
sun = get_body(target, t, loc)
sun_ra = sun.ra.value
Expand Down
16 changes: 16 additions & 0 deletions pfb/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,22 @@ def eval_coeffs_to_slice(time, freq, coeffs, Ix, Iy,
return image_in


def model_from_mds(mds_name):
'''
Evaluate component model at the original resolution
'''
mds = xr.open_zarr(mds_name, chunks=None)
return eval_coeffs_to_cube(mds.times.values,
mds.freqs.values,
mds.npix_x, mds.npix_y,
mds.coefficients.values,
mds.location_x.values, mds.location_y.values,
mds.parametrisation,
mds.params.values,
mds.texpr, mds.fexpr)



@njit(nogil=True, cache=True)
def norm_diff(x, xp):
return norm_diff_impl(x, xp)
Expand Down
1 change: 1 addition & 0 deletions pfb/utils/stokes2im.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from ducc0.fft import c2r, r2c, good_size
from ducc0.misc import resize_thread_pool
from africanus.constants import c as lightspeed
from pfb.utils.astrometry import get_coordinates
import gc
iFs = np.fft.ifftshift
Fs = np.fft.fftshift
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ numexpr = ">=2.10.1"
pyscilog = ">=0.1.2"
Click = ">=8.1"
ducc0 = ">=0.35.0"
sympy = ">=1.13"
sympy = ">=1.9"
stimela = ">=2.0.1.1"
streamjoy = ">=0.0.8"
dask = ">=2023.1.1, <2024.11.0"
Expand Down

0 comments on commit c86d361

Please sign in to comment.