If you were a student would you want to get an excellent recommendation from the ecology professor or a mediocre recommendation from a core science professor? OP probably knows OF COURSE having an excellent recommendation from a professor who taught a core science course is the best way.... the question you're asking is like asking "is it better to get an A in an easy class or a B in a really hard class?" OF COURSE it's better to have A's in all the classes no duh... OP probably asked this question because he/she did really well and stood out in the ecology class to get a strong LOR from the ecology professor rather than ask someone who taught a class in which he/she didn't do as well as in ecology, or maybe it was difficult to get in touch with a core science professor, who knows? OP probably asked this question in order to choose the best option out of whatever he/she has currently....
Just saying, because you sounded as if you were trolling the OP for asking such a "nonsensical" question. I thought it was a legit question.