Go Back   IceInSpace > Beginners Start Here > Beginners Talk
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread
  #21  
Old 19-02-2008, 10:24 AM
erick's Avatar
erick (Eric)
Starcatcher

erick is offline
 
Join Date: Dec 2006
Location: Gerringong
Posts: 8,532
#11, Glen? Sorted by ascending magnitude, I get 47 Tuc GC? I'm obviously missing something here. Sorry.
Reply With Quote
  #22  
Old 19-02-2008, 10:44 AM
glenc's Avatar
glenc (Glen)
star-hopper

glenc is offline
 
Join Date: Jun 2005
Location: Terranora
Posts: 4,320
Post #11 is sorted by type then magnitude and gives RA in hms and dec in dm. Post #6 is sorted by mag only.

Last edited by glenc; 19-02-2008 at 11:29 AM.
Reply With Quote
  #23  
Old 19-02-2008, 10:54 AM
erick's Avatar
erick (Eric)
Starcatcher

erick is offline
 
Join Date: Dec 2006
Location: Gerringong
Posts: 8,532
Sorry, 11am is too early in the morning for me. Post #11! I was looking for item #11 on the spreadsheet.

Yes, I have the spreadsheet down and have already embedded the code to display deg/min/sec as well - thanks Glen and Daniel. Now to order it the way(s) I would use the most and laminate it for outdoor use for when the lappie is not available!
Reply With Quote
  #24  
Old 19-02-2008, 08:40 PM
wasyoungonce's Avatar
wasyoungonce (Brendan)
Certified Village Idiot

wasyoungonce is offline
 
Join Date: Jul 2006
Location: Mexico city (Melb), Australia
Posts: 2,338
Quote:
Originally Posted by dannat View Post
Glad you liked the vbasic stuff - thanks for the tweak as well

Hi dannat...can I grovel for some more help.....

I'm trying to use the spreadsheet to convert decimal DEC degrees to DEC degrees minutes seconds so I can order all DEC angles.

I know it's been done and I can do it with excel but it would sure be nice to do it with a VB script.

At the moment the script (I fiddled with) won't convert the -ve DEC degrees..It returns 0°0'00".


I tried this VBS (calling the function "Convert_DEC_Degree"):

Function Convert_DEC_Degree(Decimal_DEC_Deg) As Variant
With Application
'Set degree to Integer of Argument Passed
Degrees = Int(Decimal_Deg)
'Set minutes to 60 times the number to the right
'of the decimal for the variable Decimal_Deg
Minutes = (Decimal_Deg - Degrees) * 60
'Set seconds to 60 times the number to the right of the
'decimal for the variable Minute
Seconds = Format(((Minutes - Int(Minutes)) * 60), "0")
'Returns the Result of degree conversion
'(for example, 10.46 = 10~ 27 ' 36")
Convert_DEC_Degree = " " & Degrees & "° " & Int(Minutes) & "' " _
& Seconds + Chr(34)
End With
End Function


To enter the VBS function is "he command function is "=convert_DEC_Degree()"



Any help?Pretty please!



P.S.

I just noticed I get a "!" mark in the RA column and when I hover my mouse over this "!" it states "The formula in this cell differs from the formulas in this areas of the spreadsheet". Of course the RA column is next to the DEC column.

The RA column is ordered by your previous VBS script..except I changed line 13 to: "Convert_Degree = " " & Degrees & "h " & Int(Minutes) & "' " _"

This returns RA in hours minutes and degrees, "10h27'36".



P.P.S

I looked up the help and the above is just a warning that the formula is different from the one in the column next to it .....thats' all

Last edited by wasyoungonce; 19-02-2008 at 08:51 PM.
Reply With Quote
  #25  
Old 20-02-2008, 03:40 AM
glenc's Avatar
glenc (Glen)
star-hopper

glenc is offline
 
Join Date: Jun 2005
Location: Terranora
Posts: 4,320
"At the moment the script (I fiddled with) won't convert the -ve DEC degrees..It returns 0°0'00".
Is there an absolute function? In Excel you can use =ABS().
See: http://www.w3schools.com/vbscript/vb..._functions.asp
Reply With Quote
  #26  
Old 20-02-2008, 05:40 AM
glenc's Avatar
glenc (Glen)
star-hopper

glenc is offline
 
Join Date: Jun 2005
Location: Terranora
Posts: 4,320
version 3

