Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically set map FITS BLANK keyword #61

Open
ossama-othman opened this issue Dec 30, 2017 · 1 comment
Open

Automatically set map FITS BLANK keyword #61

ossama-othman opened this issue Dec 30, 2017 · 1 comment

Comments

@ossama-othman
Copy link
Owner

ossama-othman commented Dec 30, 2017

If the source photo FITS file contains a BLANK card/value use that same value for the generated map if the map data type is also a comparable integer. Special handling may be needed for the mosaic case since multiple potentially different BLANK values could exist.

If the BLANK keyword doesn't exist, a value chosen using a procedure that prioritizes speed like the following:

  1. Choose a value outside of the [DATAMIN, DATAMAX] range in the FITS file, ideally less than DATAMIN.
  2. If neither of those values exist, scan the image array for minimum and maximum array values, and choose a BLANK outside of that range.
  3. If the array scan doesn't provide a suitable result, e.g. if the scanned minimum and maximum array values are the same as the image data type minimum and maximum, fall back on a scan with the sky masked out of the image. This step can be time intensive.
@ossama-othman
Copy link
Owner Author

ossama-othman commented Dec 30, 2017

MaRC currently reads the source photo data into a C++ std::vector<double> container through the CFITSIO fits_read_pix() library call. Since MaRC supplies a "nulval" argument, CFITSIO will convert BLANK values in integer typed photo data to an IEEE NaN (Not-a-Number) value when writing the read integer values into a floating point array. MaRC should set the corresponding NaN values in the map to the BLANK value found in the source photo FITS file when possible.

@ossama-othman ossama-othman added this to the v1.0 Release milestone Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant