with open(fname,'w') as f:
        f.write('# Start: {1}, dt: {0} s, Intensities in J/(dt*m**2)\n'.format(dt.seconds,start.isoformat()))
        np.savetxt(f, data.T)
        
# location setup
mspicer = MarsSpicer()
mspicer.set_spoint_by(lat=85,lon=0)

# timing setup
mspicer.goto_ls_0()
mspicer.time -= dt.timedelta(days=10,hours=12)

# dt, the time step
my_dt = dt.timedelta(hours=1)

# saving for restart later
start_time = mspicer.time
    
out_flat = create_arrays(mspicer, 50, my_dt)
save_data_to_file(out_flat[1], 'insolation_flat.txt', start_time, my_dt)

mspicer.get_tilted_normal(30)
mspicer.rotate_tnormal(180)

mspicer.time = start_time
out_ta = create_trnormal_arrays(mspicer, 50, my_dt)
save_data_to_file(out_ta[1], 'insolation_t30_a180.txt', start_time, my_dt)

# print(np.divide(out_ta[1],out_flat[1]))
# semilogy(np.divide(out_ta[1],out_flat[1]),'-*')
# show()
Example #2
0
# container for all energy arrays
energies = []

# labels for the plotting
labels = []

aspects = np.arange(0,180,5)
tilts = [5,30]
img = np.zeros((len(aspects), 36, 2))

for i,tilt in enumerate(tilts):
    mspice.get_tilted_normal(tilt)
    for j,aspect in enumerate(aspects):
        mspice.time = start_time
        print('aspect = {0}'.format(aspect))
        mspice.rotate_tnormal(aspect+15) # go to middle of aspect block
        bigtimes, energy = outer_loop(mspice, end_ls, ls_res, 'trnormal')
        energies.append(energy)
        labels.append('t'+str(tilt)+'_a'+str(aspect))
        img[j,:,i] = energy


img[ img < 1 ] = np.nan
img5 = img[:,:,0]
img30 = img[:,:,1]
images = [img5,img30]
palette = cm.jet
palette.set_bad('gray')
fig, axes = subplots(2,1,sharex=True, sharey=True)
ext = [0,360,0,180]
max = np.nanmax(img5)