Skip to content
Snippets Groups Projects
Commit 4e3758f8 authored by Roberto Susino's avatar Roberto Susino
Browse files

Code optimizations

parent 5efe1b38
Branches
Tags
No related merge requests found
......@@ -2,7 +2,7 @@ function metis_dark_uvda, data, header, cal_pack, history = history
dark = cal_pack.uv_channel.dark
dit = header.dit/1000.d0
dit = header.dit/1000.D0
ndit1 = header.ndit1
ndit2 = header.ndit2
nbin = sqrt(header.nbin)
......
......@@ -4,14 +4,14 @@ function metis_dark_vlda, data, header, cal_pack, history = history
dark = cal_pack.vl_channel.dark
bias_dark = cal_pack.vl_channel.bias_dark
dit = header.dit
dit = header.dit/1000.D0
ndit = header.ndit
nbin = sqrt(header.nbin)
tsensor = header.tsensor
obt_beg = header.obt_beg/1000d0
obt_beg = header.obt_beg/1000.D0
for i = 0, n_elements(bias_dark) - 1 do begin
if bias_dark[i].dit eq dit/1000. and bias_dark[i].nbin eq nbin and abs(bias_dark[i].tsensor - tsensor) lt 5 then begin
if bias_dark[i].dit eq dit and bias_dark[i].nbin eq nbin and abs(bias_dark[i].tsensor - tsensor) lt 5 then begin
dark_image = float(readfits(cal_pack.path + bias_dark[i].file_name, /silent))
dark_file = bias_dark[i].file_name
......
......@@ -4,5 +4,6 @@ function metis_rectify, image, filter
image = reverse(image, 1)
image = rotate(image, 1)
endif
return, image
end
......@@ -4,7 +4,7 @@ function solo_get_carrot, utc
jul_day = date_conv(utc, 'julian')
carr = (jul_day - 2398167.d0) / 27.2753d0 + 1
carr = (jul_day - 2398167.D0)/27.2753D0 + 1
; convert the requested date into ephemeris time
......@@ -21,7 +21,7 @@ function solo_get_carrot, utc
; calculate the fractional part of the decimal rotation number
if he_lon lt 0. then he_lon = he_lon + 2. * !dpi
frac = 1.d0 - he_lon / (2. * !dpi)
frac = 1.D0 - he_lon/(2. * !dpi)
n_carr = round(carr - frac)
carr = n_carr + frac
......
......@@ -31,8 +31,8 @@ function solo_get_coords, utc, frame, obs, velocity = velocity, spherical = sphe
cspice_reclat, coord, solo_dist, solo_lon, solo_lat
if frame eq 'IAU_SUN' then solo_lon = (solo_lon + 2. * !dpi) mod (2. * !dpi)
if keyword_set(degrees) then begin
solo_lat = solo_lat * 180.d0 / !dpi
solo_lon = solo_lon * 180.d0 / !dpi
solo_lat = solo_lat * 180.D0/!dpi
solo_lon = solo_lon * 180.D0/!dpi
endif
coord = [solo_dist, solo_lon, solo_lat]
endif
......
......@@ -11,7 +11,7 @@ function solo_get_solar_angles, utc
coord = state[0 : 2]
rad = coord/sqrt(total(coord^2, 1))
cel_north = [0., 0., 1.d0]
cel_north = [0., 0., 1.D0]
sun_proj = sun_north - total(rad * sun_north) * rad
sun_proj = sun_proj/sqrt(total(sun_proj^2))
......@@ -25,7 +25,7 @@ function solo_get_solar_angles, utc
x_proj = total(sun_proj * cel_proj)
y_proj = total(sun_proj * vec_proj)
p0 = atan(y_proj, x_proj) * 180.d0 / !dpi
p0 = atan(y_proj, x_proj) * 180.D0/!dpi
cspice_pxform, 'IAU_SUN', 'ECLIPJ2000', et, rot
sun_north = rot[2, *]
......@@ -48,14 +48,14 @@ function solo_get_solar_angles, utc
x_proj = total(sun_proj * ecl_proj)
y_proj = total(sun_proj * vec_proj)
ep = atan(y_proj, x_proj) * 180.d0 / !dpi
ep = atan(y_proj, x_proj) * 180.D0/!dpi
cspice_spkezr, 'SUN', et, 'IAU_SUN', 'NONE', 'SOLO', state, ltime
coord = state[0 : 2]
cspice_reclat, coord, dist, lon, lat
b0 = -lat * 180.d0 / !dpi
b0 = -lat * 180.D0/!dpi
return, [b0, p0, ep]
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment