e-koch / FilFinder

Detection of filamentary structure in molecular clouds
http://fil-finder.readthedocs.io/en/latest
MIT License
41 stars 21 forks source link

why total_intensity much smaller than median brightness ? #29

Closed esoPanda closed 6 years ago

esoPanda commented 8 years ago

Hi Eric,

What a nice tool ! Exactly what I've been looking for!

I tried FilFinder on one of my favorite filaments (not really to "find", but to get properties automatically). The results are very good from visual inspection. However the returned total intensity is 1.2e-5 while the median brightness is 12. This is obviously wrong, unless you have different units for the two values? I don't know how to attach files here, but the table is here: Amplitude Error,Branches,Orientation,Lengths,Total Intensity,Width Error,Curvature,FWHM Error,Width,Background Error,Amplitude,Background,Median Brightness,FWHM,Fit Type 0.02470738489337417,3,-0.5256068557493918,1.3387213469544617,1.2238113258610874e-05,0.0007197117146968454,0.6962065802395621,0.0017615915057050487,0.037069003036394065,0.0953009146975467,11.962578119690637,3.3136256476938657,11.932802903734958,0.0839807440745629,g

BTW, in the width fitting, all pixels within the mask are used to build the radial profile, and that means the fitting is performed on the averaged profile - is that right? Is it possible to tell the fitter to use one of the models (g, l, c, n)?

Thanks, Ke

e-koch commented 8 years ago

Hi @esoPanda -- The column names I decided to use are unhelpfully ambiguous... I'll need to make this more clear in the code.

Total Intensity is the sum of intensities within 1 FWHM after subtracting off the background from the fit to the radial profile. Median Brightness is the median intensity only along the skeleton of a filament, without subtracting off a background. So it is ok that the "median" > "total", their names just need to distinguish what they are better.

Yes, the width fitting is on an averaged profile, but the pixels don't necessarily have to be in the mask. It will use all pixels in the image, up to a maximum distance, which are closer to that filament than any other (based on their skeletons). This ensures that pixels aren't double-counted. I've also been working on an alternate way to create profiles of filaments by creating radial cuts along each pixel in the skeleton, so changes in the width or amplitude can be tracked along a filament's extent. The code works, but likely isn't robust for all situations yet. An example script is here.

Right now, the fitting is limited to a gaussian and the non-parametric method. You can set try_nonparam=False in fil_finder_2D.find_widths to force it to use a gaussian only. You can feed it a different model, which is set by fit_model in find_widths, but I haven't yet made creating new models very easy for users.

Please pass along any suggestions or other issues you encounter! I won't be able to address any changes for the next few weeks though (I'm finishing my thesis).

e-koch commented 8 years ago
esoPanda commented 8 years ago

Thanks Eric. I would expect Total Intensity to be the Integrated Flux (de-convolved with beam) of the area within FWHM of the filament, is this the case? So I know roughly how much the Integrated Flux should be (order of 1e4). In the returned table, the background is ~3.3, and amplitude close to 12. These are reasonable, but the Total Intensity is way way off...

Some immediate suggestion:

Another note: do you have a 3D version for PPV cubes somewhere? I'd like to give it a try.

Happy thesis writing!

esoPanda commented 8 years ago

One additional suggestion:

e-koch commented 8 years ago

Thanks for the suggestions! I've edited your replies to create a checklist.

No, there isn't a PPV version yet. I intend to get a version for cubes working, but it likely won't get completed for awhile. I think @keflavich tried to stack 2D skeletons over multiple channels, but I'm not sure how well that worked.

e-koch commented 6 years ago

Most fixes/changes addressed in #41 and the newly released v1.6.

@esoPanda, I apologize that this has taken forever for me to address. If you're still using FilFinder, I've started a mailing list to announce bugs and new releases of the package: https://groups.google.com/forum/#!forum/filfinder.

Things of note: