Coder Social home page Coder Social logo

cfitsio.jl's People

Contributors

abhro avatar emmt avatar giordano avatar heptazhou avatar jishnub avatar mileslucas avatar sefffal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cfitsio.jl's Issues

Can we access variables defined in header files here?

The docs of fits_insert_img states

One can force a new primary array to be inserted at the beginning of the FITS file by setting status = PREPEND_PRIMARY

except PREPEND_PRIMARY is defined in a header file as

#define PREPEND_PRIMARY    -9  /* used in ffiimg to insert new primary array */

and I don't think that this is exported (I can't find a corresponding symbol exported when I run nm on the library). Perhaps we may just hardcode the symbol here, but is there any other way to access the symbol from the header file?

Creating empty HDUs

Hi,

I need to create FITS files where the first HDU is empty (only containing a header). Given the structure of fits_create_img I did not find a way to do this (please let me know if I overlooked something!). So I extended the code with the following:

function fits_create_empty_hdu(f::FITSFile)

    status = Ref{Cint}(0)
    naxesr = C_NULL
    N = 0
    bitpix = bitpix_from_type(Int16)

    ccall(
         (:ffcrimll, libcfitsio),
         Cint,
         (Ptr{Cvoid}, Cint, Cint, Ptr{Int64}, Ref{Cint}),
         f.ptr,
         bitpix,
         N,
         naxesr,
         status,
     )

    fits_assert_ok(status[])
end

and a small fits_create_img wrapper

function fits_create_img(f::FITSFile, a::Nothing)
    status = fits_create_empty_hdu(f)
end

This appears to work ok but I am not sure whether this is superfluous. If it is useful, I'm happy to create a PR with this, but I must confess I am a tad uncertain about the logic of the runtests.jl so if you have any hints on how to write a test conforming to the code preferences, I'd be happy to hear them!

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

What if we just permuted the data

What if we just permuted data on read? I'd like to see the arguments against, but I would really prefer to see data in its row-major orientation by default.

In terms of implementation, I have no clue what the most efficient and transparent solution is besides calling permutedims. I'm interested how PyCall.jl facilitates this when it hands off arrays to numpy.

cc @giordano

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.