; return a structure with constants that were defined using ; #define in nsx.h, nsx.c, ; global variables used in nsx.c ; and c calls that have equivalents in IDL function cnint,x & return, round(x) & end pro timegetstring,wrd & wrd=systime() & end function fopen_read, wrd & openr, fu, wrd, /get_lun & return, fu & end function fopen_write, wrd & openw, fu, wrd, /get_lun & return, fu & end pro fclose, fu & free_lun, fu & end pro free, ptr & if ptr_valid(ptr) then ptr_free, ptr & end pro cqcksrt4, nn, arr & arr[0:nn-1] = (arr[0:nn-1])[sort(arr[0:nn-1])] & end pro cqcksrt8, nn, arr & arr[0:nn-1] = (arr[0:nn-1])[sort(arr[0:nn-1])] & end function nsxng_constants nsxdir = getenv("NSXDIR") if nsxdir eq '' then begin nsxdir = '/usr/local/nsx/nsx' endif if not isfile(nsxdir) then begin print,nsxdir, for='("***error: The directory ",A," does not appear to exist.")' endif nsxng_append_slash,nsxdir constants = { $, KECK1LAT : 19.82594655, $ KECK2LAT : 19.82656052, $ KECK1LONG : 155.47471851, $ KECK2LONG : 155.47423408, $ testprocent : 0, $ Check_AVP_ASPP : 0, $ Change_ASPP_in_AVP : 0, $ nc_Nominal : 2048L, $ nr_Nominal : 1024L, $ TRACE_TEST_ARCSEC : -999., $ ATMABS_CORRECTION : 0, $ VEGA_FLUX_CALIBRATION : 0, $ CONSTRUCT_ATMABS : 0, $ CONSTRUCT_ATMABS_DAT_TBL : 0, $ NSXVERSION : '2018 August 31 (nsx.c), 2020 Feb 24 (nsx.pro)', $ PIXFWHM : 2.2, $ ARCSEC_PER_PIXEL : 0.150, $ MASKSCALE : 1, $ DOBACKSUB : 0, $ CREATE_OFFIMG : 3, $ SOP1CALIB : 0, $ ;one time calibration from SLT to SOP .., $ MINOBJSIGS : 1.0, $ ;Minimum sigmas for a profile object to get automatically extracted., $ NUMMKT : 80500L , $ MAXasp : 10L, $ MAXabk : 60L, $ MAXPRO : 300L, $ MAXSP : 3000L, $ MAXNLS : 900L, $ MAXTYC : 2701000L, $ VERB : 0, $ READ_DARKIMG : 0, $ CALSLANT : 0, $ CALCURVE : 0, $ CALCURVE2 : 0, $ EPERDN : 1.00, $ ; *** #define EPERDN in nsx.c, but then eperdn is also an argument sometimes..., $ ROVDN : 4.00, $ RAWOFF : -10.00, $ DAR_refwave : 12000., $ N2_refwave : 0.d, $ nsxdir : nsxdir $ } constants.N2_refwave = nsxng_set_N2_refwave() return, constants end pro nsxng_constants_test c = nsxng_constants() help, c, /str end