Skip to content

Commit

Permalink
Merge pull request #839 from bhilbert4/update-environments
Browse files Browse the repository at this point in the history
Update environments
  • Loading branch information
bhilbert4 authored Oct 1, 2024
2 parents 7f6b545 + 07a85b6 commit 090c7b4
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: "ubuntu-20.04"
tools:
python: "3.9"
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
36 changes: 36 additions & 0 deletions environment_python_3.11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: mirage-py3.11

channels:
- http://ssb.stsci.edu/astroconda
- conda-forge
- defaults
dependencies:
- pip
- python==3.11.9
- pip:
- asdf==3.4.0
- astropy==6.1.3
- astroquery==0.4.7
- batman-package==2.4.9
- bokeh==3.5.2
- crds==11.18.4
- grismconf==1.50
- h5py==3.11.0
- hotsoss==0.1.10
- ipython==8.27.0
- jupyter==1.1.1
- jwst==1.15.1
- jwst-backgrounds==1.3.0
- jwst_gtvt==1.0.1
- lxml==5.3.0
- matplotlib==3.9.2
- nircam_gsim>=1.71
- numpy<2.0
- photutils==1.13.0
- pysiaf==0.23.3
- pytest==8.3.3
- pyyaml==6.0.2
- scipy==1.14.1
- sphinx==8.0.2
- synphot==1.4.0
- webbpsf==1.4.0
35 changes: 0 additions & 35 deletions environment_python_3.8.yml

This file was deleted.

35 changes: 0 additions & 35 deletions environment_python_3.9.yml

This file was deleted.

4 changes: 2 additions & 2 deletions mirage/dark/dark_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ def reorder_dark(self, dark):
because averaging for non-RAPID readout patterns will destroy the frame
"""
if self.params['Reffiles']['linearized_darkfile']:
datatype = np.float
datatype = np.float32
else:
datatype = np.int32

Expand Down Expand Up @@ -1174,7 +1174,7 @@ def reorder_dark(self, dark):
accumimage = np.zeros_like(outdark[0, 0, :, :], dtype=datatype)

if dark.sbAndRefpix is not None:
zeroaccumimage = np.zeros_like(outdark[0, 0, :, :], dtype=np.float)
zeroaccumimage = np.zeros_like(outdark[0, 0, :, :], dtype=np.float32)

# Loop over integrations
#for integ in range(self.params['Readout']['nint']):
Expand Down
2 changes: 1 addition & 1 deletion mirage/ramp_generator/obs_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,7 @@ def frame_to_ramp(self, data):
if ndim == 3:
data = np.vstack((np.zeros((1, yd, xd)), data))

outramp = np.zeros((self.params['Readout']['ngroup'], yd, xd), dtype=np.float)
outramp = np.zeros((self.params['Readout']['ngroup'], yd, xd), dtype=float)

# Set up functions to apply cosmic rays later
# Need the total number of active pixels in the
Expand Down
2 changes: 1 addition & 1 deletion mirage/seed_image/catalog_seed_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2227,7 +2227,7 @@ def create_sidereal_image(self):
signalimage = np.zeros(self.nominal_dims)
segmentation_map = np.zeros(self.nominal_dims)
else:
signalimage = np.zeros(self.output_dims, dtype=np.float)
signalimage = np.zeros(self.output_dims, dtype=float)
segmentation_map = np.zeros(self.output_dims)


Expand Down
27 changes: 19 additions & 8 deletions mirage/yaml/yaml_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2253,27 +2253,38 @@ def _gtvt_v3pa_on_date(ra, dec, date=None, return_range=False):
pa_v3 : float
V3PA in degrees
"""
import jwst_gtvt.find_tgt_info
from jwst_gtvt.jwst_tvt import Ephemeris

if date is None:
start_date_obj = datetime.date.today()
start_date = start_date_obj.isoformat()
start_date = Time(start_date)
else:
start_date_obj = datetime.datetime.strptime(date, '%Y-%m-%d')
start_date = start_date_obj.isoformat().split('T')[0]
start_date = Time(start_date)

# note, get_table requires distinct start and end dates, different by at least 1 day
# The gtvt seems to return NaN for the first row of the resulting
# dataframe no matter what. So let's move the starting date back
# one day so that we can get good values for the day of interest
start_date = start_date - TimeDelta(1, format='jd')

