GNU Astronomy Utilities - Tasks: task #15109, Arithmetic not reading data when...
You are not allowed to post comments on this tracker with your current authentication level.
task #15109: Arithmetic not reading data when metadata requested
Submitter: | Mohammad Akhlaghi <makhlaghi> | ||
Submitted: | Sat 08 Dec 2018 04:11:07 PM UTC | ||
Should Start On: | Fri 07 Dec 2018 11:00:00 PM UTC | Should be Finished on: | Fri 07 Dec 2018 11:00:00 PM UTC |
Category: | Arithmetic | Priority: | 5 - Normal |
Item Group: | Enhancement | Status: | Postponed |
Privacy: | Public | Assigned to: | None |
Percent Complete: | 0% | Open/Closed: | Open |
Effort: | 0.00 |
Jump to the original submission
Sun 08 Mar 2020 02:20:55 PM UTC, comment #17: |
Mohammad Akhlaghi <makhlaghi> |
Sun 08 Mar 2020 05:04:49 AM UTC, comment #16: The final size function is ready along with documentation. I've rebased all previous commits onto a clean one. I've improved it so that no printing of the dimensions is required and a single integer output is returned.
|
Sachin Kumar Singh <sks_15> |
Sat 07 Mar 2020 03:45:58 PM UTC, comment #15: Sorry! In the previous point, I should have written: "once you know the dataset's TYPE, ...". I mistakenly wrote "size". |
Mohammad Akhlaghi <makhlaghi> |
Sat 07 Mar 2020 03:44:17 PM UTC, comment #14: I recommend reading through the data.h documentation, with its subsections. All Gnuastro programs use this structure for reading/writing datasets of any type and size, with some basic metadata.
|
Mohammad Akhlaghi <makhlaghi> |
Sat 07 Mar 2020 11:27:37 AM UTC, comment #13: When using `out->array=(void *)&(in->dsize[arg_val-1])` it gives a corruption error. Also using
|
Sachin Kumar Singh <sks_15> |
Sat 07 Mar 2020 03:12:25 AM UTC, comment #12: Another small point: in the end (when you rebase the commits into one commit with a good comment), also remove the changes in `tests/during-dev.sh': in the master branch, this file should always be clean. |
Mohammad Akhlaghi <makhlaghi> |
Sat 07 Mar 2020 02:53:27 AM UTC, comment #11: This is good progress indeed. There are just some (mostly minor) points that can be fixed easily but are important:
|
Mohammad Akhlaghi <makhlaghi> |
Fri 06 Mar 2020 12:02:09 PM UTC, comment #10: All the problems regarding the size operator are fixed now. I've pushed the code to my GitHub repo in the `task-arithop-size` branch.
|
Sachin Kumar Singh <sks_15> |
Fri 06 Mar 2020 01:25:57 AM UTC, comment #9: In the previous post I forgot to mention how you can read the contents of `arg' after doing basic sanity checks.
|
Mohammad Akhlaghi <makhlaghi> |
Fri 06 Mar 2020 01:19:09 AM UTC, comment #8: Looks good! You are on the right track :-)!
|
Mohammad Akhlaghi <makhlaghi> |
Wed 04 Mar 2020 07:42:15 AM UTC, comment #7: For the second argument(the required dimension, let it be called `arg`), I've used `gal_data_t' as well. To use this value, I've used its arg->array, because on inspection it showed a size to be 1, which is desired. But I'm aware it is a void pointer and on dereferencing with a long typecast is showing a large random number. How to fix this? how can I get the value of the second operator?
|
Sachin Kumar Singh <sks_15> |
Sat 29 Feb 2020 08:08:18 PM UTC, comment #6: The functions to deal with FITS images are lib/fits.h, described in the Fits files section of the Gnuastro library section of the manual. You can also access these sections with these commands on the command-line (if you have installed Gnuastro):
|
Mohammad Akhlaghi <makhlaghi> |
Sat 29 Feb 2020 01:50:59 PM UTC, comment #5: Which function to use to read the fits file or its metadata in the lib/arithmetic.c using a filename? I see the functions in the bin/fits/keywords.c to print all the info but how to use them. Is there any funtion to directly read the hdus or fits? |
Sachin Kumar Singh <sks_15> |
Wed 26 Feb 2020 02:38:58 PM UTC, comment #4: This is an identical problem with bug #57891! Can you follow the discussion there please? You can also try the recommendations there for a start.
|
Mohammad Akhlaghi <makhlaghi> |
Wed 26 Feb 2020 01:55:54 PM UTC, comment #3: I was getting the following error(in test.log) when I made a small change in the size function. I stashed and removed the directory to my last working commit and this still persists. I looked at the `gsl_fft_complex_wavetable_alloc` it seems to be fine. I did a developer build again but this still persists.
|
Sachin Kumar Singh <sks_15> |
Sun 23 Feb 2020 11:51:43 PM UTC, comment #2: I tried the build and it didn't crash, although it did give a "unused variable ‘dsize’" warning, which I assume will be fixed later once you implement the insides of the function.
|
Mohammad Akhlaghi <makhlaghi> |
Sun 23 Feb 2020 03:18:19 PM UTC, comment #1: I've pushed the changes here https://github.com/sachinkumarsingh092/gnuastro/tree/task-arithop-size .
|
Sachin Kumar Singh <sks_15> |
Sat 08 Dec 2018 04:11:07 PM UTC, original submission:
In some processing situations, the size of a dataset along a dimension is necessary. So Arithmetic can use a new operator, maybe called "size" that will do this job. For example the command below will print the size of the dataset along its second dimension.
|
Mohammad Akhlaghi <makhlaghi> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 2 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2020-03-08 | makhlaghi | Summary | Size of dataset as an Arithmetic operator | Arithmetic not reading data when metadata requested | |
2020-02-26 | sks_15 | Attached File | - | Added test.log, #48500 |
Powered by Savane 3.13-f8d8.
Corresponding source code
Great! your commit is now in the Gnuastro's main `master' branch. Some further corrections were necessary, which I implemented in the next commit. Please go through those points and look at the corrected lines to hopefully prepare you for your next edits in the code ;-).
But as you may have noticed, I just changed the task summary/title, I didn't close it. The reason is that we still need to read-in the full dataset to just read its size. However, as mentioned in the first comment of this task, we don't want this: when only the dataset's metadata is necessary, we shouldn't read the data (and waste time and memory). So to complete this task, we should add some special steps in the arithmetic program so when meta-data are necessary, it doesn't go reading-in the full dataset. For example a special variable/flag called `meta' can be defined in the relevant functions. The `size' operator (or other later operators) will set it to 1, while the others will set it to zero. When its 1, then the step where we pop the operator (either read it, or just pick it from the stack), we just read/copy the metadata in an empty-of-data dataset.
But this may be a little too low level for you Sachin and isn't a critical issue now. So I recommend moving onto another task/bug. Thanks again for the good work ;-).