Coder Social home page Coder Social logo

fp_tools's Introduction

Here are some tools that astronomers can use to deal with Fabry-Perot data. This is not yet a first version and new features will be added.

Requirements

This package uses Python 2.7 and the astroconda environment. If you do not have Anaconda installed in your computer yet, please, check the Official Anaconda Webpage with its documentation.

The astroconda documentation is also online and can be found in the Astroconda WebPage.

Get the source code

You can download fp_tools using the link at the top of this page or clone it. The current release version is v0.2.4 and can be downloaded in the link below.

Remove old versions

I had bad experiences upgrading the package so, if you have installed fp_tools in your machine before, I strongly recommend you to uninstall it to avoid cross reference between the packages and scripts.

$ pip uninstall fp_tools

Install

Install the package using pip inside the astroconda VirtualEnv. To do so, open a terminal and do the following:

$ cd /path/to/fp_tools  
$ source activate astroconda  # activate the VirtualEnv
$ pip install . --force-reinstall -I

The --force-reinstall and the -I flags are needed only if you are updating the code. If not, you can ommit them.

Run

After installing the fp_repeat and the fp_cut will be available anywhere in your system, as long as you have the astroconda VirtualEnv activated. To check how to use them, simply use the conventional help:

$ fp_repeat --help

or

$ fp_repeat -h

For example, give the user the following output:

Repeats a data-cube [N] times.

positional arguments:
  input_cube           Input cube.
  output_cube          Output cube.

optional arguments:
  -h, --help           show this help message and exit
  --n_before N_BEFORE  Add 'n' copies of the cube in its beginning (affects
                   header).
  --n_after N_AFTER    Add 'n' copies of the cube in its end (affects header).

Any problem?

If you have any problem downloading/installing fp_tools you can either contact me (bquint at ctio dot noao dot edu) or create an Issue. The second way is prefered so I can have a track of all the problems (and so other users).

To create an issue, simply click here.

fp_tools's People

Contributors

b1quint avatar

Stargazers

 avatar

Watchers

 avatar  avatar

fp_tools's Issues

oversampling not being done properly

Philippe created a dummy cube with 36 channels with 100 everywhere in channel 1 and 0 in the 35 others channels.

Within 2 pixels, this gives:

1 200.000000
2 0.000000
3 0.000000
4 0.000000
5 0.000000
105 0.000000
106 0.000000
107 0.000000
108 0.000000

Thus I repeat 3 times the cubes, this gives:

1 200.000000
2 0.000000
35 0.000000
36 0.000000
37 200.000000
38 0.000000
71 0.000000
72 0.000000
73 200.000000
74 0.000000
107 0.000000
108 0.000000

Which is absolutely normal

Thus I oversample 3 times to get a 324 channel-cube, thus I cut it to 108 and I get:

1 177.708984
2 110.835915
3 43.962849
4 0.000000
5 0.000000
6 0.000000
7 0.000000
101 0.000000
102 0.000000
103 0.000000
104 0.000000
105 0.000000
106 43.962849
107 110.835915
108 177.708984

Which is a little bit strange, I should expect something like

1 177.708984
2 110.835915
3 43.962849
4 0.000000
5 0.000000
6 0.000000
7 0.000000
101 0.000000
102 0.000000
103 0.000000
104 0.000000
105 0.000000
106 0
107 43.962849
108 110.835915

From my point of view there is a shift of one channel somewhere…

Another strange thing is that the sum does not give 600 (if you normalize to keep the flux conserved it should give 200)

In [2]: (177.708984 + 110.835915 + 43.962849)*2
Out[2]: 665.015496

Here are the commands I used:

fp_repeat -b 1 -e 1 dummy.fits dummy_108_repeat.fits
fp_oversample dummy_108_repeat.fits dummy_324_oversample.fits 3
fp_cut --n_begin 108 --n_end -108 dummy_324_oversample.fits dummy_108_cut.fits

Could you check please ?

I put attached the dummy.fits cube I used, the 3 files containing the profiles and the zone of 2 pixels I used but it does not matter which zone has been selected.

Cheers

Uniform flags for different scripts

P.A. asked me to make the arguments passed to the scripts within this repository uniform. For example: fp_repeat can receive --n_begin or -b for number of repeated cubes at the beginning while fp_cut can receive --begin or -b for the channel at the beginning where the cube will be cut.

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.