There is a clear line between fantasy and sf. Poul Anderson delineates the distinction in "Fantasy in the Age of Science" IN Anderson, Fantasy (New York, 1981). Sf is "...a literary form which tried to deal with these enormous changes..." (p. 271), of the industrial and scientific revolutions, whereas fantasy is "...free to bring in the completely supernatural, that which is beyond nature and forever unamenable to the scientific method." (ibid.)
Sf writers address science but also acknowledge myth. The full title of the first modern science fiction novel is Frankenstein, or The Modern Prometheus. This simultaneously initiates a new recurring character (there is a new Frankenstein film as I write) and invokes a pre-Olympian god.
James Joyce, addressing life in general if not science in particular, referred to Homer in Ulysses.