Calculate Sun data from date
Created: 2011-02-15 09:57:51
Last updated: 2011-03-02 12:02:43
caluculates B0 (radians), position angle and sun radius (arcsec)
B0 - heliographic latitude of the centre of disk
position angle - of the north end of the axis of rotation, measured +ve if east of the north point of the disk
radius - the apparent radus of the Sun in arcsec
This is created using the calculations from the IDL routine get_sun.pro
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (2)
Calculate Sun data from date |
Calculate Sun data from date (time factor of input is ignored) |
Descriptions (2)
caluculates B0, position angle and sun radius (arcsec)
B0 - heliographic latitude of the centre of disk
position angle - of the north end of the axis of rotation, measured +ve if east of the north point of the disk
radius - the apparent radus of the Sun in arcsec
This is created using the calculations from the IDL routine get_sun.pro |
caluculates B0, position angle and sun radius (arcsec)
B0 - heliographic latitude of the centre of disk
position angle - of the north end of the axis of rotation, measured +ve if east of the north point of the disk
radius - the apparent radus of the Sun in arcsec |
Dependencies (0)
Inputs (1)
Name |
Description |
sun_data_dateTime |
dateTime for which the Sun data is to be calculated
(time is ignored)
dateTime for which the Sun data is to be calculated
|
Processors (1)
Name |
Type |
Description |
sun_data |
beanshell |
Scriptimport java.text.SimpleDateFormat;
static int JGREG= 15 + 31*(10+12*1582);
public static double toJulian(int[] ymdt) {
int year=ymdt[0];
int month=ymdt[1]; // jan=1, feb=2,...
int day=ymdt[2];
int time = ymdt[3];
int julianYear = year;
if (year < 0) julianYear++;
int julianMonth = month;
if (month > 2) {
julianMonth++;
}
else {
julianYear--;
julianMonth += 13;
}
double julian = (java.lang.Math.floor(365.25 * julianYear)
+ java.lang.Math.floor(30.6001*julianMonth) + day + 1720995.0);
if (day + 31 * (month + 12 * year) >= JGREG) {
// change over to Gregorian calendar
int ja = (int)(0.01 * julianYear);
julian += 2 - ja + (0.25 * ja);
}
double result = (double)java.lang.Math.floor(julian);
// julian days start at 12 noon - we need to adjust our time;
if(time>43200){
time = time - 43200;
} else {
time = time + 43200;
result=result - 1; //previous day
}
result = result + time/86400.0;
return result;
}
double radeg = 180.0/Math.PI;
// Julian date:
int[] dateIn =new int[4];
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
Calendar cal = Calendar.getInstance();
cal.setTime(sdf.parse(dateTime));
dateIn[0]=cal.get(Calendar.YEAR);
dateIn[1]=cal.get(Calendar.MONTH)+1;
dateIn[2]=cal.get(Calendar.DAY_OF_MONTH);
dateIn[3]=(cal.get(Calendar.HOUR_OF_DAY)*60+cal.get(Calendar.MINUTE))*60+cal.get(Calendar.SECOND);
// Julian Day number
double jd = toJulian(dateIn);
// Julian Centuries from 1900.0:
double t = (jd - 2415020.0)/36525.0;
//Geometric Mean Longitude (deg):
double mnl = 279.69668 + 36000.76892*t + 0.0003025*Math.pow(t,2);
mnl = mnl % 360;
// Mean anomaly (deg):
double mna = 358.47583 + 35999.04975*t -
(0.000150*Math.pow(t,2)) - (0.0000033*Math.pow(t,3));
mna = mna % 360;
//Eccentricity of orbit:
double e = 0.01675104 - (0.0000418*t) - (0.000000126*Math.pow(t,2));
// Sun's equation of center (deg):
double c = (1.919460 - (0.004789*t) - (0.000014*Math.pow(t,2)))*Math.sin(mna/radeg) +
(0.020094 - 0.000100*t)*Math.sin(2*mna/radeg) + (0.000293*Math.sin(3*mna/radeg));
// Sun's true geometric longitude (deg)
double true_long = (mnl + c) % 360.0;
double omega = 259.18 - 1934.142*t;
double lamda = true_long - 0.00569;
double lamda2 = lamda -.00479*Math.sin(omega/radeg);
double ob1 = 23.452294 - 0.0130125*t - 0.00000164*Math.pow(t,2)+ 0.000000503*Math.pow(t,3);
double k = 74.3646 + 1.395833 * t;
double diff = (lamda -k)/radeg;
double i = 7.25;
double x = Math.atan(Math.cos(lamda2/radeg)*-1*Math.tan(ob1/radeg));
double y = Math.atan(Math.cos(diff)*-1*Math.tan(i/radeg));
double pa = x + y;
position_angle = pa;
b0 = Math.asin(Math.sin(diff)*Math.sin(i/radeg));
double ta = (mna +c) % 360;
double dist = 1.0000002 *(1.0 - Math.pow(e,2))/(1.0 +e*Math.cos(ta/radeg));
sun_radius = 959.63/dist;
|
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
sun_data |
|
dateTime
|
b0
sun_radius
position_angle
|
Outputs (3)
Name |
Description |
b0 |
b0 - heliogrpahic latitude of the centre of the disk
b0 - heliogrpahic latitude of the centre of the disk
in radians
|
sun_radius |
the apprent radius of the Sun in arcsec
|
position_angle |
postion angle of the north end of the axis of rotation, measured +ve if east of the north point of the disk
|
Datalinks (4)
Source |
Sink |
sun_data_dateTime |
sun_data:dateTime |
sun_data:b0 |
b0 |
sun_data:sun_radius |
sun_radius |
sun_data:position_angle |
position_angle |
Uploader
License
All versions of this Workflow are
licensed under:
Version 2 (latest)
(of 2)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment