diff --git a/CHANGELOG.md b/CHANGELOG.md index d07c664..96b5380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +7/13/18: Fix TreeCorr imports, 1d arrays in FITS writing (#93) 7/11/18: Update code to python3 3/17/16: Update documentation to Sphinx standard and add documentation build files (issue #17) 2/17/16: Changes to correlation function plots & documentation (issue #77) diff --git a/stile/file_io.py b/stile/file_io.py index 178d2cc..6a0d7ac 100644 --- a/stile/file_io.py +++ b/stile/file_io.py @@ -179,6 +179,11 @@ def WriteASCIITable(file_name, data_array, fields=None, print_header=False): def _coerceFitsFormat(fmt): + if fmt.subdtype: + if len(fmt.subdtype[1])>1: + raise RuntimeError("Cannot make a FITS table with a column containing arrays "+ + "of greater than one dimension") + return str(fmt.subdtype[1][0])+_coerceFitsFormat(fmt.subdtype[0]) if 'S' in fmt.str or 'a' in fmt.str or 'U' in fmt.str: return 'A'+fmt.str.split('S')[1] elif fmt.str[1] in _fits_dict: # first character is probably a byte-order flag diff --git a/stile/treecorr_utils.py b/stile/treecorr_utils.py index a1aa9d8..34dba6c 100644 --- a/stile/treecorr_utils.py +++ b/stile/treecorr_utils.py @@ -4,8 +4,11 @@ """ import numpy from . import file_io -import treecorr -from treecorr.corr2 import corr2_valid_params +try: + import treecorr + from treecorr.corr2 import corr2_valid_params +except ImportError: + pass def Parser():