General interest IDL routines

 
S. Erard, LESIA,   30 / 5 / 2024

 
 
 

 

 

1- Planetary cartography

 The current version normally runs under IDL 5.6 and up. It can run directly with IDL from v5.1 (in particular 5.5 which is the last Mac OS 9 version), but ellipsoid computations are limited in this case (with no effect on normal use).
Routines have been tested on X, Mac, and PS devices. See file mapl_set.doc for details.

conv_long.pro
Converts longitudes between terrestrial and planetary conventions.
Now converts between 3 conventions:
From terrestrial (-180° to 180° eastward) to IAU 2000 (0° to 360° eastward) with /TO_PL keyword (Default).
Converse with /TO_TER keyword.
From or to older planetary system (0° to 360° westward) with /WEST keyword.
 
platlon.pro
Reads latitudes and longitudes from a map plotted with map_set or mapl_set. Returns longitudes according to planetary convention (W longitudes on option). Records position in file "map.asc" on option.
 
prep_map.pro
Optimizes the arguments of map_set so as to get correct grid and contours when plotting limited areas. The output arguments are then used in calls to map_set. May also be useful with Mapl_set when using sinusoidal projections.
 
mapl_set.pro
A mapping routine adapted to planetary surfaces. Follows planetary convention for longitudes (IAU 2000 default, west longitudes on option), optionally adds topographic contours for Mars (MOLA or Viking, either low or high resolution), Venus (Magellan GTDR, low or high resolution) and the Moon (low resolution Clementine), optimizes arguments for consistency.
Internal coordinate system is still IDL default: terrestrial, with longitudes ranging from –180° to 180° eastward.
Beware that ellipsoid values are still related to the Earth (available only with Transverse Mercator and Lambert's conical, not very useful…).
Problem may occur with sinusoidal projection (grid is discontinuous around 180°). A previous call to prep_map.pro is sometimes useful to optimize limits in this case.
The tags .a and .e2 of structure !map are not set when using IDL < 5.6, to maintain compatibility (not defined in older versions). This should have no incidence for the user (they are not used directly by the routines, and are relevant only to special projections).
To do:
- Add ctext keyword and transmit to mapl_grid to unclip labels (do not use clip-* kw name, can conflict with clip).
- Add ellipsoid handling at least for orthographic projection (to scale lont/lat frame on telescopic images).
- Change Mars and Moon isolines to regular spacing?


mapl_continents.pro
Routines called by mapl_set.pro to overplot topographic contours on Mars, Venus, and the Moon.
To do:
- Check compatibility with map_proj_forward in details (for version &Mac179; 6.1).
 
mapl_grid.pro
Routines used by mapl_set.pro to plot lat/long grid and labels in planetary convention.
To do:
- Allow labels plotting outside the map if longitude range is 360°.

 
map_proj_forward.pro
A dummy function to allow compilation under IDL 5.5 (last Mac OS 9 version). It must be removed from the library when using a more recent version of IDL.
 
diskmap.pro
Overplots global planetary map on a disk with given orientation. Adds terminator and shades night side.

mapl_fill.pro
Superimposes spatially extended data on a map, given pixel corners coordinates and array of data to be plotted. Calls mapl_set or overplots on a previous map; may plot a single pixel. Multi-usage routine, but a very simple one (no image, no color handling…), to be integrated in a workflow [see example in essais_map.jou]. Mostly used with Rosetta.

tvmap.pro
Superimposes a map grid to an image, using planetary conventions (Mapl_Set). Handles PS versus screen outputs. Handles color images on 24-bits devices (BIP only).
To do:
- Accept any interleave mode for true color images, detect automatically.
- Accept map dimension coefficient/location vector in screen coordinates.
- Call Map_Set on option?
Sets PS/screen + dimensions… 
om_moc.pro
v_map.pro
Wrappers to TVMAP, superimpose OMEGA or VIRTIS to a map grid + a MOC, TES or MDIM image (Mars) or GTDR image (Venus). See OMEGA/VIRTIS routines below.
Moc_mos.pro
MDim_mos.pro
TES_mos.pro
Mag_mos.pro
Mar_mos.pro
Routines to load a part of reference map for future plotting:
Moc, MDIM and TES for Mars
Mag for Venus/Magellan
Mar for Mercury/Mariner10
Request limits and desired resolution in some cases.
Should be named after target?

2- PDS files / VIRTIS data access

See file Virtispds.doc for details.

This library is intended to read a variety of PDS data files. Developped for VIRTIS (Rosetta & VEx) data files (images and cubes), also handles VIMS and OMEGA data and simulation files, plus PDS spectral library (CRISM published version), ISM (non-standard PDS cubes), AMIE, and most image formats. Runs under Unix (including Alpha machines), MacOS, VMS, and Windows. Optimized for IDL >= 5.6 and GDL >= 0.9. Originally adapted from SBNIDL 2.0 (PDS Small Bodies Node's set of all-purpose IDL routines) and ASTRON (NASA Astonomy library), with many modifications.

The routines are distributed as an opensource library. Specific and modified routines include the following:
 

virtispds.pro

Front-end interface to read Virtis PDS files, including calibrated files and geometry files. Calls v_readpds and always returns data qubes / images plus label and suffices in structures. tirtispds.pro is a version adapted to older files (pre-ground calibration).

v_readpds.pro

Front-end interface to read PDS files. Returns data objects in arrays or structures; qubes suffixes are returned by keyword. Currently supports combinations of Qubes, Images, and Table objects. Handles all PDS data types, converts to machine architecture (Vax, PC, or IEEE floats, MSB or LSB integers), and performs rapid scaling of data.

v_imagepds.pro

Reads image objects in PDS files.

v_qubepds.pro

Reads qube objects in PDS files. Returns suffix by keyword. Band and sample suffixes (or both) are allowed. Also reads unusual/non-standard qube formats (ISM and VIMS flight data, and files containing only either a qube or a suffix).

v_atabpds.pro
v_btabpds.pro

Read table objects in PDS files, either ascii or binary formats.

v_headpds.pro

Returns PDS label in a string array. Minimal label consistency check, can read labels longer than 32767 characters.

v_pdspar.pro

Returns the value associated to a PDS keyword. Handles namespaces.

v_listpds.pro

Interprets a list of value as defined in the PDS standard (ie., '(n1, n2, n3,...)' ). Return an array of values with count in keyword.

v_typepds.pro

Returns the IDL type code of a variable + encoding type from PDS values (such as CORE_ITEM_TYPE + CORE_ITEM_BYTES). Encoding type include integer/float storage (MSB vs LSB), floating point encoding (VAX, IEEE), signed vs unsigned integer, real vs complex type.

v_pointpds.pro

Returns pointer to data objects in a PDS file.

v_objpds.pro

Returns object definitions in a PDS label.

v_getpath.pro

Returns file and directory name from a complete path string, works under IDL &Mac179; 5.4 (intrinsic functions exist under IDL 6.0 and up).

v_str2num.pro

Return the numerical value of s string. Use most economical variable type required (but never returns bytes).

v_msbtohost.pro

Convert all types of integers from MSB encoding if needed (ie., on LSB machines only).

v_swapdata.pro

Convert variable from MSB (or LSB on option) to machine architecture. Optionally forces swapping. Replaces v_msbtohost and v_conv_vax_unix: uses recent IDL routines, support all platforms and all data types (including floats and complexes) and structures, saves memory.

v_vaxtoieee.pro

Convert floats from VAX to IEEE encoding (+ LSB integers to machine architecture on option). Replaces v_conv_vax_unix, uses recent IDL conversion routines.

v_bmask.pro

Apply bitmask to data (now handles all types).

v_eolpds.pro

Manage End Of Line markers in label strings: replaces LF only-markers (provided by v_headpds.pro) by standard CR-LF markers, or vice-versa. Skip them for a clean print on Unix systems.

v_time.pro

Convert time info between ISO strings and vectorial variables (Y, M, D, h, m, s.f in this order). Also compute time from start time and offset in seconds.

v_scet.pro

Compute SCET (# of s since S/C clock resync) as a double precision float from 3-words format (in TM paquets and Qube sideplane). If only one argument is provided, restores SCET in 3-words format from double precision float

v_scet2ut.pro

Estimate UTC corresponding to a SCET in the frame of given session (uses START_TIME and S/C_CLOCK_START_COUNT for synchronization). Accuracy is better than 1 s.

 

2b- VIRTIS calibration & utilities

See file VirtispdsExtended.doc for complete list and details.

This library includes additional routines specific to Virtis pipeline and quicklook analysis. There are distributed only in the PI team or in Meudon

v_convlabel.pro

Writes a PDS file from original label and formatted data. Uses external label templates to update Virtis labels, write Virtis calibrated files, or write isolated H spectrum in ascii.

v_convlabel2.pro

Identical, except that it handles the new M-calibrated data format (one cube + bottomplane). Now implemented in v_convlabel (after the new M-calibrated format was accepted by the PSA).

v_convlabelAC.pro

Specific version to be run on EGSE output (Rome VEx pipeline).

v_geolabel.pro

Writes a Virtis PDS geometric file + update data labels with geometric values. From original data + label, and computed geometry + catalogue info. Uses label external templates (as of Sept 2008, this is the only version up to date). 

v_modifile.pro

Try at changing only one value in Virtis file header. Not finalized.

v_pdsvalues.pro

Alternative to v_pdspar: returns a complete list of keywords and values present in a PDS label, for further analysis. Convert values if first char is a number, but preserves times/dates.

v_calMRos.pro

Calibrates a Rosetta M-IR file: interpolate dark, divides by flat/exp time, odd/even correction on option. Hand-made in Meudon, for when Rome calibration is not available.

v_calibM.pro

Calibrates an M file (after despiking): divides by flat + Fourier filtering. Derived from early envi routines. Probably obsolete.

v_litM.pro

Still higher level interface to read Virtis-M raw: eliminates darks from the cube, optionally returns them in a separate array, and/or corrects for interpolated dark + compute spectral calibration. Intended to work with neat raw data when calibrated files are not available: only the first steps in M calibration pipe-line are implemented. Fast dark frame interpolation (different from M envi routines). See v_calMRos for complete procedure.

v_lisseM.pro

Fast odd/even correction for M. Identical to Gianrico's routine for Rosetta: this is spectral smoothing which degrades resolution and broadens glitches, therefore not a favorite kind of processing. To be applied after dark interpolation, ideally after despiking.

Hspec.pro

Extract an H raw spectrum from a backup mode frame, based on pipeline routines (VEx + Rosetta). Uses 2014 coefmap for Rosetta and correct windowing.
Can be chained with Sophie's routines to handle dark current (calibros_interpdkbkp, see below + routine header). 

calibros_interpdkbkp.pro / calibros_interpdknom.pro

Subtract interopolated dark from an H cube in backup & nominal mode (Rosetta only?). Sophie's July 2014 pipeline routines - beware that they were modified later, so these versions are rather different from the final ones.
Slightly modified to only add the original dark to H raw data, for signal studies (option /nodark), plus dark despiking.
First one to be used before Hspec.

v_litH_otarie.pro

Reads a (calibrated ?) H file as provided by Otarie. Puts it in order and scales radiance properly (same order as in Virtis cubes). - old

v_checklt.pro

Check local time in VIRTIS VEx geometry files. Intended to track an issue with SPICE update in version N61

v_fpath.pro

Returns expected filepath given file and session names (as in Otarie db outputs)

v_getspec.pro

Returns a table of selected spectra from several sessions/cubes, typically from a query on Otarie db


v_smile.pro

Attempt to correct H cube from pointing discrepancies between gratings, according to smile-like effect - adapted from Jean-Philippe Combe routine (resynch from correlation between channel signals along Z, assuming constant offset). Includes several regularizations, in particular sigmoid fit of channel offsets.

v_smile_hf.pro

Wrapper to v_smile for very dense observations: first undersamples the cube along Z.


v_regx.pro

Generic routine to compute offsets between the 2 H gratings, based on computed geometry. Assumes gratings are offset along X direction, seems OK.

v_regy.pro

Alternative routine to compute offsets between the 2 H gratings, based on computed geometry - this one assume gratings are offset along the Y direction, does not seem OK.


v_plotH.pro

Convenient plotting of H spectra, with clean separatation of orders. The spectrum is either extracted from a cube, or provided individually. Accepts external wavelength vector (e.g. for calibrated data). Default is for VEx, Rosetta wavelengths on option (think of it!).

KEYWORDS:
; ROSETTA: Use Rosetta wavelengths (default is VEx)
; ORDER: Plots a single order (0 = long wavelengths to 7 = short wavelengths)
; WAVE: External wavelength table, 8x432 array ordered accordingly (to be used with calibrated files)
; COEF_REF: Coefficient to be applied to reflectance (level) vector
; OVER: superposes to current plot if set
; SMOOTH: Smooth using wavelet filtering (a trous algo at scale 3 - change Nscale in code but this is a good choice)
;     Smoothing scale can be modified by changing Nscale in code, but this is a good choice
;     Nscale = 2 or 3 filters out mostly odd/even effects (to be checked in detail)
;     Smoothing performed after channel parity selection
; COLOR: Forces constant color index for all orders (for use with /over)
; PARITY: if not 0, plot only odd or even channels
; NODATA: Explicitely inhibits data plotting
; SILENT = suppresses messsages
; CUT: Filters channels known to be affected by stray light (tentative limits) - old scheme, related to previous calibration
; MERGE: Removes duplicate channels with lower resolution or known stray light - new scheme, for use with Lutetia calibration
;        MERGE = 1: favors low order parts; MERGE = 2: adapted
;        Has priority over CUT
; GRATING: Plots only shot or long wvl of each order
;        GRATING = 1: short wvl order parts; GRATING = 2: long wvl order parts
;        Has priority over CUT   


v_lamH.pro

Returns H wavelengths and FWHM in correct order (default is for VEx, + Rosetta on keyword). Now reads data from "official" calibrated file table (FITS file with extensions).

v_plotscet.pro

Compares times from two geometry files, M and H. Suports M/H, VEx/Rosetta.

v_checktime.pro

Compares stop and start times and first/last sideplane SCETs in UTC — check integrity of time information.

v_disk.pro

Identifies pixels on target, vs pixels on sky or limb. Starts from geometry cube, returns both a mask and a pixel list. Works for M/H, VEx/Rosetta.
Option /FILTER removes elongated pixels (on first order) for Rosetta, M & H (early option /NOBAD is deprecated).

v_contour2.pro

Returns footprint as an STC-S string (s_region, for EPN-TAP services). Works for M VEx/Rosetta, but Rosetta contours are usually weird. Returns an empty string if session is entirely on the sky.

v_despike.pro

Median despiking for M files (clean sigma-cliping of each frame). Accelerated from early envi routines (not the final scheme from Rome, though).
This is also a sigma-cliping routine for a pile of images, but in the spatial dimension only.

v_despikeh.pro

Similar for H files only (uses local mean without central point, in spectral dim only), process orders separately — now adapted to Rosetta.
Default is to use optimized noise estimate, but external estimate can be provided (filtering is less efficient when noise is higher). Extensive /PLOT mode for checks.
Should work for calibrated and raw cubes & spectra.

v_despikeh0.pro

Older version for H calibrated cubes only, obsolete.

v_sigmaclip.pro

Versatile despiking routine for VIRTIS. Performs various types of sigma-clipping, according to Process keyword:
0— 3D (for M);
1— spectral direction only (H and M cubes); v_despikeh may actually be better for H
4— in time/space dimension only (in particular for H dark despiking).

despiker.pro

More general routine to despike any vector (close to v_sigmaclip and actual sigma clipping).
Can be used to process H orders and odd / even channels separately.

v_envi.pro
virtisstart.pro

Two scripts intended to launch the Envi interface for Virtis VEx M calibration (compiles routines in correct order).
v_envi is OK for envi classic interface on Pandora4 (default to Rosetta folder), virtistart is on older version.
Go with the envi.men file to be located in the correct folder.

v_readenvi.pro

Function to read envi files under IDL from envi header only. Should work with all virtis files (at least), Rosetta +VEx. Intended as a versatile envi/IDL input routine.

v_ext.pro

Extract Virtis spectrum with mouse from an image plotted with Tranche.pro (or directly with tvscl images). See om_ext.


CALIBRATION_ROUTINES_M

This directory contains calibrations routines for VEx M-IR channel. These routines must be ran from Envi (from Giuseppe & Alex - copied from Rome, check for updates).

IASF-ROMA

This directory contains general routines to monitor the VEx data set for the M channel + routines to handle Virtis VEx files from Envi (from Giuseppe & Alex - copied from Rome, check for updates). Latter adapted for Rosetta and H channel support.

GEOVIRTIS

Geometry computation for Virtis VEx, M and H. Maintained on Otarie CVS.

GEOROS

Geometry computation for Virtis Rosetta, M and H. Maintained on Otarie CVS.

IDL_Pro

Forence's routines for Otarie interface (in VEx directory).

2c- Routines for VIRTIS-H virtual instrument

The final / active version is the instrument simulator by Sophie Jacquinod (see SIMU_VIRTIS_V4). Look for doc / examples

v_readsimu.pro

Reads simulator outputs + plot them.


The following routines are from pre-launch simulators. The Otarie simulator used different routines. All this is obsolete.

vv_writepds.pro
simul2_lab.pro
prep_lab.pro

Writes a PDS file with label for VIRTIS-H simulated cubes. The other 2 are data preparation routines.
To do:
- Update vv_writepds using system in v_convlabel + external template.

simuh.pro

Signal simulator for VIRTIS-H (adapted from D. Tiphène's routine).

InstrumentVirtuel

Folder containing JM Reess' orginal simulator routines (in Rosetta directory). The routines implemented on Otarie are derived from those.

2d- VIRTIS data analysis

The following routines are used in Virtis signal analysis. See file VirtispdsExtended.doc for details.

v_convolH.pro

Convoles any spectrum to H resolution and returns result in same order as cubes. Accepts external wavelength vector for calibrated data. TBC, this is much older than the next routines.

v_convolH2.pro

Similar, but calls Jean-Michel's convolution routine [convol_vh_psf_optimize]. 

v_convolH3.pro

Same as v_convolH2 but calls precomputed files, much faster. This is the standard couvolution routine for H. 

v_soleilH.pro

Returns solar flux at 1 au convolved with H spectral response, in same order as Virtis cubes. Now handles external wavelength vector.

v_mergeH.pro

First merge all H orders to a monotonous wavelength vector (to be optimized).
TO DO: Then convolve to M wavelengths.

v_atmH.pro

Return terrrestrial atmosphere transmission convolved with H spectral response (VEx only so far), in same order as Virtis cubes. Intended to check H calibration (possible remants of atm in transfer function).

v_coratm.pro

(Function) Corrects Virtis M-IR Rosetta/Mars cube or spectrum from atm. absorption.

v_optlam.pro

Estimates optimal wavelength shift for VEx M-IR calibrated file on Venus night side.

v_ica.pro

Interface to perform ICA on Virtis-M cubes. Uses either fastICA or Jade, both from the MRS library. Optionnaly performs analysis in image dimension (default is in spectral dimension).

v_acp.pro

Interface to perform PCA on Virtis-M cubes (Venus nightside) — Should work with any data. Uses PComp with proper scaling and plots results in same form as ICA. TO DO :
- Writes a result file.
- Include optional input from file.
- Check print option (add data file name)

v_ica_anal.pro

Interface to perform ICA on Virtis-M cubes (Venus nightside). Uses se_jade by default, adapted from the MRS library, or optionally fastICA. Default is to analyize in image dimension. Writes a result file.

se_jade.pro

Performs ICA according to Jade algorithm. Slightly modified version of Jade from MRS_v1.0 package.

o_ica_anal.pro

Same one, more versatile. Originally adapted for Osiris images, works also with M-IR of Steins from Rosetta.

v_ica_plot.pro

Plots components and coefficients from v_ica_anal. Optionally writes a PS and a PNG file. Second argument is the number of components to plot.

v_ica_rec.pro

Tentative reconstruction from first ICA components. — To be checked.

v_class.pro

Classification on selected components from an ICA. To be adjusted for a particular file.

v_pixmh.pro

Returns list of M pixels covered by an H pixel, given 2 geometry cubes. Plot on option. Assumes Euclidian geoemtry, may be wrong near the poles or at low resolution. Status to be checked on output.
         TO DO: add weighting of border pixels according to surface overlap?

v_convolmh.pro

Convolves an H spectrum to M wavelengths. Returns a H-formatted spectrum with levels integrated in separate orders/ Wavelengths are still H, level is convolved at M resolution (16 nm).

v_registH.pro
v_registHplot.pro

Optimizes spectral registration for H, by using control points from a reference spectrum. The first routine allows the selection of control points and writes an ascii file; the second one reads this file and does the computation (can be called with a modified file). To be used for each order independently. — no longer usefull for Rosetta.

v_map.pro

Maps a Virtis VEx parameter image (spectral ratio or anything…) over the GTDR maps, possibly with transparency. Optionally plot angles or GTDR topography from geometric cube.
Uses procedure MAG_MOS to select a part of the topographic map from quadrangle files. With PS device, images with transparency are displayed on a black background.
Allows filtering of out of bound values (or plot in B/W)
PS is handled either through PS keyword or through pson/psoff or psstart/psstop routines.
To do:
• implement other reference maps (only low res from radio science so far)
• implement various projection types (required from reference data)
• Fix projections. Currenlty ~OK in polar (issue with limit ?) + cyliindrical mode
• concatenate several quadrangles when needed in MAG_MOS routines.
• uses low resolution on large areas
• Put name of file in name of window?
• Fix color scale location on small images
KEYWORDS:
LIMIT: lat/long limits of the plot area (background image),
in E longitude convention. Should be systematically provided with
the image (use limits from cube if not set).
ROT: Provide Rotation & center long/lat for non equatorial maps
TAILLE: define size of plot area if background image is not provided.
RES: mosaic resolution (onlt option is 1 so far)
TRANS: set the level of transparency in superposition (80-120 usually)
DISK: Only plots pixel on disk (filters out of bound altitudes)
Ncol: set the number of colors for OMEGA (default is 16, should be <!D.table_size - 16)
PARAM: plot quantities from geometric cube (incid|emerg|phase|s/cdist|topo)
NOCUBE: If set, do not plot spectral data (produce simple image plot with grid)
GAP: use exact coordinates from geometric cube (default is to get adjacent pixels)
CLOUD_LAYER: uses coordinates on cloud layer (default is to use coordinates at the surface)
HELP: return syntatic help
VRANGE: optionally provides value range ([min, max]) - also plot out of range values in B/W
FILTER: does not plot out pixels with out of range values
+ all keywords to Mapl_set, except map projections

v_mapover.pro

Overplots a Virtis spectral parameters image on a previously plotted map projection.  

v_mapall.pro
v_mapall_1.pro

Automated Virtis mapping, two different solutions. Upper layer onto v_map. Not finalized?


v_hsum.pro

Utility to compute mean spectrum from an H session + returns spectral sigma. Plot with /graph, plus /smooth, /cut and order (display only).
Option /all processes a complete STP (result is a structure) to get an average STP spectrum easily.
Filtering:
/sky retains only low level spectra (can be in shadowed areas, though).
/low retains very low levels (better for coma)
/nucleus retains only relatively high levels (opposite of SKY)

v_hvisu.pro

Utility to overplot in sequence all spectra from an H session. Use with /smooth, /cut and order
Shows signal variations dynamically.


v_co2hfile.pro

Main interface to compute CO2 band integral from a H calibrated cube (Rosetta). H is computed in orders 0 and 1. A FITS file is written with the results (3 vectors). [ Beware that smoothing is applied prior to call v_co2h ]

v_co2mfile.pro

Idem for M calibrated cube (Rosetta). A FITS file is written with the results (2 images). [ Direct call to v_co2m, results are identical ]

v_co2m.pro
v_co2h.pro

Returns CO2 band integral and column density for all spectra in a M-IR or H calibrated cube (Rosetta).
(prefer *file.pro routines, because they write a file with the results - computation is ~5 min on Mac)

co2emis.pro
co2emis2.pro
Lowest-level routine: compute CO2 band integral from a single M-IR or H calibrated spectrum (Rosetta). H can be computed in orders 0 and 1.
To be used directly for a single spectrum, including an averaged one.
The second routine uses a straight continuum (better with H early calibration), the first one is better but may be more sensitive to noise.
Option /plot to check continuum correction and compare with modeled CO2.

v_co2hsum.pro

Sum all H CO2 measurements in a session and to return mean and sigma + plots. Either launch v_co2hfile or plots its fits output, depending on file extension. Usefull only in low colum density situations.

v_slewh.jou

Plots a VIRTIS-H slew on the sky (CO2 as a function of RA/Dec).

v_mapcrit

Map a computed spectral parameter in an array, supports masking.

2e- VIRTIS Rosetta data monitoring

v_mapphase.pro
Regenerates plots, maps and index for a complete phase (PRE-LANDING or ESCORT), calls v_curve, v_geo, v_dark, v_temp, v_map + v_catfile for all MTP/STP and copy them to Mac and Otarie (when new calibration or geometry becomes available).
To be called from Meudon only (to get copies on Mac), previous indexes must first be renammed on Mac.
Use option / nocopy to run outside Meudon.
v_phasecopy.pro
Copy existing plots and maps from lesia08 to Mac and Otarie.
To be called from Mac after v_mapphase, /nocopy.
v_curvestp.pro
Plots reflected/emitted radiance and long/lat for a complete Rosetta STP, H nominal only.

v_darkstp.pro

Plots dark level / exp time / temperature for a complete Rosetta STP, H nominal only.

v_rawstp.pro

Plots raw level + dark for a complete Rosetta STP, H nominal only. Intended to check saturation.

v_geostp.pro

Plots illumination angles for a complete Rosetta STP, H nominal only.

v_tempstp.pro

Plots max temp for a complete Rosetta STP, H nominal only (less usefull)

cubestp.jou

Script to launch all the above routines for an STP on lesia04.

v_catfile.pro

Writes a catalogue of Virtis file present in a directory.
See AMIE_FIND to loop on subdirectories.

v_verifgeom.pro

Plots data and  incidence /emergence for M_IR cube in a STP. Visual check to see if it fits.

v_mapstp_limit.pro
v_mapstp.pro
v_mapstp2.pro
v_mapstp_test.pro

Maps a complete Rosetta STP, H nominal only (on a sphere, though!), spectra on the surface only. The first routine return limits in values and coordinates. The third one plots a spectral parameters (hard written).
Option /FILTER in v_mapstp filters elongated pixels (not extremely accurate, but workable)
v_mapstp2.pro is an assesment of map_proj_forward (not convincing) - variations _0 and _1 where early attempts.

 

2f- Virtis spectral inversion  

Routines used to deconvolve reflected and thermal contributions. Used also for Mercury, etc…
See files "Ajustements T et reflectance.doc" for efficiency estimates of various versions + Therm_invert & Therm_com.jou

invSteins2.pro

Simultaneous inversion of spectral radiance & temperature, given the viewing angles. Lambertian and Lommel-Seeliger models are implemented and can be selected. Specific to M-IR because of solar spectrum only. Works with H on option (processes order 0 only).

invSteins3.pro

Version to use a selection of wavelengths in the fit. Intended to fit spectral bumps…

invSteins4.pro

Version to fit only T, with cst reflectance.

v_invtherm.pro

Generalized version of invSteins2 for Steins and Lutetia.
Clean + Use measurement uncertainty for each channel. Can diverge at crossover (Lutetia).

v_invtherm_mp.pro

Idem but uses MpFitFun instead of Powell, to be fixed. See *H2*

v_invtherm3.pro

Variation including constraint on spectral continuity. No longer diverges, but slow.

v_invtherm3b.pro

Refined version: Constraint on spectral continuity, applied only to channels with significant thermal emission. Much faster, but weighting seems different (?) - TBC

v_invtherm4.pro

Refined again: Constraint on continuity applied to radiance;  faster, but still rather slow. Best version to date (2014), from comparison with further variants.

Tlutetia4_split.pro

Wrap-up routine to process a complete cube, with split loop for multiprocessor machines.


invtherm_H.pro

Equivalent to invSteins* routine for Virtis H. Very old

invtherm_H2.pro

Refined version to invert H-merged spectra. Handles H spectra in original order (ie, decreasing wvl).

invtherm_H2_mp.pro

Idem but uses MpFitFun correctly (instead of Powell), adapted from v_invtherm4 but only fits T and mean reflectance

invtherm_H3_mp.pro

Idem but uses MpFitFun correctly (instead of Powell), adapted from v_invtherm4. Intended for complete reflectance inversion, to be finalized.

invMerc*.pro

Alternative versions for Mercury/NTT. See details in routines…

TSteins2.pro
TSteins3.pro

Process a whole cube (wrapper to the above routines). Provides temperature map + average spectrum & dispersion (see scripts ess_envi).


3- ISM plots and maps

See SOFTINFO.TXT in the ISM data base for details.

This library is intended to manipulate easily data files from the ISM / Phobos-2 experiment. They allow reading and plotting/mapping of the data in the form included in the PDS archive. The software itself is a part of the archive. 

Sophisticated mapping routines (not included in the archive):

multitrace.pro

Generalized mapping routine for ISM: Maps any spectral parameters on several ISM sessions. Superimpose Mars contours from DTM and follows the planetary convention (for IDL 5). Mini / max values are computed from the data files in interactive mode. They can be set independently for each session in batch mode, to match diffent dynamics in the session files.
Procedures used: LITSESSION.PRO, LITFILE.PRO, SELECTCHANNEL.PRO, LITSESSIONNAME.PRO, LITPARAM.PRO + low level routines below. Replaces ISM_MAP in the ISM archive, but uses the remainder.
Rajouter :
- Permettre l'utilisation d'un fichier de données externe pour les affichages Gmode.
- Vérifier Phobos, ne pas mélanger avec Mars. Pb : ça utilise les coordonnées lat/long au lieu des coordonnées écran.
- Voir si on peut améliorer le lissage quand un des pixels est à zéro (pose un pb au moins avec la ligne incomplète à la fin, mais limité parce que ça vient après le bytscl).
- Registrer les deux ordres sur mot-clef (/MATCHORDER), pour permettre les combinaisons de canaux (ça diminue la taille de la matrice). Si c'est utilisé, aller chercher les canaux ordre 1 plus loin (faire shift(tab.spect, 1, 1) si canal gt 31- vérifier ce décalage...), prendre ind=where(coord.mirror ne 0 and shift(coord.mirror,1,1) ne 0), virer les 4 bords de ima avant affichage. Pas très important pour mettre ensuite dans Affcrit2...
- Soigner les sorties PS : virer le titre en haut mais rajouter le détail des opérations en bas, en petit.
- Ajouter un tableau écrit par polyfill pour repérer les spectres dans l'image et les extraire à la souris ensuite (pas de la tarte, et ça risque d'être long).
- modifier l'entrée des chaînes au clavier, le bug d'IDL 5.5 bloque l'entrée des paramètres.
 

pixtrace.pro

Generalized version of ISM_map: Maps a spectral ratio in a single ISM session, or any type of spectral parameters if using a user's defined function. Superimposes Mars contours from DTM (with IDL 5). Plots only one session.

pixtrace4.pro

Identical to pixtrace, except that planetary mapping routines work with IDL 4 only. Not mainainted.

pixtrace2.pro

Identical, does not plot Mars contours, uses terrestrial convention for longitudes (works with map_set, ie. does not require planetary mapping routines).

ISM_map6b.pro

Plots a complete sinusoidal map of all ISM sessions (surface elevation) + IRS footprints over MOLA topographic map, adds Mars topographic contours from MOLA. Uses TVMAP (ISM_map6 and ISM_map7 are preliminary tries).

ISM_map5.pro

Plots a complete sinusoidal map of all ISM sessions (surface elevation), over Viking shaded relief, adds Mars topographic contours.

ISM_map3.pro

Replaced by pixtrace or multitrace. Similar to ISM_map (see below), but uses planetary cartography routines, ie. planetary longitudes and Mars topographic contours (uses mapl_set, only under IDL 4).
 
ISM_ext.pro
Extract spectra and write them as ascii files. Optionally registrer short and long wavelengths orders together (for Mars sessions only).
 
transtime.pro
Converts Spacecraft times to UTC for sessions in orbit. Either converts the input arguments (d/m/y/h/mi/sec.f) or a file (with time strings provided in ISO format). Output is an ISO formatted time string.
 

Simple plotting / mapping routines:

ISMcom.pro

Widget interface to plot ISM maps and spectra of the main ISM sessions (maps of reflectance or albedo in one channel only, use terrestrial convention only). Calls ISM_map.
Possible improvements: :
- Call ISM_map with satellite projection when mapping Phobos. (plot similar to ISM_PHO).
- A possible way to keep correspondence between image and spectra numbers: do a polyfill with the spectrum # together with the map.
- Average spectra in a box.
- Mark extracted spectra in white on the map.
- Implement angle mapping.
- Implement raw data plotting.
- Include xloadct in xwidget.

ISMcom2.pro

Same as above, except that it plots spectra with atmosphere absorptions removed, and tentatively removes aerosols scattered contribution.

ISM_plot.pro

Plots calibrated ISM spectra and an image of a session in grid coordinates.

ISM_raw.pro

Same thing for raw data (not implemented as option in ISM_plot for simplicity).

ISM_map.pro

Maps a single session in Mercator projection (Mars and Phobos). Maps of reflectance or albedo in one channel only, use terrestrial convention only.

ISM_pho.pro

Maps the Phobos session in satellite projection (mimics a photographic image).
Possible improvements: :
- Superimpose contour lines from T. Duxbury's model.

Low level routines:

ISM_sess.pro

Defines sessions parameters for all ISM sessions (called by higher level routines).

ISMdef.pro

Defines ISM data base root directory (called by ISM_sess, can be modified to match local directory structure).

ISM_data.pro

Reads ISM data files (odd or even channels separately).

ISM_coor.pro

Reads coordinate files (longitude / latitude).

ISM_lam.pro

Reads wavelengths file.

ISM_noise.pro

Reads noise estimates file. Used by multitrace, pixtrace, pixtrace2.

ISM_rep.pro

Reads ISM spectral response in every channel. Can be used to convolved any spetrum to ISM spectral resolution. The values can be plotted by AffRep.pro.

Other plotting routines in the ISM PDS archive:

affspe.pro

Plots ISM spectra or calibration data from separated ascii files.

affrep.pro

Plots ISM spectral response.

litalt.pro

Reads altimetric data files and plot the corresponding maps.

litpav.pro

Same as ablove, special routine for altimetric map over Pavonis Mons (HR session)

litbidim.pro

Reads and plots ground calibration files for bidim measurements.

 

3b- ISM Gmode analysis support

See file leggimi.asc
These routines are used to interface ISM with the Gmode analysis program in fortran (plot prepared data files and results). Apparently used also for other data sets (Clementine NIR…).
 

dendro.pro

Plots dendrogram of classification from file Dendro (output of SuperG)

affcrit2.pro

Maps ISM spectral parameter files used as input to SuperG (= output file of CritISM.for). Uses routines from the ISM data base (+ ismsess.pro).
Modif possible : Modifier pour affichage multisession (comme pour multitrace.pro).

crit2envi.pro
crit2envi2.pro

Converts ISM and Clementine Gmode parameters files (output of critism.for) formatting to something suitable for ENVI.

compara2.pro

Maps ISM spectral units from Gmode analysis (file ELEM from SuperG). Uses routines from the ISM data base.
Modifier pour affichager multisession (comme prévu pour Pixtrace.pro)

sumcla.pro

Plots spectral types from one ISM session. Uses routines from the ISM data base.

ismsess.pro

A special version of ISM_sess containing the number of spectra after orders registration (to be used for outputs of critism.for, which computes data files for superg.for).

 

3c- Other ISM analyses

crosfen.pro

Writes a file identifying overlaping pixels in sessions Hebes and Gordii

calcaer.pro

Uses the file written by crosfen to estimate aerosols contribution over Tharsis. The result is a refined version of the spectrum in Erard et al. (Icarus, 1994), using the final calibration procedure and pixel registration.

corcoor.pro

Straighten coordinates to control points. Uses three different methods.  

 

4- OMEGA plots and analysis

These routines read, plot and handle OMEGA data files. They are used in conjonction with the GEOM_* routines by N. Manaud which read the geometrical files, plus some utilities described below. Mapping routines use the mapl_set library above.

lecomeg2.pro
lecomegB.pro

Modified lecomeg routine with faster inputs. lecomegB is a main program calling this routine. Routine v_readpds is also OK.
To do :
- Change string verif procedure.
- Adapt to final labels (PSA version)

oa_writepds.pro

Writes a PDS file with label for OMEGA atmospheric simulation cubes (data computed by R. Melchiorri).

calspe.pro

Calibrates an IR OMEGA spectrum, or a Visible frame. TO BE UPDATED.

dis_cal.pro

Calibrates an IR OMEGA spectrum from the Mars Global observation only. Alternative version 2 exists. omecal.pro is still an older version.

calcube.pro
reduc_vis.pro
iiOrdCorr96.pro

Calibrates a whole OMEGA cube to I/F. Visible segment is handled by reduc_vis.pro, which calls the iiOrdCorr96 function. Rough atmospheric correction is optionally performed using coratm.pro.
Calcube1.pro is the previous version, checked in level and shape.
To do :
- Update with new visible channel calibration.

coratm.pro

(Function) Corrects a cube or a spectrum from atmospheric absorption in the NIR channels (YL method).

ref.pro

(script) Loads all OMEGA calibration files + average atmospheric transmission at the main level.

om_lam.pro

(main program) Reads OMEGA wavelengths.

litxx_x.pro
template_litxx_x.pro

(script) Read and calibrate sub-session N in the current data directory. Return calibrated data, wavelengths and geometry to the main level + plot profile. Integration times and options must be adapted to the current sub-session (OK only with last version of labels, first data release to PSA). template_litxx_x.pro is the updated template for these scripts

tranche.pro

Plots an OMEGA session in one channel, wrapped around the window size. Input is a cube + channel number (for reflectance maps), or an image.
KEYWORD PARAMETERS:
nscan : number of scans per stripe (default is 500)
global: if set, scale grey levels globally for the image (default is to
scale each stripe independently)
titre: window title
tilt: rotate session to put E right (for sessions acquired in inverted geometry)

om_ext.pro

Extracts and plots OMEGA spectra from an image displayed by tranche.pro (om_ext0.pro was a preliminary version with limited support for stripes).
KEYWORD PARAMETERS:
NOVIS: Do not plot visible range if set
NOLAM: plot spectra versus channel number if set
ALL: Plots all channels (default is to skip noisy ends of detectors)
THERM: Scale to thermal range (default is to scale in segment C and V)
TILT: rotate session to put E right (for sessions acquired in inverted geometry). To be used with similar option on tranche.pro

To do:
•Print geographic coordinates on option?

om_moc.pro

Maps an OMEGA parameter (spectral ratio or anything…) over the MOC or TES global mosaics, or over the MDIM 2.1 mosaic, possibly with transparency. Optionally plot angles or MOLA topography from geometric cube. default is to uses MOC 64 px/degree compressed as Jpeg (degraded at high resolution, but quick).
Uses procedures MOC_MOS, TES_MOS, and MDIM_MOS to select a part of the mosaic from quadrangle files. With PS device, images with transparency are displayed on a black background.
To do:
• concatenate several quadrangles when needed in *_MOS routines.
• Use MDIM 2.1 as default, and change routine name.
• Fix resolution problem with /MDIM
• uses low resolution on large areas.
• Fix PS display
• Put name of file in name of window
• Fix color scale location on small images
• Filter spectra out of disk.
KEYWORDS:
LIMIT: lat/long limits of the plot area (background image),
in E longitude convention. Should be systematically provided with
the image (use limits from cube if not set).
DLAT, DLON: Small coordinate shift to apply to the image (for MOC)
[TAILLE: define size of plot area if background image is not provided. ]
RES: mosaic resolution (default is 64, option is 4)
TRANS: set the level of transparency in superposition (80-120 usually)
TES: uses TES albedo map (8 px/degree)
MDIM: uses MDIM 2.1 albedo map (64 px/degree). Does not require shift
Ncol: set the number of colors for OMEGA (default is 16, should be <!D.table_size - 16)
NoOpt: use original mosaic size (default is to scale to 300-600 px range)
PARAM: plot quantities from geometric cube (incid|emerg|phase|s/cdist|topo)
NOCUBE: If set, do not plot spectral data (produce simple image plot with grid)
GAP: use exact coordinates from geometric cube (default is to get adjacent pixels)
CHANNEL: define OMEGA segment (Vis, C, L) for coordinates (default is to use C segment, SWL)
HELP: return syntatic help
+ all keywords to Mapl_set, except map projections

om_map.pro

Maps an OMEGA parameter (spectral ratio or anything…) over any contextual image, possibly with transparency. Optionally plot angles or MOLA topography from geometric cube. With PS device, images with transparency are displayed on a black background. Allows to use higher resolution images than OM_MOC.

om_spec.pro

Plots OMEGA spectrum properly in increasing wavelength order, optionally writes it to a file. Accept either a cube with indices or a spectrum in input.

om_avg.pro

Averages OMEGA spectrum ion a box (filters NaN). Output is a 1D floating point vector.
To do:
• Add median option?

omeg_phot.pro

Plots OMEGA photometric profiles. Preliminary version.

omeg_ref.pro

Plots OMEGA reflectance profiles along a session, and compares 1 and 2.2 µm reflectance.

cor_phot.pro

Corrects OMEGA spectrum or profile from photometric effects, using Marsrad model back to normal conditions (IR surface reflected light only). Option /SIMU simulates reflectance in the input geometry. Options NOSCAT and ALB filter scattering corrections.
Procedure PRED_NIV is a wrapper to simulate OMEGA observations from geometry.

simprof.pro

(script) Plots reflectance and corrected profiles for comparison. Accommodate both 47 (old) and 51 (new) geometric cubes.
Procedure NIV_TEL adds range of telescopic images on the plot.

Psimprof.pro

(Routine) ~Same as SIMPROF, callable.
    

5- AMIE plots and analysis

These routines read, plot and handle AMIE image files. They are used with the SBNPDS 4.1 library to access files.

AMIEstart

Script to define AMIE directories and compile specific routines (should be run prior to any AMIE precessing).

Amie_cal

Performs radiometric calibration of an AMIE file (LESIA version). Returns -1 if image file is empty.

Read_amie

Modified version of D. Koshny routine to handle Amie files.

Amie_combine2

Modified version of D. Koshny routine to reconstruct a complete image from frames. Orientation is now OK.

Amie_dark
Amie_flat

Subroutines to pick up optimal dark and flat files in given conditions.

Amie_coins

Compute frame coordinates and angles with Spice for a frame. Process all frames in current directory with option /ALL.
Check that the correct kernel is loaded, specially when changing the metakernel !!. Does not filter empty images, this is done at the moment of plotting (amie_tmap,…).

Amie_find

Find images in a given area by checking all GEO files in current directory. Option ALL processes all subdirectories.

Amie_tmap4

Another variation which reprojects images with POLYFILL in the Z buffer. No manual preorientation performed, saves problems in some situations. Mask borders are more accurate than tmap3 and deformations are minimum at high latitudes. OK to overplot on colour image (amie_tmap4b doesn't).
PS option is terrible, but screen copies are OK. Should compute new frame sizes in X mode, then plot them in PS…
This is the basic routine for all situations. Alternatives are AMIE_TMAP3 (OK, but mask is worse and large deformation at high latitudes, but real time on screen) and AMIE_TMAP2 (nice borders, doesn't overplot).

Amie_tmap

Maps frames using computed coordinates. A file list is required, beginning with map limits and level thresholds.
Overplots on previous map with /OVER (see also amie_super ?). Skip image if file is empty (DATA_QUALITY_ID = -1) or if image is off current map limits.
Uses map_image: automatically rotates frames to get correct image orientation, but does not perform fine rotation in lontg/lat — very basic and inaccurate, image borders always have constant longitute/latitude (vertical/horizontal)… PS outputs are resampled, and are bad quality (try to change option in map_image).
To do:
• Get all GEO files in current directory
• Check this is still working if listed images are in different directories

Amie_tmap2

Variation which first reprojects images with POLY_2D, then map_image. Uses transparency in object graphics to superpose images and maps: problems persist with minimum values in image (masked), but borders are nice. Currently can't handle /over option (several sessions or after tvmap). Large deformation at high latitudes due to poly_2D.

Amie_tmap3a

Other variation which reprojects images with POLY_2D only, from pre-oriented images (may cause problems). Uses mask computed with polyfillV, borders are not very accurate. PS option is terrible, but screen copies are OK. Should compute new frame sizes in X mode, then plot them in PS…

Amie_tmap3

Another variation which reprojects images with POLY_2D only. No manual preorientation performed, saves problems in some situations. Uses mask computed with polyfillV, borders are not very accurate. Overplots on color images. Large deformation at high latitudes due to poly_2D.
PS option is terrible, but screen copies are OK. Should compute new frame sizes in X mode, then plot them in PS…

Amie_phot

Similar for photometric sessions. Overplots 3 frames in different color planes.

Amie_phot2

Improved version.

Amie_phot3

Similar for photometric sessions. Overplots 3 frames in different color planes. Improved plotting version, similar to amie_tmap3.
    

6- Wavelet analysis of spectral data 

See sources.doc with the wavelet paper for details.

This library is intended to analyze planetary or mineralogical reflectance spectra in terms of absorptions (automatic detection of absorption bands — Mulţumesc method).
 

multumesc

Integrated workflow, as a callable routine (independent, so it may diverge from individual main programs in the future):
.r spetest2b      ; computes WT
.r spetest3j       ; analize coef + detailed plot
.r spetest6        ;  plot band tree
.r SpetestLarg  ; recompute width
.r spetest7        ; readable structure(wvl) plot
.r spetest6b      ; readable band plot
Options include /PS (for graphics), /silent (for batch), file (for bands table as csv)
mult_vesta
Build a composite Vesta spectrum from M4ast service, estimate noise correctly, analyze
run_mult
Analyze a set of files from PDS_speclib (selection of SNC meteorites), use rough noise estimate
vestanal
Read results from above routines and compares

Pieces:

spetest2b, spetest3j, spetestlarg

(main prg) Computation + analysis of a single spectrum. Data must be regularly sampled in wavelength (use conv_spec).

spetest6, spetest7, spetest6b

(main prg) Additionnal plot of results ( band tree, structures(wvl), naively reconstructed spectrum from bands & envelopes with recomputed width ).

spetest1, spetest1b

Return working examples (simulations + real spectra) for testing.

Ondecub, idat, lam, nbscale, wavebig

Computation + analysis of an OMEGA cube. Wrapper to Ondecalc.
To do:
- split in two, separate computation and analysis
Ondecalc1, Ondecalc2
Computation for a single spectrum. May use simulations on option (commented out).
Wavelet
Torrence & Compo original routine, almost unchanged. 

rech_min2, sst, time, centre, seuil, decal, visu=visu

Return local minima of vetor sst in a neighborhood 2*decal in width, with value lower than Seuil (<0). Option VISU plots results (sst vs time + minima).

label_struct sst, time, centre, seuil, decal, segm, visu=visu

(procedure) Signal segmentation. Return local minima of vetor sst in a neighborhood 2*decal in width, with value lower than Seuil (<0) + labels structures around minima. Option VISU plots results (sst vs time + minima).
ondespe
Computation check in direct and Fourier spaces.
Ondesig
computes wavelet coef for a complete cube??? 
specbid.pro
Return a dummy spectrum (product of Gaussian functions).

 

6b- Spectral data access and manipulation

slibpds.pro

Front-end interface to read ascii files from the PDS spectral library (beta version, non-standard format). Calls v_headpds, v_pdspar, and plotspe.pro. Optionally plots the spectra. Beware that the formatting is so poor that some spectra can't be read this way.
Should now use v_readpds with the official release of the data base [CRISM data base]. In this case, files are not sorted according to mineral classes, but this is indicated in the index file.
litrelab
(function) Reads most RELAB files.
litfich
(function) Reads some RELAB files (Sunshine mixtures) 

litcalvin

(function) Reads and plots some files from W.Calvin.

litomeg

(function) Reads spectra of samples from OMEGA ground calibration.

litsals

(function) Reads JHUAPL files from Salsbury et al. CDrom.
litusgs
(function) Reads USGS files (Clark et al 2003, version 5).

litaster

(function) Reads spectral files from ASTER (version 1.2, June 1999). Handles subdirectory structure directly. Does not convert units automatically.

littohoku

(function) Reads planet spectra from THN library (Lundock 2009), either zipped or unzipped.

litSenvi

(function) Reads spectral files written by envi in ascii from ASTER. Does not convert units automatically.
 

lit_OH

(function) Reads telluric OH files from Rousselot et al 2000.

plotatm

Plots/overplots atmospheric absorption and solar reference in a given band (scaled in µm). Resolution & level can be adjusted. Uses Kitt Peak spectra (atm), + Colina et al.1996 or Kurucz 1997 solar spectra.

plotglace

Plots/overplots ice reflectance spectra in range 1-5.1 µm. Resolution & level can be adjusted. Uses data from B. Schmitt.

  

continuum.pro

(Function) Computes spectral continuum between 2 given wavelengths (straight line), returns continuum-divided spectrum + continuum on option. Same I/O format as plotspe. Quicklook visu on option.

smoothcont.pro

(Function) Returns continuum-ratioed spectrum, with continuum/control points manually adjusted. Wavelengths must be in increasing order.

conv_spec.pro

(Function) Change spectral resolution by convolving with a Gaussian, and resampling the result at half-Nyquist frequency. Print warning message if oversampling occurs. Optionally plot input/output (for checking purpose). See v_soleilH.pro for convolution at given (wavel, FWHM).

conv_spec2.pro

(Function) Convolves a HiRes spectrum to a given FWHM, at wavelengths of a LowRes spectrum. Print warning message if oversampling occurs. Optionally plot input/output (for checking purpose). Integration point by point to allow for changing FWHM. (deprecated)

conv_spec3.pro

(Function) fixes to conv_spec2, different name to preserve previous usage. The routine to use from now on (2022).

plotspe.pro

Plots a spectrum contained in a 2xN array. Options for column order (wavelength versus level), spectral unit (wavelength vs wavenumber) and overplot. If present, use 3rd column has error bar on option.

  

7- Astro / telescopic data calibration

See also file Programmes.asc for routines related to T1m and NACO/ VLT processing + NACO_library.doc for VLT and NTT.

These routines are intended to prepare, analyze and process telescopic observations of planetary bodies. Also include routines adapted to other data sets (Clementine...).
 
 

Generic calibration library

This library is intended for generic processing of telescope images. It builds on / includes older versions in a modern framework (2023). See file reduction.doc for description.

list_fich
Reads headers of fits files present in directory for reference and verifications. Writes a log of selected fits parameters. Default is fits standard as implemented by MaximDL; supports both OMP/T1m header format (time in seconds introduced by keyword TM-START in the header) or TBL/MOICAM format (~standard FITS).
lit_pile
Reads FITS images and headers in sequence, and plots images. Writes a log of selected images with time. Default is fits standard, support both OMP/T1m header format (time in seconds introduced by keyword TM-START in the header) or TBL/MOICAM format (~standard FITS). Can plot selected images only, using its own output format, to refine selection.
piledark, piledark2
Generic routines to compute a master dark frame, based on OHP T80 telescope. The first one uses a median, the second one a sigma-filter/sigma-reject method (robust mean, providing higher signal to noise ratio).
pileflat
Generic routine to compute a master flat-field, based on OHP T80 telescope. Use sigma-filter/sigma-reject method.
pilepose
Generic routine to compute a median exposure, based on OHP T80 telescope. Calibrates images then uses align_images for registration. Filters hot/dead pixels by median of stack, assuming jittering. Result has same dimensions as original (although images are composited in a larger region, i.e. no wraparound effect).
To do
set sky level = 0 in box (ie: subtract baseline from PFS)? Would correct cloud effects, etc
Provide sigma-clipping option to increase S/N?
piletri
Generic routine to compose a trichro image from calibrated RGB images. Accepts either a catalogue of image files, or 3 variables containing R/G/B images (which can be preprocessed, filtered, etc). Crops the overlapping area (where the 3 images overlap).
align_images
(Procedure) Alternative to correl_optimize, much faster and straightforward. Allows magnification ratio for sub-pixel alignment.
decoup
(Function) Extract subimage of given dimensions; optionally use centroid to center region of interest. Options are to replicate borders or wrap image, and to enlarge the result with rebin.
TO BE FIXED:
center may be off by one px with edge_wrap
Pb with dimensions with edge_truncate if /centroid.
centro
(Function) Compute barycenter of a vector or an image from values above the mean only. Result is invariant by linear transform of image levels. Allows centering a bright object inside an image - (more robust than the SSW centroid function for instance).
ds9
Call DS9 from IDL/GDL, clever implementation (from D. Rouan).
To do::
Check functioning on current system

Positioning

calcvit

Computes speeds in alpha and delta from an ephemerid in BdL format (éphémérides de position). Speeds are given in arcsecond by second of time in both directions (required by Pic du Midi's TBL software before 2003). Most useful to follow the Moon and asteroids!

pAng

Computes the parallactic angle of a source seen from a given location. Align a long spectroscopic slit on this angle, especially at high airmass.

seeingExt

Computes seeing and extinction variations with airmass and wavelength (extinction depends on an unknown spectral parameter).

Catalogue / Selection / Preview

catafits

Writes a catalog of FITS images describing filters, exposure times, special mode (window vs complete matrix)... Adapted to MOICAM [IR camera on the Pic du Midi 2 meter telescope]: all image files are written in sequence with no mention of the filter and exposure times in names. Handles 2D images and stacks.

lit1m

Reads FITS images and headers in sequence, and plots images. Writes a log of selected images with time. Uses either T1m header format (time in seconds introduced by keyword TM-START in the header) or TBL/MOICAM format (~standard FITS). Can plot selected images only, using its own output format, to refine selection.

litout.pro

Plots fits images from Pic du Midi 1 meter telescope in sequence (for a given night and filter).
Writes a log file for selected images (style ib060295.ok, to be changed to *.log). Adapted to 1995 images (header structure).

litout1.pro

Direct plot of T1m images, from image number (permits to select the best ones).

list_fich.pro

Listing of fits files in a directory, produces a log file with important parameters - adapted to MaximDL headers at OHP, includes modes for TBL / T1m.

idnaco

Reads selected NACO images and headers in sequence (from a list), look for non-standard keyword values in ESO headers (such as filter). Uses routines from v_readpds library.

veriftout

Catalogs a NACO data set. Scans a directory for FITS files, reads important parameters in NACO headers and possibly stores them in a file (wrapper to verifmode and verifNTT).

verifmode

Reads important parameters in a NACO header and possibly stores them in a file. These parameters must exist in FITS header for all darks, flats, images and spectral files (look for values of non-standard keywords in ESO headers, using routines from the v_readpds library).  

verifNTT

Similar for NTT telescope / SOFI instrument.

verifcube

Catalogs NACO files from a spectral cube. Select files from catalogue, reads parameters relevant to cube scanning in NACO headers and stores them in a file (look for values of non-standard keywords in ESO headers, using routines from the v_readpds library).

nacocoord

Plots alpha/delta coordinates for a spectral cube, using catalogue from verifcube + map of a scanned object (uses BdL ephemerids).
 

Calibration

disk.pro

Reduction of Pic du Midi T1m images (1995) and rotation (Mars N on top). Results can be saved as Gif images, but IDL must be set to 256 colors before the first plot (otherwise the color table in the gif file is saturated).

disk1.pro

Reduction and rotation of Pic du Midi T1m images (1995) in sequence (for a given night and filter). Image names are given in a file *.log (output of litout) the root of which is used to read flat field images.

piledark, piledark2

Generic routines to compute a master dark frame, based on OHP T80 telescope. The first one uses a median, the second one a sigma-filter/sigma-reject method (robust mean, providing higher signal  to noise ratio).

pileflat

Generic routine to compute a median flat-field, based on OHP T80 telescope.

pilepose

Generic routine to compute a median exposure, based on OHP T80 telescope. Uses align_images for registration. Includes filtering of hot/dead pixels.

combidark

Compute a median dark current image from a list of files (for TBL MOICAM, 2003). First corrects a random offset in MOICAM darks, filtering low quality lines, then plots histograms for checking. Uses medarr.pro in ASTRON.
Amélioration possible : utiliser un fichier au format de sortie de catafits ; vérifier que les temps de pose sont identiques ; utiliser une moyenne robuste.

combiflat

Compute a median flat field image from a list of files (for TBL MOICAM, 2003), plots histograms for checking. Uses medarr.pro in ASTRON. Requires the dark currents files at corresponding times.
Amélioration possible : utiliser un fichier au format de sortie de catafits ; vérifier que les filtres sont identiques ; utiliser une moyenne robuste.

affiflat

Plots all flat or dark images in the current directory in sequence. Alternatively plots a list of images from a file. Also plots histograms. Intended to check average flats and darks from combidark and combiflat.

caltbl99

Calibrates TBL MOICAM 1999 images. Requires the dark current and flat field images in separate files (default is the file name in output of combiflat and combidark).
Amélioration possible : ajouter un seuil pour les images sur fond de ciel. Corriger le problème d'offset découvert en 2003.

caltbl

Calibrates a TBL MOICAM 2003 image. Requires the dark current and flat field images in separate files (default is the file name in output of combiflat and combidark).
Amélioration possible :
-ajouter un seuil pour les images sur fond de ciel.
-Ajouter une routine de correction des cosmiques et pixels chauds sur le modèle de deadpix.pro. Traiter les piles en mode photométrique.

caltbl0

Calibrates a TBL MOICAM image, given a flat field and two dark current images in separate arrays (old).

clem2

Calibrates a Clementine UV-Vis image (in Gif format with separate PDS header) using Brown U. scheme. Requires READPDS.PRO (from SBNPDS).
 

nacodark

Computes a dark frame for NAOS/CONICA on the VLT (useful only for images).

nacoflat
nacoflat2

Compute a twilight flat in short wavelength filters for NAOS/CONICA on the VLT. Compute dead pixels map on option.

nacoflatLW

Computes a skyflat in longer wavelength filters for NAOS/CONICA on the VLT. Computes dead pixels map on option.

nacoflatS

Computes spectroscopic lamps flats for NAOS/CONICA (short wavelength filters only?).

nacolam

(fct) Spectral calibration from arc lamps for NAOS/CONICA in spectroscopy mode. Returns lambda(Y), measured at column X (1024 pixels, interpolated on complete column).

nacostar

Returns and writes a reference star spectrum, calibrated in (relative) flux and wavelength. Writes an IDL save file. First order approach, not the best one.

nacospstar

Compute reference star spectrum, calibrated in (relative) flux and wavelength. Computes two spectra, one for each position of the star on the matrix (medians of the four exposures at each position). Writes an IDL save file with spectra, wavelength, star position in X, and tilt of the star spectrum at this position. The output arguments are the average or median values.

calNACO2

Calibrates a single NAOS/CONICA image in short or long wavelength filters.

caltot

Calibrates a NAOS/CONICA image pile (register frames and compute several averages). Uses several routines from ASTRON, BUIE and JHUAPL.

filtrim

Filters NACO image in Fourier space with Butterworth and plots results with exp scale.

nacospec

Returns a single NACO spectral image calibrated in (relative) flux and wavelength.

nacosmap

Returns NACO spectral cubes from a series of images. Calibrated in (relative) flux and wavelength. TO BE IMPROVED…

nacosmap2

Returns NACO spectral cubes from a series of images during a scan. Calibrated in (relative) flux and wavelength, robust with refined options. Calls nacotellfit for individual spectra.

nacotellfit

Optimizes spectral registration of star and target: resamples to 1/10 or 1/20 spectel and looks for best correlation with 2-3 spectels. Returns the ratio target/star. Called from nacsmap2.

nacoatm

Scales stellar spectrum to telluric bands in calibrated spectrum, and divides it out. May improve telluric correction in some cases when only one star is available.

nacowcube

Writes fits files for a cube and associated wavelengths. To be run /called from nacsmap2.

nacocube

Interactive plot of spectra from a NACO cube.
Example:
tranche, bigspe(*,*,50) ; plot image cube from nacosmap
nacocube, bigspe, biglam ; extract spectra

nacoliss2
nacoconv

Two solutions to smooth a NACO cube in the spectral dimension: both first filter spectels with atm correction remnants (to be defined in the code) and interpolate on original spectels. Nacoliss2 then compute reduced Chebyshev expansion with 60 points (sensitive to sharp level changes). Nacoconv convolves by a Gaussian on 8 spectels and resample to half-Nyquist frequency (uses conv_spec, smoother results).
Nacoliss is an older version with no filtering of bad bands.
Useful to reduce high frequency variations (random+atm) and to reduce number of spectels, in particular for multivariate analyses in ENVI.

 

Filtering / Restoration

mflou

Performs unsharp masking on an image. Requires function FILTER_IMAGE from ASTRON.

butterworth

Computes a Butterworth filter in 1 or 2 dimensions, either low-pass or high-pass. Elements are shifted so that they can be used directly in the Fourier space (filtering with FFT).

smoothfilt

Performs smoothing in a box (IDL smooth function) with null values treated as missing data (not included in the average). This function is rather long to execute, since it must convert the argument into floating point. Returns a real value. Can be used with Seuil.pro to set small values to zero first.

van_cittert

Image restoration with the basic version of Van Cittert algorithm. Provides better results than Max_likelihood or Max_entropy on images of bright extended objects with high contrast, in particular on resolved planetary images. Uses several functions from ASTRON.

naco_ica

Special interface to fastICA for NACO spectral cubes. Includes tries at computing interpretative helps.
 

Mosaics

limbe.pro
minnaert.pro (computation subroutine)

Fits Minnaert exponent on an image.
Modifier pour rendre plus général (Minnaert.pro devrait calculer la fonction de Minnaert dans tous les cas).

bouclek.pro
cylimap2.pro
projcyl3.pro (projection subroutine)
affichek.pro

Computes all the Minnaert exponents within a given range and determines the best fit for each pair of images. Cylimap2 is an alternate version of cylimap with reduced plotting, that stores the results in a file. This file can be plotted by affichek.pro, together with signal to noise ratio.

cylimap.pro
projcyl3.pro (projection subroutine)

Plots a cylindrical map from a selection of T1m images (listed in a file *.log from litout; best used with 2-3 images only).
Performs a complete reduction with dark current measured in the sky background, and an unsharp mask. A Minnaert correction is applied, possible with a different exponentn for the first image and the others.
Scales the images on the overlap region (best correlation), then smoothes the overlap (cosmetic; this needs to be checked first without smoothing).
Reads images, flat-field, ephemerid files and a parameter file (proj%%.dat).
Saves a small map with its longitude/latitude limits (*.idl). Can handle PS output.
ATTENTION : certains tests de projcyl3 plantent en version 5.1 (il faut blinder les where).

cartecyl.pro

Reads files *.idl from cylimap and builds a composite cylindrical map from several nights. Used to build a complete planisphere of Mars for the 1995 opposition. Parameterized, but details are specific to the files used.

polmap1.pro
projpol1.pro (projection subroutine)

Plots a Lambert-polar map from a selection of T1m images (in files *.log from litout; best used with 2-3 images only).
Performs a complete reduction and a Minnaert correction (may be different for the first image and the following).
Reads images, flat-field, ephemerid files and a parameter file (proj??.dat).
Scales the images on the overlap region (best correlation). Can handle PS output. Writes a file *.log0 (sequence of events), a file *.cym with individual unscaled images, and a file *.pol containing the map.
Projpol1 works directly with a long/lat grid provided by polmap1 (no intermediate cylindrical projection).

coordisk2.pro

Complete reduction of a T1m image and cylindrical projection centered on the central meridian. Includes optional Minnaert correction. Uses projcyl3.pro, but unsharp masking needs to be disabled first.
Extraction of 9 meridian profiles every 10° from the central meridian, and search for the polar cap limit (criterion of Cantor et al 1998, HST).
Writes a file ib###ddmmyy.mes containing limits. Best used with I images.

limcal.pro
limcal2.pro
limcal3.pro

Plotting routines for the output from coordisk2. Limcal plots a Lambert-polar map of the measured limits for different files. Limcal2 and Limcal3 plot a regression curve.

mindisk_0.pro

Put photometric and geographic coordinate grids on a NACO image: fit ellipsoid shape, tentative Minnaert correction (~OK for small flattening). Requires subterrestrial and subsolar points + angles.
To do:
- Use ellipsoid grid in all cases. Must use a flatening in a direction different from the pole's. Mindisk and Mindisk_1 are unsuccessful tries.
- Write special version to use HST coordinate files (from J. Li / P. Thomas).

defima.pro

Wrapper to mindisk_0. Reads a NACO log of reduced images, computes illumination from ephemerids and send to mindisk_0 for processing. 

 

8- Planetary photometry

corpsn.pro

Computes black body spectral radiance at a given temperature in SI units (W m-2 sr-1 µm-1).
Handles double precision.
To do :
1) Returns number of photons on option.

Esol.pro

Computes solar spectral irradiance at a given distance in SI units (W m-2 µm-1).
Ajouter une routine de conversion des Jansky en SI.

hapke_smooth.pro

Computes Hapke's model for a smooth surface, given parameters (w, g h, B0), for a set of points defined by their viewing angles (i, e, phase). Currently uses a single-term Henyey-Greenstein function for the particles.

calc_hapke.pro

Computes Hapke's model for a rough surface, given parameters (w, g h, B0, Theta), for a set of points defined by their viewing angles (i, e, phase). Calls Hapke_Smooth with effective angles and uses a correction factor.
A FAIRE : Ne pas recalculer les fonctions des angles si elles sont fournies en entrée, pour accélérer les ajustements.

call_hapke.pro

Computes angular functions and calls Calc_Hapke.pro.

profil_phot.pro

Calls Calc_Hapke.pro to compute photometric profiles.

hapke4.pro

Simplified Hapke's mode neglecting opposition effect and anisotropy (to optimize fitting computation time for small bodies, TBC). Same calling mechanism as Hapke_smooth.pro.

essairug3.pro

Calls Hapke4.pro to compute a photometric profile.

profils.pro

Calls Essairug3.pro to compute photometric profiles. Notice that the name conflicts with user library rouines.

 

8b- Special routines for ISM Phobos photometry

photophob.pro

Widget to select wavelength and call the routines.

concordance.pro

Plot angle maps and reflectance map in a given channel

compare.pro

Plot reflectances and computed reflectances from Hapke's parameters in the visible, compares.

ajusMin.pro

Fits observed data with a Minnaert model, computes exponent and coefficient with error bars. Used to select pixels with consistent angles (those with large residuals are discarted).

ajuste_hapke.pro

 Pas fini 


8c- Mars spectral modeling

lsmars3.pro

Computes areocentric longitude of the Sun (Mars' Ls) and Mars-Sun distance (on keyword) at a given Julian day. Formula from Allison & McEwen, 2000.
To do:
• Add option / Gregorian to enter date more directly?
• Check for 2007 - doesn't seem to agree with Spice

lsmars.pro

Computes areocentric longitude of the Sun (Mars' Ls) and (optionally) Mars-Sun distance at a given Julian day. From LMD's GCM routines. Less accurate than LsMars3.pro (at least in 2004).

MarsRad2.pro

New version of spectral model (summer 2004), still under progress.
Now completely modular:
• Inputs are Ls + local time, location at the surface (long/lat), emergence and phase angles.
• interpolates surface albedo from TES map on option (weighted average between the two unit types).
• uses complete GCM maps for temperature and pressures, including night-time (process atm reflected light beyond terminator, no refraction).
• Special mode for EPF sequences.
To do:
• Include lambda of Virtis Rosetta, for flyby in 2005.
• Finir de nettoyer le code, il faut arrêter après l'appel des routines Photo_*
• use complete aeorosols modeling from optical constants and size distribution ?
• use atmosphere layer model, and multiple scattering (?).

Subroutines called by Marsrad2:

Photo_EPF.pro: Subroutine for Marsrad2: computes EPFS profile. To be checked in detail.
Photo_spec.pro: Subroutine for Marsrad2: computes normal spectra.
Minn_surf.pro: performs Minnaert/phase function correction on spectrum.
AtmPath.pro: compute atmospheric path length in any geometry. Exact geometrical solutions, neglecting refraction (therefore wrong for Earth, byt should be OK for Mars). Provides a finite value at terminator.
LMD4.pro: reads European Mars Climate Database in IDL structure. Pb under Linux system with the files???
Tau_mars.pro: computes opacity at 700 mbar from LMD model, MGS scenario (fct of Ls, lat).
Rayleigh_mars.pro: computes Rayleigh scattering as a fct of angles and surface pressure.
TES_Mos.pro: read the TES albedo map (not specific to Marsrad2).

MarsRad.pro

First adaptation of ana6b to OMEGA-MEx:
• uses 870 wavelengths, including those of OMEGA (preliminary?).
• uses a measured solar spectrum.
• Added ability to write files under different names, to allow automatic calls from a script.

Phot_angles.pro

Transformation routine for MarsRad.pro inputs: computes angles (i, e, phase, local time) from Long/Lat of current + subsolar + subobserver points. 

TES_prof.pro

Returns TES albedo for a series of locations, scaled to Marsrad2 reference spectra (max bright/dark). Uses TES_mos, averages in 1 sq degree around location.

ana6b2.pro

Adaptation with interpolation of surface reflectance, interfaced with OMEGA foot-track interface (approximative…).

ana6b.pro

Compute overall radiance / reflectance factor in the 0.2-5.7 µm range (this version has then evolved into Marsrad.pro).
Inputs are Ls, Local time, Latitude, Emergence, Phase: corresponding incidence is computed (adapted to spacecraft operations).
Input optimized for speed.
Temperatures and pressures are still interpolated, and longitudinally averaged.

ana6.pro

Compute overall radiance / reflectance factor in the 0.2-5.7 µm range.
Inputs are Ls, local time, latitude, Emergence, Phase: corresponding incidence is computed (adapted to spacecraft operations).
Older version.

ana5.pro

Compute overall radiance / reflectance factor in the 0.2-5.7 µm range.
Inputs are Incidence, Emergence, Phase, Ls, local time: corresponding latitude is computed.
Preliminary version with a very rough approximation of surface temperatures.

 

8d- Mercury spectral modeling

mercu6.pro

Same as Mercu5 + extended to UV range and up to 5.2 µm with an altered lunar sample (for Virtis VEx observations of Mercury).

mercu5.pro

Same as Mercu4, + uses Kurucz spectrum + extended to UV range + plot selection.

mercu4.pro

Compute radiance/reflectance of Mercury according to time and observational parameters. (adapted from ana6b, update of Mercu2). Uses Warell & Blewett data.

mercu2.pro

Previous version, with lunar basalt spectrum. Adapted from ana6b, with special T model.

mercu.pro

Apparently a first version.

8e- Comet spectral modeling

nucleus.pro

Naive spectrophotometric model of 67P C-G spectral radiance nucleus, for VIRTIS/Rosetta (adapted from Mercu6).

nucleus_unr.pro

Similar for unresolved nucleus.
     To be checked

 

9- Graphics & processing

wCube.pro

3D data plotter/slicer, for spectral cubes and image piles.

mesure.pro

Interactively computes elementary statistics and signal to noise ratio in a region of interest. There are apparently some problems on Mac Classic OS (related to box_cursor) under IDL 5.2-5.5.

dist_e.pro

(Function) Provides an image with values = Euclidian distance from center (use geometrical center, not indices).

classmean.pro

(Function) Bins an array according to a variable, then computes the average and standard-deviations of a second variable in each bin (ie : mean and sigma of Y in bins defined by X). Useful to plot correlations in noisy situations.
To do: an interface for plots could be added (either an option or a separate, preformatted routine).

cum_hist.pro

(Function) Computes a cumulated histogram of the argument, doesn't plot it.

correl_optimize2.pro / correl_images2

(Procedure) Correl_optimize2 is a variation on correl_optimize from Astron to derive the optimal shift between two images. Correl_images2 uses cross correlation instead of the correlation matrix. This is error-free on image borders, and much faster. Should be OK for planetary images (with ~uniform level). (there are emaining issues…)

align_images.pro

(Procedure) Naive alternative to correl_optimize, much faster and straighforward. Allows magnification ratio for sub-pixel alignement.

decoup.pro

(Function) Extract subimage of given dimensions; optionally use centroid to center region of interest. Options are to replicate borders or wrap image, and to enlarge the result with rebin.
TO BE FIXED :
• center may be off by one px with edge_wrap
• Pb with dimensions with edge_truncate if /centroid.

centro.pro

(Function) Compute barycenter of a vector or an image from values above the mean only. Result is invariant by linear transform of image levels. Allows to center a bright object inside an image - (more robust than the SSW centroid function for instance).

barycentre.pro

Compute barycenter of a vector or an image - unstable when both negative and positive values are present.

dilfour.pro

(Function) Dilate or reduce an image in Fourier space. Requires the image to be correctly sampled, with no aliasing.

powspec.pro

Compute monodimentional power spectrum of a 1D or 2D array.

contour_rms.pro

Contour plot of an array according to standard-deviation in the data.

seuil.pro

(Function) Set small values of the argument to zero. Default threshold is machine floating point precision.

vec_loc.pro

(Function) Returns indice of closest value in a sorted vector (-1 if out of bounds). Based on value_locate which returns largest smaller value. Specially useful to identify spectral channels of interest.

gradient.pro

(Function) Return gradient of an image as a cube. Euclidian norm is used, with adaptive step.

inout.pro

(Function) Tells if a point is inside a polygon. Assumes convex polygons and Euclidian geometry. OK with geographic/celestial coordinates only for small areas, may fail near the poles. Useful to match pixels from two different instruments (eg, Virtis M and H).

sigmo.pro

(Function) Sigmoid with parameters, intended to fit measurements with MPfitfun (see ex in header).
 

9b- Graphics & utilities  

oulimach.pro

Poetry machine. Based on Oulipo's S+7 method, with provision for second thoughts. Use external dictionaries, default is now ISO encoding. Option /classic preserves fonctioning under Mac OS Classic.

simqueue.pro

Simulate event queue, allows to run non-blocking widgets and iTools from a procedure.

pson.pro
psoff.pro

Modified versions of L. Gumley routines to generate a PS plot.

psstart.pro
psstop.pro

Routines to generate plots with nice outlay, either for presentations or papers. All files are produced in PS; to be converted to PNG for presentations, but this is the only way to get correct fonts.

col_plot.pro

Define color table with 16 colors (or TEK color table on option), white background and black lines, adapted to screen copy. Now works on windows driver.

cie.pro

Integrate a spectral cube on CIE color-matching functions and return color planes. Allows to a plot real trichro image from a spectral cube in visible range.

xct.pro

Interactively changes color scale with immediate effect on 24 bits displays (convenient wrapper to Xloadct).

Xdisplay1.pro

Calls Xloadct and replots current image with new color table after each change. Required for use on a 24-bits system. Some misfunctionings, though...

couleurs.pro

Plots color chart on the current device.

couleurs8.pro

Plots color chart of v8, graphic functions - very slow!

traits.pro

Plots line and symbol chart on the current device (including symbols from ASTRON).

wpalette.pro

Displays a continuous color palette in a separate window. Useful to check color values in images.

tvpal.pro

Displays a simple color bar anywhere on the current window, with min/max/mean values. Intended as a versatile routine for plotting. Optimized for X, Mac and PS devices.
PS plot to be fixed (numbers color).

put_color_scale

Displays a continuous color palette in the current window, with numbers (adapted from a ESRG routine).
Amélioration possible :
1) changer le nom ;
2) simplifier l'affichage en mode PS : il ne faut pas utiliser une image pour remplir le cadre (fabrique des fichiers gigantesques), mais 256 lignes de couleurs différentes et d'épaisseur convenable.
3) Vérifier le fonctionnement en 24 bits.

desat.pro

Change saturation values in a 24 bits RGB image (saturation parameter is constrained in the [0,1] domain).

unix2ISO.pro

Converts a string from HP encoding (unidentified coding, used in Text Editor) to characters used by IDL in plots (ISOlatin 1).

wclose.pro

Closes all open (non-widget) windows.

wcopy.pro

Copies the current window to a new window with similar dimensions. Useful to save a plot before running again a routine if window numbers are constant.

conv_int.pro

Converts 16-bits integers to 32-bits integers to handle 16-bits images (this was usually a problem in versions < 5.2 since IDL 16-bits integers were always signed. No longer useful with IDL >= 5.2).

10- Databases / VO routines

See directories VO-essais/* and "in/out services" for specific ingestion & preprocessing routines (typically writing a CSV file for ingestion in DaCHS)

csvtobib.pro

Converts a CSV file to bibtex format (very handy with Bibdesk). Specific to transfer my personal library from FileMaker, but provides a template that can be adapted.

read_vot.pro
write_vot.pro

Read and write a VO table using STILTS on Unix systems. Seems complete in v2 (March 2016) - cannot include units in fields with this method.

coma_votable_3Dview.pro

Reads an ascii / csv file and turns it to a VOtable to ingest in 3Dview (via SAMP, ie from TOPCAT). OK for coma measurements from VIRTIS H.

The IKS and VVEx routines are intended as templates to be adapted to prepare other small EPN-TAP services.

v_collectpds.pro

Parses the PDS labels from a complete archive, writes a CSV index + SQL routine to create a database (for MRO spectral library: stores all label keywords, supports varying label content).

dbvex.pro

Reads the extended PDS index from the VVEx archive, writes an SQL routine to create the database. See VVEx.jou

dbiks.pro

Parses the PDS labels from the IKS archive, writes a CSV index + SQL routine to create the database (selects info from labels + extra information). See IKS.jou
catiksfiles.pro
Reads all PDS files from the IKS archive, convert them to VOTable. Includes a writeVOtable function that can be adapted to other datasets - best solution so far (includes units and UCDs in FIELD elements, so it is OK for CASSIS) - not generic though, has to be adapted.

catiks.pro

Parses the PDS labels from the IKS archive, writes a VOTable index.

thnfiles.pro

Reads all txt.gz files from the THN planet spectra library archive, convert them to VOTable (uses littohoku and write_vot routines) - some limitations in VOTable output due to use of write_vot.

convspdsfiles.pro

Convert PDS spectral files to VOtable. Based on catiksfiles, should be OK.