Giter VIP home page Giter VIP logo

ccoifits's Introduction

ccoifits

C++ bindings for reading/writing/manipulating OIFITS files.

ccoifits's People

Contributors

bkloppenborg avatar

Watchers

 avatar  avatar

ccoifits's Issues

Data export method

Data in OIDataList format should be exportable to OIFITS files and (possibly) text files.

The text output is most likely to be used for plotting in external programs, like gnuplot so high precision isn't required. I propose the user be prompted for a base filename to which a _vis.txt, _v2.txt and _t3.txt extension is added. The formats would be as follows:

filename_vis.txt

# Header describing data
u v vis vis_err
...

filename_v2.txt

# Header describing data
u v v2 v2_err
...

filename_t3.txt

# Header describing data
u1 v1 u2 v2 u3 v3 t3_amp t3_amp_err t3_phi t3_phi_err
...

UV coordinates for (u3,v3) in bispectra disagree with the OIFITS format specification.

The OIFITS specification defines the closure of three telescopes a,b, and c as the product of the complex visibilities around a closed triangle. If the three baselines a-b, b-c, and c-a can be represented as (u1, v1), (u2, v2), and (u3, v3) respectively, then the bispectra is formed via:

B(1,2,3) = V(u1,v1) V(u2,v2) V*(u3, v3).

with (u1,v1), (u2,v2), (u3, v3) = (u1 + u2, v1 + v2) per the OIFITS specification. LIBOI, however, reverses the third UV coordinate to form the closed triangle immediately. This is undesired behavior and should be removed. Changes will need to be propagated to other inheriting code.

Will not read files with multiple tables with the same EXTVER

Although it is against the FITS format specification, AMBER data tables with the same name all have EXTVER = 1. This makes the reading functions in COIFile::read() fail because the table EXTVER is never incremented:

table = &mOIFITS->extension("OI_ARRAY", i+1);

If we change the reading routines to simply iterate over HDUs and process those with the correct name, instead of selecting the name and iterating over EXTVER this could be avoided.

SEGFAULT when opening file with no data

ccoifits will segfault when opening a file with no data:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd78ff700 (LWP 15097)]
0x00000000005778ac in ccoifits::UVKDTree::uv_sort_u (a=..., b=...)
    at /home/bkloppenborg/workspace/simtoi/lib/ccoifits/src/UVKDTree.cpp:217
217     return a.first < b.first;

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.