The attached Excel file gives the list of 90 objects south of declination -20, sorted by type and RA, a colour coded "map" and a table of dates. If you hover over a point on the map you will get its coordinates.
Attached Files
File Type: zip 90 OC GC PN Gx.zip (12.0 KB, 20 views)

Last edited by glenc; 20-02-2008 at 06:11 AM.
Reply With Quote
  #27  
Old 20-02-2008, 10:37 AM
wasyoungonce's Avatar
wasyoungonce (Brendan)
Certified Village Idiot

wasyoungonce is offline
 
Join Date: Jul 2006
Location: Mexico city (Melb), Australia
Posts: 2,338
Thanks gents...that's a neat map glen


P.S.

With some fiddling I got the VBS function to return the correct DEC angle, degrees minutes and seconds for a "positive integer decimal degree". For example 69.75° is returned as 69°45'0". Here is the VBS script:

Function Convert_DEC_Degree(Decimal_DEC_Deg) As Variant
With Application
'Set degree to Integer of Argument Passed
Degrees = Int(Decimal_DEC_Deg)
'Set minutes to 60 times the number to the right
'of the decimal for the variable Decimal_DEC_Deg
Minutes = (Decimal_DEC_Deg - Degrees) * 60
'Set seconds to 60 times the number to the right of the
'decimal for the variable Minute
Seconds = Format(((Minutes - Int(Minutes)) * 60), "0")
'Returns the Result of degree conversion
'(for example, 10.46 = 10~ 27 ' 36")
Convert_DEC_Degree = " " & Degrees & "° " & Int(Minutes) & "' " _
& Seconds + Chr(34)
End With
End Function


To enter the VBS function in a cell is the command: "=convert_DEC_Degree(xx)"


But.......for negative DEC decimal degrees it rounds the integer upwards. It returns -69.75° DEC angles as -70°15'0".

Slowly getting there!

Last edited by wasyoungonce; 20-02-2008 at 11:31 AM.
Reply With Quote
  #28  
Old 05-03-2008, 07:02 PM
wasyoungonce's Avatar
wasyoungonce (Brendan)
Certified Village Idiot

wasyoungonce is offline
 
Join Date: Jul 2006
Location: Mexico city (Melb), Australia
Posts: 2,338
Conversion macros for DMS and decimal angles

I have been spending some time mucking around with excel macros to convert DMS to decimal and decimal to DMS angles.

Here are some excel macro scripts that convert:
1.RA decimal angle to DMS, ie: convert 10.55 RA to 10h 33' 00".
2.Declination decimal angle to DMS, ie: convert -61.5 to -61° 30' 00".
3.RA DMS to decimal RA angle, ie: convert 10h 33' 00" to 10.55.
4.Declination DMS to Decimal angle, ie: convert 61° 30' 00" to 61.5.

The macro functions are contained in the attached word document. They are not the be all to end all and probably contain many mistakes. But at present they work! With little caveats on data entry.


Please do not confuse me with a “macro” whip! My knowledge on this can be measured between the bottom of a snakes belly and the ground…not much!

But if anyone has input pls discuss!

edit:
Amended word doc with some changes I forgot.
Added example excel doc with macros in zip format.

Edit Edit:
Minor amendment in macros:
“=RADECtoDMS”. and
“=DECtoDMS”.
This amendment round seconds integer with zero decimal points. This stops nuisance value decimal points in seconds output ie: instead of -61° 30' 00.955" it will return -61° 30' 01". Of course if you want seconds decimal places you can edit the macro yourself to include decimal values.

Edit completed of above functions:
Original line: Seconds = Round(Seconds, 3)
New Line: Seconds = Round(Seconds, 0)

Edit Edit Edit:
Minor correction to "=Convert_RADecimal". This was done so that it accepted RA hours format
10h 33' 00" as a valid input for conversion to DD.

I had made the change in the sample spreadsheet but the word document scripts were not amended. It now is.

New files uploaded to reflect these changes.
Cheers.


Last edited by wasyoungonce; 08-03-2008 at 08:47 PM.
Reply With Quote
  #29  
Old 10-03-2008, 07:28 PM
Screwdriverone's Avatar
Screwdriverone (Chris)
I have detailed files....

Screwdriverone is offline
 
Join Date: Feb 2008
Location: Kellyville Ridge, NSW Australia
Posts: 3,306
Thanks Glen,

That one has gone straight through the laminator ready for tonight's clear sky!!

Cheers
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time is now 11:34 PM.

Powered by vBulletin Version 3.8.7 | Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Advertisement
Testar
Advertisement
Bintel
Advertisement