Skip to content

Commit

Permalink
Merge branch 'master' into doc/gnirsls_tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
KathleenLabrie committed Dec 16, 2024
2 parents 0687fcf + 8a68dd5 commit 4454dad
Show file tree
Hide file tree
Showing 180 changed files with 71,997 additions and 3,510 deletions.
4 changes: 2 additions & 2 deletions .jenkins/scripts/download_and_install_anaconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ conda clean -i -t -y # in case of corrupt package cache from previous run
# These 2 channels need removing if testing old branches has reinstated them:
conda config --remove channels http://ssb.stsci.edu/astroconda || :
conda config --remove channels http://astroconda.gemini.edu/public/noarch || :
conda config --remove channels http://astroconda.gemini.edu/public || :
conda config --remove channels http://jastro.org/astroconda/public || :
conda config --add channels conda-forge
conda config --add channels http://jastro.org/astroconda/public
conda config --add channels http://astroconda.gemini.edu/public
conda config --set channel_priority true
conda config --set restore_free_channel false
conda update --quiet conda
Expand Down
82 changes: 47 additions & 35 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def runtests_gsaoi = 1
def runtests_gnirs = 1
def runtests_wavecal = 1
def runtests_ghost = 1
def runtests_gmos = 1

pipeline {

Expand Down Expand Up @@ -93,6 +94,7 @@ pipeline {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests with Python 3.10"
sh 'tox -e py310-unit -v -r -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/unittests_results.xml ${TOX_ARGS}'
echo "Reportint coverage to CodeCov"
Expand All @@ -118,39 +120,6 @@ pipeline {
}
}

stage('Integration tests') {
agent { label "centos7" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "./integ_tests_outputs/"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/integ/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
echo "${env.PATH}"
sh '.jenkins/scripts/setup_dirs.sh'
echo "Integration tests"
sh 'tox -e py310-integ -v -r -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/integration_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F integration'
} // end steps
post {
always {
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-integ/reports/*_results.xml'
)
echo "Deleting Integration tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
}
} // end post
} // end stage

stage('Regression Tests') {
agent { label "master" }
environment {
Expand All @@ -164,6 +133,7 @@ pipeline {
checkout scm
echo "${env.PATH}"
sh '.jenkins/scripts/setup_dirs.sh'
sh '.jenkins/scripts/setup_dirs.sh'
echo "Regression tests"
sh 'tox -e py310-reg -v -r -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/regression_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
Expand Down Expand Up @@ -336,6 +306,43 @@ pipeline {
} // end always
} // end post
} // end stage
stage('GMOS Tests') {
when {
expression { runtests_gmos == 1 }
}

agent { label "master" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "gmos_tests_outputs"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/gmos/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-gmos -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/gmos_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F gmos'
} // end steps
post {
always {
echo "Running 'archivePlots' from inside GMOS Tests"
archiveArtifacts artifacts: "plots/*", allowEmptyArchive: true
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-gmos/reports/*_results.xml'
)
echo "Deleting GMOS Tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
} // end always
} // end post
} // end stage
} // end parallel
}

Expand Down Expand Up @@ -395,6 +402,7 @@ pipeline {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-gmosls -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/gmosls_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
Expand Down Expand Up @@ -433,6 +441,7 @@ pipeline {
checkout scm
echo "${env.PATH}"
sh '.jenkins/scripts/setup_dirs.sh'
sh '.jenkins/scripts/setup_dirs.sh'
echo "Slow tests"
sh 'tox -e py310-slow -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/slow_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
Expand All @@ -455,7 +464,7 @@ pipeline {

stage('GHOST Tests') {
when {
expression { runtests_gnirs == 1 }
expression { runtests_ghost == 1 }
}

agent { label "master" }
Expand Down Expand Up @@ -497,11 +506,15 @@ pipeline {
success {
echo "Step would notify SUCCESSFUL when dragons_ci is available"
// sendNotifications 'SUCCESSFUL'
echo "Step would notify SUCCESSFUL when dragons_ci is available"
// sendNotifications 'SUCCESSFUL'
// deleteDir() /* clean up our workspace */
}
failure {
echo "Step would notify FAILED when dragons_ci is available"
// sendNotifications 'FAILED'
echo "Step would notify FAILED when dragons_ci is available"
// sendNotifications 'FAILED'
// deleteDir() /* clean up our workspace */
}
always {
Expand All @@ -510,4 +523,3 @@ pipeline {
}
}
}

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</table>

# Current Status
**The stable version is v3.2.0.**
**The stable version is v3.2.2.**


[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10841622.svg)](https://doi.org/10.5281/zenodo.10841622) DRAGONS is distributed as a conda package, *dragons*, and it is
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13821517.svg)](https://doi.org/10.5281/zenodo.13821517) DRAGONS is distributed as a conda package, *dragons*, and it is
included in the conda *gemini* stack.

Version 3.2 is recommend for the reduction of **imaging** data from Gemini's
Expand All @@ -27,7 +27,7 @@ the [Gemini IRAF package](https://www.gemini.edu/observing/phase-iii/reducing-da
To install DRAGONS:

```
$ conda create -n dragons python=3.10 dragons ds9
$ conda create -n dragons python=3.10 dragons ds9 "numpy<2"
```

You might need to add two relevant conda channels if you haven't already:
Expand All @@ -53,7 +53,7 @@ reduction of Gemini data.
# Documentation
Documentation on DRAGONS v3.2 is available on "readthedocs" at:

* https://dragons.readthedocs.io/en/v3.2.0/
* https://dragons.readthedocs.io/en/v3.2.2/

There your will find manuals for Astrodata and the Recipe System, and hands-on
tutorials on reducing Gemini imaging data with DRAGONS.
Expand Down
6 changes: 3 additions & 3 deletions astrodata/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"""

# --- Setup Version Here ---
API = 3
FEATURE = 2
BUG = 1
API = 4
FEATURE = 0
BUG = 0
TAG = 'dev'


Expand Down
6 changes: 3 additions & 3 deletions astrodata/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
# built documents.
#
# The short X.Y version.
version = '3.2'
version = '4.0-dev'
# The full version, including alpha/beta/rc tags.
#release = '3.2.x'
#rtdurl = 'release-'+release
#release = '3.2.0'
#release = '3.2.2'
#rtdurl = 'v'+release
rtdurl = 'latest'

Expand All @@ -76,7 +76,7 @@
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#
today = 'April 2024'
today = 'October 2024'
#
# Else, today_fmt is used as the format for a strftime call.
#
Expand Down
22 changes: 16 additions & 6 deletions astrodata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,23 @@ def from_string(value):
for y in (None if start == '' else int(start)-1,
None if end == '' else int(end))])

def asIRAFsection(self):
def asIRAFsection(self, binning=None):
"""Produce string of style '[x1:x2,y1:y2]' that is 1-indexed
and end-inclusive"""
and end-inclusive
Parameters
----------
binning : iterable
A length-2 iterable of (x_binning, y_binning). Binning is assumed
to be 1 for all axes if not given.
"""
if binning is None:
binning = [1] * len(self._axis_names)
return ("[" +
",".join([":".join([str(self.__dict__[axis]+1),
str(self.__dict__[axis.replace("1", "2")])])
for axis in self._axis_names[::2]]) + "]")
",".join([":".join([str(bin_*self.__dict__[axis]+1),
str(bin_*self.__dict__[axis.replace("1", "2")])])
for axis, bin_ in zip(self._axis_names[::2], binning)])
+ "]")

def asslice(self, add_dims=0):
"""Return the Section object as a slice/list of slices.
Expand Down Expand Up @@ -319,4 +329,4 @@ def shift(self, *shifts):
raise ValueError(f"Number of shifts {len(shifts)} incompatible "
f"with dimensionality {self.ndim}")
return self.__class__(*[x + s for x, s in
zip(self, [ss for s in shifts for ss in [s] * 2])])
zip(self, [ss for s in shifts for ss in [s] * 2])])
11 changes: 9 additions & 2 deletions astrodata/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def fitswcs_to_gwcs(input):
try:
transform = make_fitswcs_transform(input)
except Exception as e:
return None
return
outputs = transform.outputs
try:
wcs_info = read_wcs_from_header(input.meta['header'])
Expand Down Expand Up @@ -469,8 +469,15 @@ def read_wcs_from_header(header):
crpix = []
crval = []
cdelt = []
# Handle more than 1 undefined (i.e., not CTYPEi) axis
untyped_axes = 0
for i in range(1, wcsaxes + 1):
ctype.append(header.get(f'CTYPE{i}', 'LINEAR'))
try:
this_ctype = header[f'CTYPE{i}']
except KeyError:
this_ctype = f"LINEAR{untyped_axes+1 if untyped_axes else ''}"
untyped_axes += 1
ctype.append(this_ctype)
cunit.append(header.get(f'CUNIT{i}', None))
crpix.append(header.get(f'CRPIX{i}', 0.0))
crval.append(header.get(f'CRVAL{i}', 0.0))
Expand Down
58 changes: 55 additions & 3 deletions doc/DRAGONS/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ Interface Modifications
* Rename the "threshold" parameter in ``transferObjectMask``
to "dq_threshold", in line with other primitives.


3.2.2
=====

Bug Fixes
---------
**geminidr.ghost**

* Fix an issue where the GHOST reduction would fail if specific header
values were not in the expected format.

Improvements
------------
* Reduce memory usage in ``flagCosmicRays`` and ``QECorrect`` primitives.

3.2.1
=====

Expand All @@ -41,12 +56,49 @@ Improvements

* Improved speed and success rate of wavelength calibration.

**geminidr.ghost**

* Added ``makeIRAFCompatible`` primitive to write order-combined GHOST
spectra in a non-FITS-standard format that is compatible with IRAF.

Bug fixes
---------
**geminidr.ghost**

* Cause data validation to fail for echellograms without exactly 4 extensions.

* Fixed an occasional issue with bad pixels causing ``traceFibers`` to fail.

**geminidr.interactive**

* Fixed issues where certain values were not initialized correctly.

* Fixed stylesheet issues

New Features
------------

**gemini_instruments.gnirs**

* Preemptively added support for handling GNIRS data produced with the new
detector controller software that will be installed in coming months. An
additional patch release will be issued once the gain, read noise, and other
detector properties are known.

Documentation
-------------
* Several updates to the GHOST tutorials to fix errors and improve clarity.

Interface Modifications
-----------------------
**gemini_instruments.gnirs**

* New prims_motor_steps descriptor to support flat association with HR-IFU
and SciOps prism mechanism reproducibility workarounds adopted in Apr-2024.

**gemini_instruments.ghost**

* Change GHOST fast/low read mode from "fast" to "rapid".

3.2.0
=====
Expand Down Expand Up @@ -549,8 +601,8 @@ Compatibility

**geminidr.core**

* Add compatibility with sigma_clip fro astropy v3.1+
* Add compatibility with sigma_clip fro astropy v3.1+

**geminidr.gmos**

* Add IRAF compatibility recipe.
Expand All @@ -559,4 +611,4 @@ Compatibility
Documentation
-------------

* Various fixes to documentation and instruction manual following feedback from users.
* Various fixes to documentation and instruction manual following feedback from users.
Loading

0 comments on commit 4454dad

Please sign in to comment.