calc_sun 1.2.9 → 1.2.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17ba770fc7f7e5fba650d574db11d2f821628647
4
- data.tar.gz: b2d518e421c8f5c4db7bfd9509f9e664c85f07ad
3
+ metadata.gz: 51bf5333da35dcf0a10583099ef78e68839a0903
4
+ data.tar.gz: 7c4704b655ad435968e5d1a5face846c56e1753a
5
5
  SHA512:
6
- metadata.gz: d901c66a7f59225201d44e0f110812a0f7dc799a68ff1684af2ff0a6e559effaeb8d308ea1c175215252ed4f99c9bcd235f426217c77bf20f3af55422c2548ea
7
- data.tar.gz: 8b3d353868169de3fac48059028292444fdd5a2d4d4d3766578d02093db431c14661421b5fcd47d0280aa70f4e620fd894ac9c5ee97aa2d65ffc2a4a8e810330
6
+ metadata.gz: e04faaac801b87205c014d38b75db3eba65da8400297ae0b06555dc60c358af4db3fd2ba70b86b4d2e14df0006460d5df214391a7e758ed27a8ea6c9c5c11068
7
+ data.tar.gz: f80f865a7510c2ae9bae5d730e30616dd45caa1ec10247fb71050e59ccf8cb2b2374f1ad42273006036001bdd3307e30a35b41073143fb5e7bf29957264965cf
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -5,7 +5,7 @@
5
5
 
6
6
  Home :: https://rubygems.org/gems/calc_sun
7
7
  Code :: https://github.com/DouglasAllen/calc_sun
8
- RDoc :: http://www.rubydoc.info/gems/calc_sun/1.2.9
8
+ RDoc :: http://www.rubydoc.info/gems/calc_sun/1.2.10
9
9
  Issues :: https://github.com/DouglasAllen/calc_sun/issues
10
10
 
11
11
 
@@ -38,11 +38,11 @@ static VALUE t_init(VALUE self){
38
38
  }
39
39
  /*
40
40
  * call-seq:
41
- * date('yyyy-mm-ddT00:00:00+/-zoneoffset')
41
+ * set_datetime('yyyy-mm-ddT00:00:00+/-zoneoffset')
42
42
  * or
43
- * date('20010203T040506+0700')
43
+ * set_datetime('20010203T040506+0700')
44
44
  * or
45
- * date('3rd Feb 2001 04:05:06 PM')
45
+ * set_datetime('3rd Feb 2001 04:05:06 PM')
46
46
  *
47
47
  * given a string representing date time
48
48
  * convert to DateTime object.
@@ -98,7 +98,8 @@ static VALUE func_get_jd(VALUE self, VALUE vdatetime){
98
98
  * mean_anomaly(ajd)
99
99
  *
100
100
  * given an Astronomical Julian Day Number
101
- * returns Mean Anomaly of Sun in radians.
101
+ * returns Mean Anomaly of Sun in radians
102
+ * rounded to 12 decimal places.
102
103
  *
103
104
  */
