GithubHelp home page GithubHelp logo

c3pp's Introduction

Commander3 postprocessing tool (c3pp)

A python code for processing and plotting commander3 files.

Temperature Polarization
Masterpiece Masterpiece
Thermal dust Synchrotron
Masterpiece Masterpiece
Spinning dust Free-free
Masterpiece Masterpiece

Installation

Install tools by running

pip install git+https://github.com/Cosmoglobe/c3pp.git -U

or

pip install git+https://github.com/Cosmoglobe/c3pp.git --user

and make sure that

PATH=$PATH:~/.local/bin

is in your path.

Usage

The tool uses command line arguments and has many different tools built in (and more coming). In order to get an overview of the available tools and how to access them, simply type

c3pp --help

in your terminal. This will display a list of all available tools. For more information on each specific tool, simply type

c3pp [toolname] --help

and a description will be printed:

[command prompt]$ c3pp
Usage: c3pp [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  alm2fits          Converts c3 alms in .h5 file to fits.
  crosspec          Calculates a powerspectrum from polspice.
  dlbin2dat         Outputs binned powerspectra averaged over a range of output samples.
  fits-mean         Calculates the mean over sample range from fits-files.
  fits-stddev       Calculates the standard deviation over sample range from fits-files.
  generate-sky      Generate sky maps from separate input maps.
  gnomplot          Gnomonic view plotting.
  h52fits           Outputs a .h5 map to fits on the form 000001_cmb_amp_n1024.fits
  make-diff-plots   Produces difference maps between output directories.
  mean              Calculates the mean over sample range from .h5 file.
  output-sky-model  Outputs spectrum plots.
  pixreg2trace      Outputs the values of the pixel regions for each sample to a dat file.
  plot              Plots map from .fits or h5 file.
  plotrelease       Plots all release files.
  printdata         Prints the data of a fits file
  printheader       Prints the header of a fits file.
  qu2ang            Calculates polarization angle map from QU signals.
  release           Creates a release file-set on the BeyondPlanck format.
  rmcolumn          Removes columns in fits file
  sigma-l2fits      Converts c3-h5 dataset to fits for c1 BR and GBR estimator analysis.
  specplot          Plots the file output by the Crosspec function.
  stddev            Calculates the stddev over sample range from .h5 file.
  traceplot         Traceplot of samples from .dat.

Contributing

Pull requests are welcome! For feature requests open an issue.


Funding

This work has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No 776282 (COMPET-4; BeyondPlanck), 772253 (ERC; bits2cosmology) and 819478 (ERC; Cosmoglobe).


License

MIT

c3pp's People

Contributors

dncnwtts avatar eirikgje avatar maksymbrl avatar trygvels avatar unfunfunt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

c3pp's Issues

Colorbar labels

The support for specifying which values the labels on the color bar takes have been removed. This leads to none or badly places labels on color bar.

Suggestion: Add the feature back to the code if possible.

Polarization plots

First, can we make a plot of Q and U as an option? A la this:

Image Pasted at 2021-2-3 21-55

Second, would it be possible to plot headless vectors as an option?

image

Userdefined color bar units

Would be nice if there was a possibility to use a user defined label for the units of a color bar in a plot. E.g. when plotting the synchrotron amplitude at reference frequency 408 MHz, the intuitive unit would be K_RJ (not uK) as the values typically range between 10 and 300 K_RJ.

Remake colorbar labels if using logscale

If using log-scale on user defined limits (e.g. "-min 1 -max 4") the color bar returns the log-limits and not 10 to the power of the limits in the labels of the color bar. It would be nice if the labels of the limits looks like 10^1 and 10^4 (not just 1 and 4), especially when the units of the color bar is not the logarithm.

Add possibility to make GIFs

Some kind of functionality where you could give a deterministic filename-scheme and make GIFs out of them would be cool!

"plot" not working properly

Running c3pp plot while specifying -min and/or -max gives an error message:

File "/mn/stornext/u3/krisjand/.local/lib/python3.6/site-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/mn/stornext/u3/krisjand/.local/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/mn/stornext/u3/krisjand/.local/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/mn/stornext/u3/krisjand/.local/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/mn/stornext/u3/krisjand/.local/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/mn/stornext/u3/krisjand/.local/lib/python3.6/site-packages/c3postproc/commands.py", line 214, in plot
Plotter(input, dataset, nside, auto, min, max, minmax, range, colorbar, lmax, fwhm, mask, mfill, sig, remove_dipole, logscale, size, white_background, darkmode, pdf, cmap, title, ltitle, unit, scale, verbose,)
File "/mn/stornext/u3/krisjand/.local/lib/python3.6/site-packages/c3postproc/plotter.py", line 371, in Plotter
ticklabels = [fmt(i, 1) for i in ticklabels]
File "/mn/stornext/u3/krisjand/.local/lib/python3.6/site-packages/c3postproc/plotter.py", line 371, in
ticklabels = [fmt(i, 1) for i in ticklabels]
File "/mn/stornext/u3/krisjand/.local/lib/python3.6/site-packages/c3postproc/plotter.py", line 786, in fmt
TypeError: bad operand type for abs(): 'str'

Apparently, the min/max values are stored as string (or something).

Furthermore, running "plot" with the -range option does nothing (the range is not applied).

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.