Planetary Fluxes
Incoming visible and IR fluxes contributed by nearby bodies can be specified, for example Mars shine on Phobos, or Jupiter shine on Europa. Set:
PFlux = "T" Lon_Hr = [0-24]
KRC generate can describe planetary fluxes by sin functions
printf("\nKRC supports Eclipses but requires the following parameters\n")
printf("PFlux = forces a planetary flux on a orbiting body (Default = \"F\") \n")
printf(" Needs the following Parameters (Default Provided for common bodies)\n") printf(" BT_Avg : Average Brightness Temperature [K] \n") printf(" BT_Min : Min Brightness Temperature, if diurnal cycle [K] \n") printf(" BT_Max : Max Brightness Temperature [K] \n") printf(" Dis_AU : Distance form Sun in AU \n") printf(" Geom_alb : Geometric Albedo [1]\n") printf(" Mut_Period : Mutual Period [?]\n") printf(" Orb_Radius : Orbiting Radius [km] \n") printf(" Radius : Radius of the Obiting body [km] \n") printf(" Lon_Hr : Longitude Hour of the surface point \n")
printf(" OR: \n")
printf(" IR : A 2 x n x 1 array with IR flux (1st col.) vs. LTST (2nd col.) \n") printf(" Vis : A 2 x n x 1 array with Vis flux (1st col.) vs. LTST (2nd col.) \n")
define krc_planetary_flux_porb(porb,porb_Planet,Lon_Hr){
if($ARGC == 0){
printf (" Generates the change card for planetary heat loads in KRC \n") printf (" $1: porb for the satellite \n") printf (" $2: porb for the main body (planet) \n") printf (" $3: Lon_Hr, Longitude Hour of the surface point \n")
}
pi = 3.14159
#porb=load("/Applications/davinci.app/Contents/Resources/library/script_files/krc_support/porb_defaults/Mars_Phobos.porb.hdf")
#porb_Planet=load("/Applications/davinci.app/Contents/Resources/library/script_files/krc_support/porb_defaults/Mars_Mars.porb.hdf")
porb = $1 porb_Planet = $2 Data_Plan = porb_Planet.planet_flux #Gets satellites data Data_Sat = porb.planet_flux #Gets planet data Lon_Hr = $3 #Longitude Hour
Radiance = 5.56E-8 * float(Data_Plan.BT_Avg)^4 #Calculates Average Radiance from Planet Min_Rad = 5.56E-8 * float(Data_Plan.BT_Min)^4 #Calculates the Min Radiance from Planet Max_Rad = 5.56E-8 * float(Data_Plan.BT_Max)^4 #Calculates the Max Radiance from Planet Delta_Radiance = 5.56E-8 * (float(Data_Plan.BT_Max)^4 - float(Data_Plan.BT_Min^4)) #Calculates Max - Min Radiance form Planet Plan_Ang_Surf = pi*((360./pi)*atan(Data_Plan.Radius/(2*Data_Sat.Orb_Radius)))^2/3282.80635#Angular Surface of Planet IR_Flux = Radiance * Plan_Ang_Surf/pi #IR Flux from Planet on Satellite IR_Half_Amp = (Radiance - Min_Rad ) * Plan_Ang_Surf * 0.5 / pi #1/2 Amplitude IR_Phase_Lag = 0. #Will need to Look at that for Eclipses Vis_Flux_Peak = Data_Plan.Geom_alb * 1361./(Data_Plan.Dis_AU^2) * Plan_Ang_Surf #Peak Visible Flux from Planet Vis_Flux = 0.5 * Vis_Flux_Peak #Average Visible Flux from the planet Vis_Half_Amp = Vis_Flux #Most often 0. Vis_Phase_Lag = 0. #Will need to Look at that for Eclipses
line = sprintf("15 %.2f %.2f %.2f %.2f %.2f %.2f %.2f / Forcing from Planet on Satellite",IR_Flux,IR_Half_Amp,IR_Phase_Lag,Vis_Flux,Vis_Half_Amp,Vis_Phase_Lag,Lon_Hr) return(line) }
define krc_planetary_flux_table(IR,Vis,Lon_Hr){
- 05/17/2018: Fixes issue with average fluxes definition (HHK email of 05/07/2018)
if($ARGC == 0){
printf (" Generates the change card for planetary heat loads in KRC \n") printf (" $1: IR array vs LTST (2xnx1)\n") printf (" $2: Vis array vs LTST (2xnx1)\n") printf (" $3: Lon_Hr, Longitude Hour of the surface point \n")
}
pi = 3.14159 IR_1 = $1 IR = IR_1[1,,1] #IR array, y axis LTST_IR = IR_1[2,,1] #LTST for the IR array, y axis Vis_1 = $2 Vis = Vis_1[1,,1] #Vis array, y axis LTST_Vis = Vis_1[2,,1] #LTST for the Vis array, y axis Lon_Hr = $3 #Longitude Hour
Peak_IR = maxpos(IR,showval=1) Min_IR = minpos(IR,showval=1) LTST_IR_Peak = LTST_IR[1,int(Peak_IR[2,1,1]),1] #int(Peak_IR[2,1,1]) is the index Half_Amp_IR = 0.5*(Peak_IR[4]-Min_IR[4]) Phase_IR = 360.*LTST_IR_Peak/24. #in degree IR_KRC = Min_IR[4] + Half_Amp_IR * (1 + cosd(360.*LTST_IR/24. - Phase_IR)) #labelxy("LTST","Flux") #plot(IR,"IR",Xaxis=LTST_IR,IR_KRC)
Peak_Vis = maxpos(Vis,showval=1)
Min_Vis = minpos(Vis,showval=1)
LTST_Vis_Peak = LTST_Vis[1,int(Peak_Vis[2,1,1]),1] #int(Peak_IR[2,1,1]) is the index
Half_Amp_Vis = 0.5*(Peak_Vis[4]-Min_Vis[4])
Phase_Vis = 360.*LTST_Vis_Peak/24. #in degree
Vis_KRC = Min_Vis[4] + Half_Amp_Vis * (1 + cosd(360.*LTST_Vis/24. - Phase_Vis))
#plot(Vis,"Vis",Xaxis=LTST_Vis,Vis_KRC)
Vis_Flux = Min_Vis[4] + Half_Amp_Vis #Average solar Flux Vis_Half_Amp = Half_Amp_Vis #Visible Half Amplitude Vis_Phase_Lag = Phase_Vis #Vis Phase Lag in degrees IR_Flux = Min_IR[4] + Half_Amp_IR #Average Thermal Emission IR_Half_Amp = Half_Amp_IR #IR Half Amplitude IR_Phase_Lag = Phase_IR #IR Phase Lag in degrees
line = sprintf("15 %.2f %.2f %.2f %.2f %.2f %.2f %.2f / Forcing from Planet on Satellite",IR_Flux,IR_Half_Amp,IR_Phase_Lag,Vis_Flux,Vis_Half_Amp,Vis_Phase_Lag,Lon_Hr) #IR, then Vis return(line) }