104
105
  static VALUE func_mean_anomaly(VALUE self, VALUE vajd){
@@ -118,6 +119,7 @@ static VALUE func_mean_anomaly(VALUE self, VALUE vajd){
118
119
  *
119
120
  * given an Astronomical Julian Day Number
120
121
  * returns Eccentriciy of Earth Orbit around Sun.
122
+ * rounded to 12 decimal places.
121
123
  *
122
124
  */
123
125
  static VALUE func_eccentricity(VALUE self, VALUE vajd){
@@ -135,6 +137,7 @@ static VALUE func_eccentricity(VALUE self, VALUE vajd){
135
137
  *
136
138
  * given an Astronomical Julian Day Number
137
139
  * returns Equation of Center in radians.
140
+ * rounded to 12 decimal places.
138
141
  *
139
142
  */
140
143
 
@@ -163,6 +166,7 @@ static VALUE func_equation_of_center(VALUE self, VALUE vajd){
163
166
  *
164
167
  * given an Astronomical Julian Day Number
165
168
  * returns True Anomaly of Sun in radians.
169
+ * rounded to 12 decimal places.
166
170
  *
167
171
  */
168
172
  static VALUE func_true_anomaly(VALUE self, VALUE vajd){
@@ -179,6 +183,7 @@ static VALUE func_true_anomaly(VALUE self, VALUE vajd){
179
183
  *
180
184
  * given an Astronomical Julian Day Number
181
185
  * returns Mean Longitude of Sun in radians.
186
+ * rounded to 12 decimal places.
182
187
  *
183
188
  */
184
189
  static VALUE func_mean_longitude(VALUE self, VALUE vajd){
@@ -197,6 +202,7 @@ static VALUE func_mean_longitude(VALUE self, VALUE vajd){
197
202
  *
198
203
  * given an Astronomical Julian Day Number
199
204
  * returns Eccentric Anomaly of Sun in radians.
205
+ * rounded to 12 decimal places.
200
206
  *
201
207
  */
202
208
  static VALUE func_eccentric_anomaly(VALUE self, VALUE vajd){
@@ -214,6 +220,7 @@ static VALUE func_eccentric_anomaly(VALUE self, VALUE vajd){
214
220
  *
215
221
  * given an Astronomical Julian Day Number
216
222
  * returns Earth Tilt (Obliquity) in radians.
223
+ * rounded to 12 decimal places.
217
224
  *
218
225
  */
219
226
  static VALUE func_obliquity_of_ecliptic(VALUE self, VALUE vajd){
@@ -229,6 +236,7 @@ static VALUE func_obliquity_of_ecliptic(VALUE self, VALUE vajd){
229
236
  *
230
237
  * given an Astronomical Julian Day Number
231
238
  * returns Longitude of Sun at Perihelion in radians.
239
+ * rounded to 12 decimal places.
232
240
  *
233
241
  *
234
242
  */
@@ -244,6 +252,7 @@ static VALUE func_longitude_of_perihelion(VALUE self, VALUE vajd){
244
252
  *
245
253
  * given an Astronomical Julian Day Number
246
254
  * returns X component of Radius Vector in radians.
255
+ * rounded to 12 decimal places.
247
256
  *
248
257
  *
249
258
  */
@@ -257,10 +266,11 @@ static VALUE func_xv(VALUE self, VALUE vajd){
257
266
  }
258
267
  /*
259
268
  * call-seq:
260
- * xv(ajd)
269
+ * yv(ajd)
261
270
  *
262
271
  * given an Astronomical Julian Day Number
263
272
  * returns Y component of Radius Vector in radians.
273
+ * rounded to 12 decimal places.
264
274
  *
265
275
  *
266
276
  */
@@ -279,6 +289,7 @@ static VALUE func_yv(VALUE self, VALUE vajd){
279
289
  *
280
290
  * given an Astronomical Julian Day Number
281
291
  * returns True Anomaly of Sun in radians.
292
+ * rounded to 12 decimal places.
282
293
  *
283
294
  */
284
295
  static VALUE func_true_anomaly1(VALUE self, VALUE vajd){
@@ -293,6 +304,7 @@ static VALUE func_true_anomaly1(VALUE self, VALUE vajd){
293
304
  *
294
305
  * given an Astronomical Julian Day Number
295
306
  * returns True Longitude of Sun in radians.
307
+ * rounded to 12 decimal places.
296
308
  *
297
309
  */
298
310
  static VALUE func_true_longitude(VALUE self, VALUE vajd){
@@ -309,6 +321,7 @@ static VALUE func_true_longitude(VALUE self, VALUE vajd){
309
321
  *
310
322
  * given an Astronomical Julian Day Number
311
323
  * returns Greenwich Mean Sidereal Time in hours.
324
+ * rounded to 12 decimal places.
312
325
  *
313
326
  */
314
327
  static VALUE func_mean_sidetime(VALUE self, VALUE vajd){
@@ -332,6 +345,7 @@ static VALUE func_mean_sidetime(VALUE self, VALUE vajd){
332
345
  *
333
346
  * given an Astronomical Julian Day Number
334
347
  * returns Greenwich Mean Sidereal Time at midnight as angle.
348
+ * rounded to 12 decimal places.
335
349
  *
336
350
  */
337
351
  static VALUE func_gmsa0(VALUE self, VALUE vajd){
@@ -355,6 +369,7 @@ static VALUE func_gmsa0(VALUE self, VALUE vajd){
355
369
  *
356
370
  * given an Astronomical Julian Day Number
357
371
  * returns Greenwich Mean Sidereal Time as angle.
372
+ * rounded to 12 decimal places.
358
373
  *
359
374
  */
360
375
  static VALUE func_gmsa(VALUE self, VALUE vajd){
@@ -371,6 +386,7 @@ static VALUE func_gmsa(VALUE self, VALUE vajd){
371
386
  *
372
387
  * given an Astronomical Julian Day Number
373
388
  * returns Greenwich Mean Sidereal Time at midnight in hours.
389
+ * rounded to 12 decimal places.
374
390
  *
375
391
  */
376
392
  static VALUE func_gmst0(VALUE self, VALUE vajd){
@@ -384,6 +400,7 @@ static VALUE func_gmst0(VALUE self, VALUE vajd){
384
400
  *
385
401
  * given an Astronomical Julian Day Number
386
402
  * returns Greenwich Mean Sidereal Time in hours.
403
+ * rounded to 12 decimal places.
387
404
  *
388
405
  */
389
406
  static VALUE func_gmst(VALUE self, VALUE vajd){
@@ -396,6 +413,7 @@ static VALUE func_gmst(VALUE self, VALUE vajd){
396
413
  *
397
414
  * given an Astronomical Julian Day Number
398
415
  * returns radius vector.
416
+ * rounded to 12 decimal places.
399
417
  *
400
418
  */
401
419
  static VALUE func_rv(VALUE self, VALUE vajd){
@@ -413,6 +431,7 @@ static VALUE func_rv(VALUE self, VALUE vajd){
413
431
  *
414
432
  * given an Astronomical Julian Day Number
415
433
  * returns ecliptic x component.
434
+ * rounded to 12 decimal places.
416
435
  *
417
436
  */
418
437
  static VALUE func_ecliptic_x(VALUE self, VALUE vajd){
@@ -429,6 +448,7 @@ static VALUE func_ecliptic_x(VALUE self, VALUE vajd){
429
448
  *
430
449
  * given an Astronomical Julian Day Number
431
450
  * returns ecliptic y component.
451
+ * rounded to 12 decimal places.
432
452
  *
433
453
  */
434
454
  static VALUE func_ecliptic_y(VALUE self, VALUE vajd){
@@ -445,6 +465,7 @@ static VALUE func_ecliptic_y(VALUE self, VALUE vajd){
445
465
  *
446
466
  * given an Astronomical Julian Day Number
447
467
  * returns Right Ascension of Sun in hours.
468
+ * rounded to 12 decimal places.
448
469
  *
449
470
  */
450
471
  static VALUE func_right_ascension(VALUE self, VALUE vajd){
@@ -464,6 +485,7 @@ static VALUE func_right_ascension(VALUE self, VALUE vajd){
464
485
  *
465
486
  * given an Astronomical Julian Day Number
466
487
  * returns Greenwich Hour Angle in degrees.
488
+ * rounded to 12 decimal places.
467
489
  *
468
490
  */
469
491
  static VALUE func_gha(VALUE self, VALUE vajd){
@@ -480,6 +502,7 @@ static VALUE func_gha(VALUE self, VALUE vajd){
480
502
  *
481
503
  * given an Astronomical Julian Day Number
482
504
  * returns Declination of Sun in degrees.
505
+ * rounded to 12 decimal places.
483
506
  *
484
507
  */
485
508
  static VALUE func_declination(VALUE self, VALUE vajd){
@@ -501,6 +524,7 @@ static VALUE func_declination(VALUE self, VALUE vajd){
501
524
  * given an Astronomical Julian Day Number and
502
525
  * local Longitude,
503
526
  * returns Local Mean Sidereal Time in hours.
527
+ * rounded to 12 decimal places.
504
528
  *
505
529
  */
506
530
  static VALUE func_local_sidetime(VALUE self, VALUE vajd, VALUE vlon){
@@ -515,6 +539,7 @@ static VALUE func_local_sidetime(VALUE self, VALUE vajd, VALUE vlon){
515
539
  * given an Astronomical Julian Day Number and
516
540
  * local Latitude,
517
541
  * returns Hours of Day Light.
542
+ * rounded to 12 decimal places.
518
543
  *
519
544
  */
520
545
  static VALUE func_dlt(VALUE self, VALUE vajd, VALUE vlat){
@@ -546,6 +571,7 @@ static VALUE func_dlt(VALUE self, VALUE vajd, VALUE vlat){
546
571
  * given an Astronomical Julian Day Number and
547
572
  * local Latitude,
548
573
  * returns Hours from Noon or half Day Light Time.
574
+ * rounded to 12 decimal places.
549
575
  *
550
576
  */
551
577
  static VALUE func_diurnal_arc(VALUE self, VALUE vajd, VALUE vlat){
@@ -561,6 +587,7 @@ static VALUE func_diurnal_arc(VALUE self, VALUE vajd, VALUE vlat){
561
587
  * given an Astronomical Julian Day Number and
562
588
  * local Longitude,
563
589
  * returns Time in Hours when Sun transits local meridian.
590
+ * rounded to 12 decimal places.
564
591
  *
565
592
  */
566
593
  static VALUE func_t_south(VALUE self, VALUE vajd, VALUE vlon){
@@ -578,6 +605,7 @@ static VALUE func_t_south(VALUE self, VALUE vajd, VALUE vlon){
578
605
  * given an Astronomical Julian Day Number and
579
606
  * local Latitude and Longitude,
580
607
  * returns Time in Hours when Sun rises.
608
+ * rounded to 12 decimal places.
581
609
  *
582
610
  */
583
611
  static VALUE func_t_rise(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
@@ -592,6 +620,7 @@ static VALUE func_t_rise(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
592
620
  * given an Astronomical Julian Day Number and
593
621
  * local Latitude and Longitude,
594
622
  * returns Time in Hours when Sun transits local meridian.
623
+ * rounded to 12 decimal places.
595
624
  *
596
625
  */
597
626
  static VALUE func_t_mid_day(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
@@ -605,6 +634,7 @@ static VALUE func_t_mid_day(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
605
634
  * given an Astronomical Julian Day Number and
606
635
  * local Latitude and Longitude,
607
636
  * returns Time in Hours when Sun sets.
637
+ * rounded to 12 decimal places.
608
638
  *
609
639
  */
610
640
  static VALUE func_t_set(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
@@ -696,8 +726,6 @@ static VALUE func_set(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
696
726
  }
697
727
  stajd = floor(ajd) - 0.5 + st / 24.0;
698
728
  vst = DBL2NUM(stajd);
699
- //VALUE date = rb_sprintf("Sun set: %2.0f:%02.0f UTC\n",
700
- //floor(st), floor(fmod(st, 1.0) * 60.0));
701
729
  return func_ajd_2_datetime(self, vst);
702
730
  }
703
731
  /*
@@ -747,6 +775,7 @@ static VALUE func_jd_from_2000(VALUE self, VALUE vajd){
747
775
  * local Longitude,
748
776
  * returns the number of days and decimal time
749
777
  * since JD 2000.
778
+ * rounded to 12 decimal places.
750
779
  *
751
780
  */
752
781
  static VALUE func_days_from_2000(VALUE self, VALUE vajd, VALUE vlon){
@@ -761,6 +790,7 @@ static VALUE func_days_from_2000(VALUE self, VALUE vajd, VALUE vlon){
761
790
  *
762
791
  * given an Astronomical Julian Day Number
763
792
  * returns equation of time in degrees
793
+ * rounded to 12 decimal places.
764
794
  *
765
795
  */
766
796
  static VALUE func_eot(VALUE self, VALUE vajd){
@@ -781,6 +811,7 @@ static VALUE func_eot(VALUE self, VALUE vajd){
781
811
  * given an Astronomical Julian Day Number
782
812
  * returns equation of time as time of a fractional
783
813
  * day for easy Julian Number work
814
+ * rounded to 12 decimal places.
784
815
  *
785
816
  */
786
817
  static VALUE func_eot_jd(VALUE self, VALUE vajd){
@@ -795,6 +826,7 @@ static VALUE func_eot_jd(VALUE self, VALUE vajd){
795
826
  *
796
827
  * given an Astronomical Julian Day Number
797
828
  * returns equation of time in minutes
829
+ * rounded to 12 decimal places.
798
830
  *
799
831
  */
800
832
  static VALUE func_eot_min(VALUE self, VALUE vajd){
@@ -808,6 +840,7 @@ static VALUE func_eot_min(VALUE self, VALUE vajd){
808
840
  * given an Astronomical Julian Day Number and
809
841
  * local Longitude,
810
842
  * returns Local Hour Angle in degrees.
843
+ * rounded to 12 decimal places.
811
844
  *
812
845
  */
813
846
  static VALUE func_lha(VALUE self, VALUE vajd, VALUE vlon){
@@ -823,6 +856,7 @@ static VALUE func_lha(VALUE self, VALUE vajd, VALUE vlon){
823
856
  * given an Astronomical Julian Day Number and
824
857
  * local Latitude and Longitude,
825
858
  * returns the Altitude of the Sun in degrees.
859
+ * rounded to 12 decimal places.
826
860
  *
827
861
  */
828
862
  static VALUE func_altitude(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
@@ -841,6 +875,7 @@ static VALUE func_altitude(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
841
875
  * given an Astronomical Julian Day Number and
842
876
  * local Latitude and Longitude,
843
877
  * returns the Azimuth of the Sun in degrees.
878
+ * rounded to 12 decimal places.
844
879
  *
845
880
  */
846
881
  static VALUE func_azimuth(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
@@ -898,14 +933,9 @@ static VALUE func_set_az(VALUE self, VALUE vajd, VALUE vlat, VALUE vlon){
898
933
  }
899
934
 
900
935
  void Init_calc_sun(void){
901
- VALUE cCalcSun = rb_define_class("CalcSun", rb_cObject);
902
936
  rb_require("date");
903
- // rb_define_const(cCalcSun, "DJ00", DBL2NUM(DJ00));
904
- //VALUE cDate = rb_const_get(rb_cObject, rb_intern("Date"));
905
- //VALUE rb_date = rb_funcall(cDate, rb_intern("new"), 0);
906
- //rb_iv_set(self, "@date", rb_date);
937
+ VALUE cCalcSun = rb_define_class("CalcSun", rb_cObject);
907
938
  rb_define_method(cCalcSun, "initialize", t_init, 0);
908
- rb_define_attr(cCalcSun, "date", 1, 1);
909
939
  rb_define_method(cCalcSun, "ajd", func_get_ajd, 1);
910
940
  rb_define_method(cCalcSun, "ajd2dt", func_ajd_2_datetime, 1);
911
941
  rb_define_method(cCalcSun, "altitude", func_altitude, 3);
@@ -106,12 +106,9 @@ void Init_side_time(void){
106
106
  VALUE cSideTime = rb_define_class("SideTime", rb_cObject);
107
107
  rb_require("date");
108
108
  rb_define_method(cSideTime, "initialize", t_init, 0);
109
- rb_define_attr(cSideTime, "date", 1, 1);
110
109
  rb_define_method(cSideTime, "ajd", func_get_ajd, 1);
111
110
  rb_define_method(cSideTime, "s_datetime", func_set_datetime, 1);
112
111
  rb_define_method(cSideTime, "jd", func_get_jd, 1);
113
- //rb_define_method(cSideTime, "jd2000_dif", func_jd_from_2000, 1);
114
- //rb_define_method(cSideTime, "jd2000_dif_lon", func_days_from_2000, 2);
115
112
  rb_define_method(cSideTime, "lmst", func_local_sidetime, 2);
116
113
  rb_define_method(cSideTime, "gmst", func_mean_sidetime, 1);
117
114
  }
@@ -2,5 +2,6 @@
2
2
 
3
3
  # class file CalcSun
4
4
  class CalcSun
5
- VERSION = '1.2.9'.freeze
5
+ # VERSION = '1.2.10'
6
+ VERSION = '1.2.10'.freeze
6
7
  end
@@ -2,5 +2,6 @@
2
2
 
3
3
  # class file SideTime
4
4
  class SideTime
5
+ # VERSION = '1.2.10'
5
6
  VERSION = '0.1.0'.freeze
6
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calc_sun
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.9
4
+ version: 1.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Douglas Allen
metadata.gz.sig CHANGED
@@ -1,3 +1 @@
1
- y���'2�^����e����8J<�2itdE��$9�Ÿ��l��KQnX'�w�$�B�ᦀ�TzEDF�"Kc�J
2
- �/p�5�{f|Z�]dQ7�}�mv�G'��c.$P�O��Vq��3�Q�_���'�3)R����lW_
3
- Q��:5�
1
+ ?�%.�1������T0��JD�����hkz�#aJF��������`$S{���Z��1��c4��b���ɡ4Q��\��v��`<��:7£����{� q^!f�=���Q`+�q������۞�9�'�,�%ŏ�ھ�_��0{��!�� >]'r��6=f9��;�2��v\���(`�T����9