# jwst_gtvt.get_fixed_target_positions often returns NaN for the first entry in
# the table, so make sure we have an end date that is later than the start date
end_date_obj = start_date_obj + datetime.timedelta(days=1)
end_date = end_date_obj.isoformat().split('T')[0]
end_date = Time(end_date)

ephem = Ephemeris(start_date=start_date, end_date=end_date)
ephem_df = ephem.get_fixed_target_positions(ra, dec)

tbl = jwst_gtvt.find_tgt_info.get_table(ra=ra, dec=dec, instrument='NIRCam',
start_date=start_date, end_date=end_date,
verbose=False)
row = tbl[0]
nominal_pa = ephem.dataframe['V3PA_nominal_angle'].iloc[1]
min_pa = ephem.dataframe['V3PA_min_pa_angle'].iloc[1]
max_pa = ephem.dataframe['V3PA_max_pa_angle'].iloc[1]

if return_range:
return row['V3PA'], row['V3PA min'], row['V3PA max']
return row['V3PA']
return nominal_pa, min_pa, max_pa
return nominal_pa


def default_obs_v3pa_on_date(pointing_filename, obs_num, date=None, verbose=False, pointing_table=None):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pyproject.toml
[build-system]
requires = ["setuptools<=54.2.0",
requires = ["setuptools>=73.0.1",
"wheel",
"setuptools_scm"]
50 changes: 25 additions & 25 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
asdf>=2.13.0
astropy>=5.1.1
astroquery>=0.4.6
bokeh==2.4.3
asdf>=3.4.0
astropy>=6.1.3
astroquery>=0.4.7
bokeh>=3.5.2
batman-package>=2.4.9
crds>=11.16.16
grismconf>=1.32
h5py>=3.7.0
hotsoss>=0.1.7
ipython>=8.6.0
jupyter>=1.0.0
jwst>=1.8.2
jwst-backgrounds>=1.1.2
lxml>=4.9.1
matplotlib>=3.6.2
nircam_gsim>=1.60
numpy>=1.23.4
photutils>=1.5.0
pysiaf==0.19.1
pytest>=7.2.0
scipy>=1.9.3
sphinx>=5.3.0
synphot>=1.1.1
pyyaml>=6.0
webbpsf>=1.1.0

crds>=11.18.4
grismconf>=1.50
h5py>=3.11.0
hotsoss>=0.1.10
ipython>=8.27.0
jupyter>=1.1.1
jwst>=1.15.1
jwst-backgrounds>=1.3.0
jwst_gtvt>=1.0.1
lxml>=5.3.0
matplotlib>=3.9.2
nircam_gsim>=1.71
numpy<2.0
photutils>=1.13.0
pysiaf>=0.23.1
pytest>=8.3.3
scipy>=1.14.1
sphinx>=8.0.2
synphot>=1.4.0
pyyaml>=6.0.2
webbpsf>=1.4.0
39 changes: 20 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,30 +89,31 @@ def run(self):
use_scm_version=True,
setup_requires=['setuptools_scm'],
install_requires=[
'asdf>=2.13.0',
'astropy>=5.1.1',
'astroquery>=0.4.6',
'bokeh==2.4.3',
'asdf>=3.4.0',
'astropy>=6.1.3',
'astroquery>=0.4.7',
'bokeh>=3.5.2',
'batman-package',
'crds>=11.16.16',
'crds>=11.18.4',
'grismconf',
'gwcs>=0.18.1',
'h5py>=3.7.0',
'hotsoss==0.1.7',
'gwcs>=0.21.0',
'h5py>=3.11.0',
'hotsoss>=0.1.10',
'ipython',
'jupyter',
'jwst',
'jwst-backgrounds>=1.1.2',
'lxml>=4.9.1',
'matplotlib>=3.6.2',
'nircam_gsim',
'numpy==1.23.4',
'photutils>=1.5.0',
'pysiaf==0.19.1',
'scipy>=1.9.3',
'synphot>=1.1.1',
'webbpsf>=1.1.0',
'pyyaml>=6.0'
'jwst-backgrounds>=1.3.0',
'jwst_gtvt>=1.0.1',
'lxml>=5.3.0',
'matplotlib>=3.9.2',
'nircam_gsim>=1.71',
'numpy<2.0',
'photutils>=1.13.0',
'pysiaf>=0.23.1',
'scipy>=1.14.1',
'synphot>=1.4.0',
'webbpsf>=1.4.0',
'pyyaml>=6.0.2'
],
include_package_data=True,
extras_require={
Expand Down

0 comments on commit 090c7b4

Please sign in to comment.