Robin
New Member
I couple the distributions and kinematics of cold gas in galaxies w/ Bulge/Disk decompositions.
Posts: 13
|
Post by Robin on Jul 4, 2018 11:15:08 GMT 8
Hi all, Here's an error that has been pestering me for some time: Error in if (stretchscale == "auto") { : missing value where TRUE/FALSE needed Calls: profitLikeModel -> profitMakePlots -> magimage -> magmap Execution halted
Which essentially gets thrown when making calls to functions like profitLikeModel. It turns out that is has nothing to do with the stretchscale and everything to do with the pixels of the image that your segmentation region covers. The issue arises if you segmentation map covers a region of the image that contains NaNs (like a frame edge for example). Normal usage of ProFit wouldn't cause this to happen but if one were to transfer over a set segmentation map between different bands, it's likely that the frame edges will not match (e.g. in SDSS). A quick and easy fix to this is to run some cleanup lines after loading/generating a segmentation map, you can use the following lines to repair the segmentation and the objects mask: segmentation$segim[is.na(image) & segmentation$segim] = 0 segmentation$objects[is.na(image) & segmentation$objects] = 0
For example: ![]()   Your segmentation stats should be clear of any NaN issues as ProFound is able to handle NaNs. ~ R.
|
|
|
Post by Aaron on Jul 4, 2018 13:10:14 GMT 8
Is this just for NaN, or NA as well? Your fix is a catch for NA rather than NaN, is that right? Does the likelihood without the plot return a value, I.e. is this actually only an issue with the plot?
Part of the issue is that NA and NaN mean very different things. It makes sense to ignore NA (not applicable), but NaN just means not a number (which usually includes infinity). It’s not obvious whether this should be generically ignored, i.e. if you are doing a sum of pixels and one is NaN the result might also be NaN. But I do agree it should fail more elegantly in the case of NaN.
Odd thing is I think magcutout returns NA not NaN when a box is out of bounds by default- do you see something different?
|
|