diff --git a/cs_util/__init__.py b/cs_util/__init__.py index 47cdfa7..160c110 100644 --- a/cs_util/__init__.py +++ b/cs_util/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """cs_util PACKAGE. Provide a basic description of what your package contains. diff --git a/cs_util/canfar.py b/cs_util/canfar.py new file mode 100644 index 0000000..7ccf1c5 --- /dev/null +++ b/cs_util/canfar.py @@ -0,0 +1,166 @@ +"""CANFAR TOOLS. + +This module defines methods for managing CANFAR specific actions. + +:Author: Samuel Farrens + Martin Kilbinger + +""" + +import os +import sys +from contextlib import redirect_stdout +from io import StringIO + +import vos.commands as vosc + + +class vosError(Exception): + """VOS Error. + + Generic error that is raised by the vosHandler. + + """ + + pass + + +class vosHandler: + """VOS Handler. + + This class manages the use of VOS commands. + + Parameters + ---------- + command : str + VOS command name + + """ + + def __init__(self, command): + + self._avail_commands = tuple(vosc.__all__) + self.command = command + + @property + def command(self): + """Set Command. + + This method sets the VOS command property. + + Raises + ------ + ValueError + if value is not valid vos command + + """ + return self._command + + @command.setter + def command(self, value): + + if value not in self._avail_commands: + raise ValueError( + f'vos command must be one of {self._avail_commands}' + ) + + self._command = getattr(vosc, value) + + def __call__(self, *args, **kwargs): + """Call Method. + + This method allows class instances to be called as functions. + + Raises + ------ + vosError + if error in vos command occurs + + """ + try: + self._command() + + except Exception: + raise vosError( + f'Error in VOs command: {self._command.__name__}' + ) + + +def download(source, target, verbose=False): + """Download. + + Download file from vos. + + Parameters + ---------- + source : str + source path on vos + target : str + target path + verbose : bool, optional, default=False + verbose output if True + + Returns + ------- + status : bool + status, True/False or success/failure + + """ + cmd = 'vcp' + + if not os.path.exists(target): + sys.argv = [cmd, source, target] + if verbose: + print(f'Downloading file {source} to {target}...') + vcp = vosHandler(cmd) + + vcp() + if verbose: + print('Download finished.') + else: + if verbose: + print(f'Target file {target} exists, skipping download.') + + +def dir_list(path, verbose=False): + """Set Directory List. + + List content of path on vos. + + Parameters + ---------- + path : str + path on vos, starts with 'vos:cfis/...' + verbose : bool, optional, default=False + verbose output if True + + Raises + ------ + HTTPError, KeyError + if error occurs during vos command + + Returns + ------- + list + file or directory at path, type is str + + """ + cmd = 'vls' + sys.argv = [cmd, path] + vls = vosHandler(cmd) + + if verbose: + print('Getting vos directory content from vls...') + + f = StringIO() + + try: + with redirect_stdout(f): + vls() + except Exception: + print('Error during vls command') + raise + + vls_out = f.getvalue() + + return vls_out.split('\n') diff --git a/cs_util/cat.py b/cs_util/cat.py index b150fcf..e875732 100644 --- a/cs_util/cat.py +++ b/cs_util/cat.py @@ -4,7 +4,7 @@ :Description: This script contains methods to read and write galaxy catalogues. -:Author: Martin Kilbinger +:Author: Martin Kilbinger """ diff --git a/cs_util/cfis.py b/cs_util/cfis.py new file mode 100644 index 0000000..5544de8 --- /dev/null +++ b/cs_util/cfis.py @@ -0,0 +1,112 @@ +"""CFIS. + +:Name: cfis.py + +:Description: This script contains CFIS-specific methods. + +:Author: Martin Kilbinger + +""" + + +import re +import numpy as np +from astropy import units +from astropy import coordinates as coords + + +class Cfis(object): + """Cfis + + Class for CFIS image properties. + + """ + size = {'tile' : 0.5 * units.deg} + + +def get_tile_number(tile_name): + """Get Tile Number. + + Return tile number of given image tile name. + + Parameters + ---------- + tile_name : str + tile name + + Raises + ------ + ValueError + if tile name does not match expected pipeline numbering scheme + + Returns + ------- + tuple + tile number for x and tile number for y + + """ + m = re.search(r'(\d{3})[\.-](\d{3})', tile_name) + if m is None or len(m.groups()) != 2: + raise ValueError( + f'Image name \'{tile_name}\' does not match tile name syntax' + ) + + nix = m.groups()[0] + niy = m.groups()[1] + + return nix, niy + + +def get_tile_coord_from_nixy(nix, niy): + """Get Tile Coord From Nixy. + + Return coordinates corresponding to tile with number (nix,niy). + + Parameters + ---------- + nix : str or list + tile number(s) for x coordinate(s); + niy : str or list + tile number(s) for y coordinate(s) + + See also + -------- + get_tile_number_from_coord + + Returns + ------- + tuple + right ascension and declination + + """ + number_pattern = re.compile(r'\d{3}') + + # Transform from str to int + if not np.isscalar(nix): + # Check input numbers + if not all( + [bool(number_pattern.fullmatch(number)) for number in nix + niy] + ): + raise ValueError('Input needs to be three-digit numbers') + + # Transform to list + xi = np.array(nix).astype(int) + yi = np.array(niy).astype(int) + else: + if not all( + [bool(number_pattern.fullmatch(number)) for number in [nix, niy]] + ): + raise ValueError('Input needs to be three-digit numbers') + + xi = int(nix) + yi = int(niy) + + # Declination + d = yi / 2 - 90 + dec = coords.Angle(d, unit='deg') + + # Right ascension + r = xi / 2 / np.cos(dec.radian) + ra = coords.Angle(r, unit='deg') + + return ra, dec diff --git a/cs_util/cosmo.py b/cs_util/cosmo.py index 86b3a96..101c5c7 100644 --- a/cs_util/cosmo.py +++ b/cs_util/cosmo.py @@ -1,4 +1,4 @@ -"""COSMO +"""COSMO. :Name: cosmo.py @@ -15,6 +15,7 @@ from astropy import units + def sigma_crit(z_lens, z_source, cosmo, d_lens=None, d_source=None): """Critical surface mass density. @@ -26,16 +27,16 @@ def sigma_crit(z_lens, z_source, cosmo, d_lens=None, d_source=None): source redshift cosmo : pyccl.core.Cosmology cosmological parameters - d_lens : float, optional + d_lens : astropy.units.Quantity, optional precomputed anguar diameter distance to lens, computed from z_lens - if `None` (default) - d_source : float, optional + if ``None`` (default) + d_source : astropy.units.Quantity, optional precomputed anguar diameter distance to sourcce, computed from z_source - if `None` (default) + if ``None`` (default) Returns ------- - Quantity + astropy.units.Quantity critical surface mass density with units of M_sol / pc^2 """ @@ -67,11 +68,11 @@ def sigma_crit(z_lens, z_source, cosmo, d_lens=None, d_source=None): def sigma_crit_eff( z_lens, - z_source, - nz_source, + z_source_arr, + nz_source_arr, cosmo, d_lens=None, - d_source=None + d_source_arr=None, ): """Effective critical surface mass density, which is sigma_crit(z_lens, z_source) weighted by nz_source. @@ -80,33 +81,51 @@ def sigma_crit_eff( ---------- z_lens : float lens redshift - z_source : list + z_source_arr : list source redshifts - nz_source : list + nz_source_arr : list number of galaxies at z_source cosmo : pyccl.core.Cosmology cosmological parameters - d_lens : float, optional - precomputed anguar diameter distance to lens, computed from z_lens - if `None` (default) + d_lens : astropy.units.Quantity, optional + precomputed anguar diameter distance to lens; + computed from z_lens if ``None`` (default) + d_source_arr : list, optional + precompuated angular diameter distances to sources; + computed from z_source_arr if ``None`` (default); + needs to be list of astropy.units.Quantity Raises ------ IndexError - If lists ``z_source`` and ``nz_source`` do not match + If lists ``z_source_arr``, ``nz_source_arr``, and d_source_arr + do not match Returns ------- - Quantity + astropy.units.Quantity effective critical surface mass density with units of M_sol / pc^2 """ - if len(z_source) != len(nz_source): - raise IndexError('Lists for source z an n(z) have different lenghts') + n_source = len(z_source_arr) + + if d_source_arr is None: + d_source_arr = [None] * n_source + + if (len(nz_source_arr) != n_source) or (len(d_source_arr) != n_source): + raise IndexError( + 'Lists for source z, n(z), and/or d_ang have different lenghts' + ) sigma_cr_arr = [] - for z_s, nz_s in zip(z_source, nz_source): - sigma_cr = sigma_crit(z_lens, z_s, cosmo, d_lens=d_lens) + for idx in range(n_source): + sigma_cr = sigma_crit( + z_lens, + z_source_arr[idx], + cosmo, + d_lens=d_lens, + d_source=d_source_arr[idx] + ) # Get unit if len(sigma_cr_arr) == 0: @@ -116,59 +135,75 @@ def sigma_crit_eff( # Mean sigma_cr weighted by source redshifts. # np.average can only deal with unitless quantities. - sigma_cr_eff = np.average(sigma_cr_arr, weights=nz_source) + sigma_cr_eff = np.average(sigma_cr_arr, weights=nz_source_arr) return sigma_cr_eff * unit def sigma_crit_m1_eff( z_lens, - z_source, - nz_source, + z_source_arr, + nz_source_arr, cosmo, d_lens=None, - d_source=None + d_source_arr=None, ): """Effective inverse critical surface mass density, which is sigma_crit^{-1}(z_lens, z_source) weighted by nz_source. + See Eq. (17) in :cite:`2004AJ....127.2544S`. Parameters ---------- z_lens : float lens redshift - z_source : list + z_source_arr : list source redshifts - nz_source : list + nz_source_arr : list number of galaxies at z_source cosmo : pyccl.core.Cosmology cosmological parameters - d_lens : float, optional - precomputed anguar diameter distance to lens, computed from z_lens - if `None` (default) - d_source : float, optional - precomputed anguar diameter distance to sourcce, computed from z_source - if `None` (default) + d_lens : astropy.units.Quantity, optional + precomputed anguar diameter distance to lens; + computed from z_lens if ``None`` (default) + d_source_arr : float, optional + precomputed anguar diameter distance to sources; + computed from z_source_arr if ``None`` (default); + needs to be list of astropy.units.Quantity Raises ------ IndexError - If lists ``z_source`` and ``nz_source`` do not match + If lists ``z_source_arr``, ``nz_source_arr``, and ``d_source_arr`` + do not match Returns ------- - Quantity + astropy.units.Quantity effective inverse critical surface mass density with units of M_sol / pc^2 """ - if len(z_source) != len(nz_source): - raise IndexError('Lists for source z an n(z) have different lenghts') + n_source = len(z_source_arr) + + if d_source_arr is None: + d_source_arr = [None] * n_source + + if (len(nz_source_arr) != n_source) or (len(d_source_arr) != n_source): + raise IndexError( + 'Lists for source z, n(z), and/or d_ang have different lenghts' + ) sigma_cr_m1_arr = [] weights = [] - for z_s, nz_s in zip(z_source, nz_source): - sigma_cr = sigma_crit(z_lens, z_s, cosmo) + for idx in range(n_source): + sigma_cr = sigma_crit( + z_lens, + z_source_arr[idx], + cosmo, + d_lens=d_lens, + d_source=d_source_arr[idx] + ) # Get unit if len(sigma_cr_m1_arr) == 0: @@ -181,7 +216,7 @@ def sigma_crit_m1_eff( sigma_cr_m1 = 1 / sigma_cr sigma_cr_m1_arr.append(sigma_cr_m1.value) - weights.append(nz_s) + weights.append(nz_source_arr[idx]) sigma_cr_m1_eff = np.average(sigma_cr_m1_arr, weights=weights) diff --git a/cs_util/logging.py b/cs_util/logging.py index 61f41e0..99d72c8 100644 --- a/cs_util/logging.py +++ b/cs_util/logging.py @@ -1,6 +1,7 @@ """LOGGING. -:Description: This script contains utility methods for job execution and progress logging. +:Description: This script contains utility methods for job execution and +progress logging. :Author: Martin Kilbinger diff --git a/cs_util/tests/__init__.py b/cs_util/tests/__init__.py index 6c2cb33..9dac06c 100644 --- a/cs_util/tests/__init__.py +++ b/cs_util/tests/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """UNIT TESTS. Unit testing framework for the package. diff --git a/cs_util/tests/test_calc.py b/cs_util/tests/test_calc.py index 33863d9..898d169 100644 --- a/cs_util/tests/test_calc.py +++ b/cs_util/tests/test_calc.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """UNIT TESTS FOR CALC SUBPACKAGE. This module contains unit tests for the calc subpackage. diff --git a/cs_util/tests/test_canfar.py b/cs_util/tests/test_canfar.py new file mode 100644 index 0000000..57d4f24 --- /dev/null +++ b/cs_util/tests/test_canfar.py @@ -0,0 +1,44 @@ +"""UNIT TESTS FOR CANFAR SUBPACKAGE. + +This module contains unit tests for the canfar subpackage. + +""" + +from unittest import TestCase + +from numpy import testing as npt +import os +import sys + +from cs_util import canfar + + +class CanfarTestCase(TestCase): + """Test case for the ``canfar`` module.""" + + def setUp(self): + """Set test parameter values.""" + self._cmd_ok = 'vcp' + self._cmd_nok = 'vxx' + + def tearDown(self): + """Unset test parameter values.""" + self._cmd_ok = None + self._cmd_nok = None + + def test_init_vos(self): + """Test ``cs_util.canfar.vosHandler()`` with + vos command strings. + + """ + # Test whether command is set + vos = canfar.vosHandler(self._cmd_ok) + npt.assert_equal( + vos.command.__name__, + self._cmd_ok, + 'vos command not set', + ) + + # Test error for invalid command + with self.assertRaises(ValueError) as context: + vos = canfar.vosHandler(self._cmd_nok) diff --git a/cs_util/tests/test_cat.py b/cs_util/tests/test_cat.py index f943181..80367a6 100644 --- a/cs_util/tests/test_cat.py +++ b/cs_util/tests/test_cat.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """UNIT TESTS FOR CAT SUBPACKAGE. This module contains unit tests for the cat subpackage. diff --git a/cs_util/tests/test_cfis.py b/cs_util/tests/test_cfis.py new file mode 100644 index 0000000..416ed06 --- /dev/null +++ b/cs_util/tests/test_cfis.py @@ -0,0 +1,132 @@ +"""UNIT TESTS FOR CFIS SUBPACKAGE. + +This module contains unit tests for the cfis subpackage. + +""" + +import os + +import numpy as np +from numpy import testing as npt +from astropy import units + +from unittest import TestCase + +from cs_util import cfis + + +class CfisTestCase(TestCase): + """Test case for the ``cfis`` module.""" + + def setUp(self): + """Set test parameter values.""" + + self._size_tile = 0.5 * units.deg + + self._tile_number_ok = ['270.283', '188-308'] + self._nix = ['270', '188'] + self._niy = ['283', '308'] + self._dec = [51.5, 64] + self._ra = [216.86237, 214.43017] + self._unit = units.deg + + self._nix_nok = ['23x', '1234'] + self._tile_number_nok = '12x.456' + + def tearDown(self): + """Unset test parameter values.""" + self._tile_number_ok = None + self._nix = None + self._niy = None + self._dec = None + self._ra = None + self._unit = None + self._tile_number_nok = None + + def test_Cfis(self): + """Test ``cs_util.Cfis`` class.""" + self.assertTrue(self._size_tile == cfis.Cfis().size['tile']) + + def test_get_tile_number(self): + """Test ``cs_util.get_tile_number`` method.""" + + # Test return values for valid input tile numbers + for idx, tile_number_ok in enumerate(self._tile_number_ok): + nix, niy = cfis.get_tile_number(tile_number_ok) + self.assertTrue( + (nix == self._nix[idx]) and (niy == self._niy[idx]), + msg=f'{nix}!={self._nix[idx]} or {niy}!={self._niy[idx]}', + ) + + self.assertRaises( + ValueError, + cfis.get_tile_number, + self._tile_number_nok + ) + + def test_get_tile_coord_from_nixy(self): + """Test ``cs_util.get_tile_coord_from_nixy`` method.""" + + # Call with scalar arguments + for idx in range(len(self._nix)): + ra, dec = cfis.get_tile_coord_from_nixy( + self._nix[idx], + self._niy[idx], + ) + + # Test values + npt.assert_almost_equal( + ra.value, + self._ra[idx], + err_msg=f'{ra}!={self._ra[idx]}', + decimal=5, + ) + npt.assert_almost_equal( + dec.value, + self._dec[idx], + err_msg=f'{dec}!={self._dec[idx]}', + ) + + # Test units + self.assertTrue(ra.unit == self._unit) + self.assertTrue(dec.unit == self._unit) + + # Call with list arguments + ra, dec = cfis.get_tile_coord_from_nixy(self._nix, self._niy) + for idx in range(len(self._nix)): + + # Test values + npt.assert_almost_equal( + ra[idx].value, + self._ra[idx], + err_msg=f'{ra[idx]}!={self._ra[idx]}', + decimal=5, + ) + npt.assert_almost_equal( + dec[idx].value, + self._dec[idx], + err_msg=f'{dec[idx]}!={self._dec[idx]}', + ) + # Test units + self.assertTrue(ra[idx].unit == self._unit) + self.assertTrue(dec[idx].unit == self._unit) + + # Test exception for invalid input + self.assertRaises( + ValueError, + cfis.get_tile_coord_from_nixy, + self._nix_nok, + self._niy, + ) + self.assertRaises( + ValueError, + cfis.get_tile_coord_from_nixy, + self._niy, + self._nix_nok, + ) + self.assertRaises( + ValueError, + cfis.get_tile_coord_from_nixy, + self._nix_nok[0], + self._niy[0], + ) diff --git a/cs_util/tests/test_cosmo.py b/cs_util/tests/test_cosmo.py index d168d2d..6f0f861 100644 --- a/cs_util/tests/test_cosmo.py +++ b/cs_util/tests/test_cosmo.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """UNIT TESTS FOR COSMO SUBPACKAGE. This module contains unit tests for the cosmo subpackage. @@ -12,7 +10,6 @@ import pyccl as ccl from astropy import units -from astropy.cosmology import FlatLambdaCDM from numpy import testing as npt @@ -41,6 +38,13 @@ def setUp(self): self._d_source = 1617.9195 * units.Mpc self._d_lens = 1315.3937 * units.Mpc + self._d_source_arr = [ + 1157.82363726, + 1440.63922894, + 1617.91952285, + 1678.82870081 + ] * units.Mpc + def tearDown(self): """Unset test parameter values.""" self._z_source = None @@ -78,7 +82,7 @@ def test_sigma_crit(self): ) npt.assert_equal(sigma_crit, 0 * self._sigma_crit_unit) - # Test without default arguments + # Test changing default arguments sigma_crit = cosmo.sigma_crit( self._z_lens, self._z_source, @@ -137,14 +141,54 @@ def test_sigma_crit_eff(self): npt.assert_equal(sigma_crit_eff.unit, self._sigma_crit_unit) # Test exception - self.assertRaises( - IndexError, + self.assertRaises( + IndexError, cosmo.sigma_crit_eff, self._z_lens, - self._z_source_arr[:-1], - self._nz_source_arr, + self._z_source_arr[:-1], + self._nz_source_arr, + self._cosmo, + ) + + # Test changing default arguments + sigma_crit_eff = cosmo.sigma_crit_eff( + self._z_lens, + self._z_source_arr, + self._nz_source_arr, + self._cosmo, + d_source_arr=self._d_source_arr, + ) + npt.assert_almost_equal( + sigma_crit_eff.value, + self._sigma_crit_value_eff, + decimal=3, + ) + sigma_crit_eff = cosmo.sigma_crit_eff( + self._z_lens, + self._z_source_arr, + self._nz_source_arr, + self._cosmo, + d_lens=self._d_lens, + ) + npt.assert_almost_equal( + sigma_crit_eff.value, + self._sigma_crit_value_eff, + decimal=3, + ) + sigma_crit_eff = cosmo.sigma_crit_eff( + self._z_lens, + self._z_source_arr, + self._nz_source_arr, self._cosmo, + d_lens=self._d_lens, + d_source_arr=self._d_source_arr, ) + npt.assert_almost_equal( + sigma_crit_eff.value, + self._sigma_crit_value_eff, + decimal=3, + ) + def test_sigma_crit_m1_eff(self): """Test ``cs_util.cosmo.sigma_crit_m1_eff`` method. @@ -165,14 +209,54 @@ def test_sigma_crit_m1_eff(self): # Test return unit npt.assert_equal( sigma_crit_m1_eff.unit, - (1 / self._sigma_crit_unit).unit) + (1 / self._sigma_crit_unit).unit + ) - # Test exception - self.assertRaises( - IndexError, + # Test exception when redshift array lengths inconsistent + self.assertRaises( + IndexError, cosmo.sigma_crit_m1_eff, self._z_lens, - self._z_source_arr[:-1], - self._nz_source_arr, + self._z_source_arr[:-1], + self._nz_source_arr, + self._cosmo, + ) + + # Test changing default arguments + sigma_crit_m1_eff = cosmo.sigma_crit_m1_eff( + self._z_lens, + self._z_source_arr, + self._nz_source_arr, + self._cosmo, + d_source_arr=self._d_source_arr, + ) + npt.assert_almost_equal( + sigma_crit_m1_eff.value, + self._sigma_crit_value_eff_m1, + decimal=3, + ) + sigma_crit_m1_eff = cosmo.sigma_crit_m1_eff( + self._z_lens, + self._z_source_arr, + self._nz_source_arr, + self._cosmo, + d_lens=self._d_lens, + ) + npt.assert_almost_equal( + sigma_crit_m1_eff.value, + self._sigma_crit_value_eff_m1, + decimal=3, + ) + sigma_crit_m1_eff = cosmo.sigma_crit_m1_eff( + self._z_lens, + self._z_source_arr, + self._nz_source_arr, self._cosmo, + d_lens=self._d_lens, + d_source_arr=self._d_source_arr, + ) + npt.assert_almost_equal( + sigma_crit_m1_eff.value, + self._sigma_crit_value_eff_m1, + decimal=3, ) diff --git a/cs_util/tests/test_logging.py b/cs_util/tests/test_logging.py index 3d897b2..13e7140 100644 --- a/cs_util/tests/test_logging.py +++ b/cs_util/tests/test_logging.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """UNIT TESTS FOR LOGGING SUBPACKAGE. This module contains unit tests for the logging subpackage. diff --git a/cs_util/tests/test_plots.py b/cs_util/tests/test_plots.py index 828f6a7..c2c1c90 100644 --- a/cs_util/tests/test_plots.py +++ b/cs_util/tests/test_plots.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """UNIT TESTS FOR PLOTS SUBPACKAGE. This module contains unit tests for the plots subpackage. diff --git a/docs/source/conf.py b/docs/source/conf.py index af238c2..3c70c66 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,7 +10,6 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../..')) -sys.path.insert(0, os.path.abspath('../../scripts')) # -- General configuration ------------------------------------------------ @@ -214,9 +213,10 @@ def add_notebooks(nb_path='../../notebooks'): # Refer to the package libraries for type definitions intersphinx_mapping = { 'python': ('http://docs.python.org/3', None), + 'astropy': ('http://docs.astropy.org/en/latest/', None), 'numpy': ('https://numpy.org/doc/stable/', None), 'scipy': ('https://docs.scipy.org/doc/scipy/reference', None), - 'matplotlib': ('https://matplotlib.org', None) + 'matplotlib': ('https://matplotlib.org', None), } # -- BibTeX Setting ---------------------------------------------- diff --git a/docs/source/refs.bib b/docs/source/refs.bib index 0557187..51c9108 100644 --- a/docs/source/refs.bib +++ b/docs/source/refs.bib @@ -1,15 +1,3 @@ -@INBOOK{Drake:1965, - author = {{Drake}, Frank D.}, - title = "{The Radio Search for Intelligent Extraterrestrial Life}", - publisher = {Oxford University Press}, - keywords = {DRAKE EQUATION, SETI, EXOBIOLOGY, LIFE ON OTHER PLANETS}, - booktitle = {In Current aspects of exobiology}, - year = 1965, - pages = {323-345}, - adsurl = {https://ui.adsabs.harvard.edu/abs/1965cae..book..323D}, - adsnote = {Provided by the SAO/NASA Astrophysics Data System}, -} - @Article{Hunter:2007, Author = {Hunter, J. D.}, Title = {Matplotlib: A 2D graphics environment}, @@ -41,3 +29,23 @@ @ARTICLE{Harris:2020 adsurl = {https://ui.adsabs.harvard.edu/abs/2020arXiv200610256H}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} } + +@ARTICLE{2004AJ....127.2544S, + author = {{Sheldon}, Erin S. and {Johnston}, David E. and {Frieman}, Joshua A. and {Scranton}, Ryan and {McKay}, Timothy A. and {Connolly}, A.~J. and {Budav{\'a}ri}, Tam{\'a}s and {Zehavi}, Idit and {Bahcall}, Neta A. and {Brinkmann}, J. and {Fukugita}, Masataka}, + title = "{The Galaxy-Mass Correlation Function Measured from Weak Lensing in the Sloan Digital Sky Survey}", + journal = {\aj}, + keywords = {Cosmology: Observations, Cosmology: Dark Matter, Cosmology: Gravitational Lensing, Cosmology: Large-Scale Structure of Universe, Astrophysics}, + year = 2004, + month = may, + volume = {127}, + number = {5}, + pages = {2544-2564}, + doi = {10.1086/383293}, +archivePrefix = {arXiv}, + eprint = {astro-ph/0312036}, + primaryClass = {astro-ph}, + adsurl = {https://ui.adsabs.harvard.edu/abs/2004AJ....127.2544S}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + + diff --git a/requirements.txt b/requirements.txt index f584b39..e02f2e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ astropy datetime -jinja2==3.0 numpy matplotlib +pyccl vos diff --git a/setup.cfg b/setup.cfg index 2c51224..f422030 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ test = pytest [metadata] -description-file = README.md +description_file = README.md [darglint] docstring_style = numpy diff --git a/setup.py b/setup.py index 35aed4e..106c484 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ # Set the package release version major = 0 minor = 0 -patch = 3 +patch = 2 # Set the package details name = 'cs_util'