read_muse_phangs_voronoi_bins.pro 1.39 KB
FUNCTION read_muse_phangs_voronoi_bins,object,header_in=header_in,header_out=header_out,snr_bin=snr_bin,flux=flux,snr_flux=snr_flux

;stop

;==== maps of MUSE parameters
dir='/Volumes/PILOT_FLIGHT1/PHANGS_MUSE/DR2p2/coopt/MUSEDAP/fiducial/'
file=dir+object+'-0.92asec_MAPS-001.fits'
toto=mrdfits(file,0,h) ;This is ?
print,sxpar(h,'EXTNAME')
;stop
;toto=mrdfits(file,1,h) ;This looks like a map pixel ID
;print,sxpar(h,'EXTNAME')
;ID
flux=mrdfits(file,2,h) ;This looks like a map of fluxes (usable in Dustem ?)
print,sxpar(h,'EXTNAME')
;FLUX
snr_flux=mrdfits(file,3,h) ;This looks like a map of SNR (of flux ?)
;print,sxpar(h,'EXTNAME')
;SNR
snr_bin=mrdfits(file,4,h) ;This is the SNR
print,sxpar(h,'EXTNAME')
;SNRBIN
bin_id=mrdfits(file,5,h) ;This is the bin ID
print,sxpar(h,'EXTNAME')
;BIN_ID
;toto=mrdfits(file,6,h) ;This is the bin ID
;print,sxpar(h,'EXTNAME')
;V_STARS
;toto=mrdfits(file,7,h) ;This is the bin ID
;print,sxpar(h,'EXTNAME')
;FORM_ERR_V_STARS
;etc ...
;stop
hh=cd2astro_header(h)
;image_cont20,snrbin,h,/square,image_color='jpbloadct',imrange=[50,200],/silent,off_bar=obp

ind=where(finite(bin_id) NE 1,count)
bin_id[ind]=la_undef()
print,sxpar(h,'EXTNAME')
h=cd2astro_header(h)
sxaddpar,h,'EQUINOX',2000.

IF keyword_set(header_in) THEN BEGIN
	voronoi_id=project2(h,bin_id,header_in,/silent,/round)
	header_out=header_in
ENDIF ELSE BEGIN
	voronoi_id=bin_id
	header_out=h
ENDELSE

RETURN,voronoi_id

END