Skip to content

Fix issue#3 #97

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

Closed
wants to merge 15 commits into from
Closed

Fix issue#3 #97

wants to merge 15 commits into from

Conversation

kashish2210
Copy link

@kashish2210 kashish2210 commented Mar 28, 2025

#3

  • instead of adding whole functionalities, I have added SkyCoords.jl in gcirc.jl to make it more compatible
    -notebook I have tested using some examples, u can prefer my notebook

Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use a more descriptive and self-contained title which doesn't reference an issue which requires someone to go and access an other page to know what's the point of a change?

src/gcirc.jl Outdated
Comment on lines 1 to 2
# This file is a part of AstroLib.jl. License is MIT "Expat".
# Copyright (C) 2016 Mosè Giordano.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a general remark, removing copyright notice isn't a nice thing to do 🙂

src/gcirc.jl Outdated
@@ -42,66 +23,124 @@ end

### Purpose ###

Computes rigorous great circle arc distances.
Computes rigorous great circle arc distances using modern Julia astronomical coordinates.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment feels unnecessary.

src/gcirc.jl Outdated
Comment on lines 90 to 94
* The function `sphdist` provides an alternate method of computing a spherical
distance.
* The Haversine formula can give rounding errors for antipodal points.

Code of this function is based on IDL Astronomy User's Library.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the motivation for deleting this?

src/gcirc.jl Outdated
Comment on lines 9 to 17
if units == :radians
new{T}(SkyCoords.ICRSCoords(ra, dec))
elseif units == :hours_degrees
new{T}(SkyCoords.ICRSCoords(ra * π/12.0, deg2rad(dec)))
elseif units == :degrees
new{T}(SkyCoords.ICRSCoords(deg2rad(ra), deg2rad(dec)))
else
throw(ArgumentError("units must be :radians, :hours_degrees, or :degrees"))
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/gcirc.jl Outdated
struct AstroCoordinate{T<:AbstractFloat}
coord::SkyCoords.ICRSCoords

function AstroCoordinate(ra::T, dec::T, units::Symbol=:radians) where T<:AbstractFloat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an inner constructor?

src/gcirc.jl Outdated
Comment on lines 76 to 84
units_sym = if units == 0
:radians
elseif units == 1
:hours_degrees
elseif units == 2
:degrees
else
throw(DomainError(units, "units must be 0 (radians), 1 (hours, degrees) or 2 (degrees)"))
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here, seems to be something to integrate with UnitfulAstro.

src/gcirc.jl Outdated
gcirc(units::Integer, radec1::Tuple{Real, Real}, radec2::Tuple{Real, Real}) =
gcirc(units, radec1..., radec2...)
# Helper function for converting radians to arcseconds
rad2sec(x::T) where T<:AbstractFloat = x * T(206264.8062470963)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline

@kashish2210
Copy link
Author

I am getting a lot of trouble in the compt test failures, though I am using the suggested compt

preview results

image

@kashish2210
Copy link
Author

Can you please use a more descriptive and self-contained title which doesn't reference an issue which requires someone to go and access an other page to know what's the point of a change?

thanks for urvaluable review will update my pr Discription

@cgarling
Copy link
Member

Looks like your tests are failing because you are trying to use AstroAngles.jl which has a minimum Julia version of 1.3 while AstroLib.jl is being tested against 1.0.

I don't use this package much but from a design perspective I'm not a big fan of this change. I think there is utility in providing a common (or at least similar) interface to IDL in this application to ease the transition for new users and to enable easier translation of legacy IDL code.

In the case that someone wants a more Julian interface I think we should be encouraging them to switch over to using SkyCoords.jl directly rather than offering some sort of middle ground that we have to maintain separately from SkyCoords.jl itself.

@kashish2210
Copy link
Author

Yeah it can be better option

@kashish2210 kashish2210 deleted the fix_issue#3 branch March 29, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants