Giter VIP home page Giter VIP logo

qubic's People

Contributors

cscoccola avatar fincardona avatar henrotversille avatar jchamilton avatar jchamilton75 avatar kaplan-j avatar mathias77515 avatar mmgamboa avatar mousset avatar mstolpovskiy avatar mtristram avatar mwrightqub avatar nahuelmg avatar pchanial avatar planck2007 avatar satorchi avatar seamusomurchu avatar sofiaferazzoli avatar ziotom78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qubic's Issues

Add correct Q and U intensity in point sources

The module insert_point_sources_in_sky.py currently splits evenly the polarized flux between Q and U. Actually one can use the polarization angle information available in the catalog to calculate the Q and U intensities

Remove NaMaster from the dependency list

The NaMaster package can not be installed automatically, its dependencies (such as numpy or required binary libraries) need to be installed beforehand. This package needs to be installed independently from qubic.

python version for installation

By default, the conda create in the README file should have the python version needed:
conda create --yes --name venv-qubic python==3.xx

Convert and fix all tests

Nosetests being discontinued, the tests need to be converted to pytests. They also need to be updated, since the change involving using dictionary as an argument to QubicInstrument, QubicAcquisition etc. broke them.

Default behaviour for `write_map` is to use lossy compression with floating-point numbers

The default value for the compress parameter to write_map is True, meaning that the code will use one of the compression algorithms specified by the FITS standard. Since these algorithms are lossy when applied to maps containing floating-point values, the code will silently introduce an error in the data written to disk, as the following example shows:

import numpy
import qubic.io

FILE_NAME = '/tmp/compressed_map.fits'

INPUT_PIXELS = numpy.random.normal(size=12 * 64 * 64)
qubic.io.write_map(FILE_NAME, INPUT_PIXELS, dtype=numpy.float64)
OUTPUT_PIXELS = qubic.io.read_map(FILE_NAME)

DIFF = OUTPUT_PIXELS - INPUT_PIXELS
print('Stddev of the difference: {0:.3f}'
      .format(numpy.std(DIFF)))

# Result:
# Stddev of the difference: 0.018

(Note that the code uses float64 instead of the default float32 type when calling write_map.) Setting compress=False in the above call to qubic.io.write_map makes the difference between INPUT_PIXELS and OUTPUT_PIXELS to vanish.

Since this behaviour might be surprising for people not versed with the FITS standard, I am suggesting a couple of workarounds:

  1. Make compress default to False, and specify in the docstring for write_map that using True with floating-point maps will introduce an error in the pixel values (currently, the docstring does not mention the compress parameter anywhere but in the declaration);
  2. Make the code emit a warning when compress is True and the datatype of the parameter map is a floating-point value.

Maps read using Healpy cannot be written back

The following code makes write_map crash:

import numpy
import healpy
import qubic.io

INPUT_FILENAME = '/tmp/input.fits'
OUTPUT_FILENAME = '/tmp/output.fits'

healpy.write_map(INPUT_FILENAME, numpy.arange(12))
pixels = qubic.io.read_map(INPUT_FILENAME)
qubic.io.write_map(OUTPUT_FILENAME, pixels) # bang

The error is the following:

Traceback (most recent call last):
  File "error.py", line 10, in <module>
    qubic.io.write_map(OUTPUT_FILENAME, pixels) # bang
  File "/home/tomasi/work/qubic/qubic/qubic/io/_io.py", line 177, in write_map
    coord = map.header['coordsys'].upper()
TypeError: list indices must be integers, not str

The problem lies in the fact that when qubic.io.read_map uses Healpy to read a map, it stores the header (in pixels.header) as a list instead of a astropy.io.header.Header object. I'll shortly submit a PR to fix this small issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.