gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #15109] Size of dataset as an Arithmetic operator


From: Mohammad Akhlaghi
Subject: [task #15109] Size of dataset as an Arithmetic operator
Date: Sat, 29 Feb 2020 15:08:18 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0

Follow-up Comment #6, task #15109 (project gnuastro):

The functions to deal with FITS images are lib/fits.h
<http://git.savannah.gnu.org/cgit/gnuastro.git/tree/lib/gnuastro/fits.h>,
described in the Fits files
<https://www.gnu.org/software/gnuastro/manual/html_node/FITS-files.html>
section of the Gnuastro library
<https://www.gnu.org/software/gnuastro/manual/html_node/Gnuastro-library.html>
section of the manual. You can also access these sections with these commands
on the command-line (if you have installed Gnuastro):


info gnuastro "FITS files"
info gnuastro "gnuastro library"


But note that in the Arithmetic program you can't assume the inputs are always
FITS files. The users may have done some operations on the file (it is already
in memory for example) before asking its size. Because some operators change
the dataset's size.

Generally, if you look in the Arithmetic program's source, you'll notice that
the Arithmetic program uses the `operand_pop' function (see
bin/arithmetic/operands.h
<http://git.savannah.gnu.org/cgit/gnuastro.git/tree/bin/arithmetic/operands.h>
to access the operands. Its the job of that function to read the FITS files
*if* the operand is an un-opened FITS file.

In `lib/arithmetic.c', it assumes the dataset is already in memory. So in
practice, you just have to pop the top operand in the Arithmetic program, then
in the Arithmetic library, you just need to read its size (which is already in
the `dsize[]' element of the `gal_data_t').

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?15109>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]