Reference for FITS functions
ad_create_colormap
Synopsis
creates a redshift-colormap, where yellow is exactly at where(img==1)
Usage
g_br = ad_create_colormap(img,alp,gmax);
ad_init_raw
Synopsis
subroutine, which reads the data and the header of a raw-redshift image (used by ad_make_image)
Usage
(data,nre,ng,a,theta0grad) = ad_init_raw(filename);
ad_init_raw_timing
Synopsis
subroutine, which reads the data and the header of a raw-redshift image FOR TIMING (used by ad_make_image)
Usage
(data,nre,ng,a,theta0grad) = ad_init_raw_timing(filename);
ad_interpol_image
Synopsis
interpolates the image maximal sz_max times beyond rmin
Usage
image = ad_interpol_image(image,alp_lo,bet_lo,sz_max,rmin);
See also: ad_make_image, ad_init_raw, ad_read_image
ad_make_image
Synopsis
creates a redshift image from the raw data by sorting with respect to alpha and beta
Usage
(img, alp_lo, alp_hi, bet_lo, bet_hi) = ad_make_image(filename);
Qualifiers
- sho_minmax: show the extrem values of alpha and beta?
- timing: read a Brod-Timing-FITS-Table
- field: specify which values are plotted
- disk: use intrinsic x and y instead of alpha and beta (only working for timing yet)
ad_read_image
Synopsis
reads the image and the alpha-beta-grid from the FITS-file created by ad_make_image
Usage
ad_read_image(filename);
See also: ad_make_image, ad_init_raw
ad_write_image
Synopsis
subroutine, which reads the data and the header of a raw-redshift image (ad_make_image) and writes it into a fits-image with the filename "image_*"
Usage
(img,alp,bet) = ad_write_image(filename,size [alp_extr,bet_extr]);
ascii_read_table
Synopsis
reads an ASCII table from a file into a structure
Usage
Struct_Type table = ascii_read_table(String_Type filename, String_Type formats[]);
or
Struct_Type table = ascii_read_table(String_Type filename, List_Type infos[]);
% with infos[i] = { formats[i], columns[i] };
or
(table, keys) = ascii_read_table(String_Type filename, List_Type infos[]);
% with infos[i] = { formats[i], columns[i], units[i] };
Description
The data format of the columns has to be specified as for sscanf; i.e.,
%s for strings, %d for decimal integers, %F for double precision floats, ...
Lines starting with a comment string ("#" by default; see below) are ignored.
The return value is a structure containing the table.
Therefore, the column names have to respect the conventions
for struct-field names (no special characters as "-"...).
If the column name is "", this column is skipped.
If a unit is given, the function ascii_read_table has a second return value,
namely a keys-structure which can be used for fits_write_binary_table
.
Qualifiers
- comment: string which indicates comments [default = "#"]
- startline: Only lines after this number are considered.
- endline: The file is not read after this line number.
- verbose
Examples
variable tab1 = ascii_read_table(filename, [{"%s"}, {"%F"}, {"%F"}]);
%
reads String_Type tab1.col1
, Double_Type tab1.col2
, Double_Type tab1.col3
from filename
variable tab2 = ascii_read_table(filename, [{"%s","A"}, {"%F","B"}, {"%F","C"}]);
%
reads String_Type tab2.A
, Double_Type tab2.B
, Double_Type tab2.C
variable tab3 = ascii_read_table(filename, [{"%s","A"}, {"%F",""}, {"%F","C"}]);
%
reads String_Type tab3.A
, skips one Double_Type
column and reads Double_Type tab3.C
variable tab4, keys;
(tab4, keys) = ascii_read_table(filename, [{"%s","A"}, {"%F"}, {"%F","C","u"}]);
%
reads String_Type tab4.A
and Double_Type tab4.C
as before. With
fits_write_binary_table(FITSfilename, "tab4", tab4, keys);
%
the unit "u" is assigned to the (second) column C.
See also: sscanf, fits_read_table, fits_write_binary_table, readcol
fits_add_fit
Synopsis
adds different saved models and observation info togethter in one FITS table
Usage
Struct_Type str = fits_add_fit(String_Type filename, String_Type save1
[,String_Type save2] [, ...);
or Struct_Type str = fits_add_fit(String_Type filename, Struct_Type save1
[, Struct_Type save2] [, ...);
or Struct_Type str = fits_add_fit(String_Type filename, Array_Type);
Description
This function is based on fits_save_fit and fits_load_fit_struct. If called with String_Type filenames, these files are loaded with fits_load_fit_struct, merged, and saved to the (new) file "filename". If called with Struct_Type, these structure should have been created with fits_save_fit_struct, which will then be merged and saved to "filename". If called with Array_Type, the entries of the array should either be strings loadable with fits_load_fit_struct or structures created with fits_save_fit_struct. It returns the merged structure.
See also: fits_load_fit_struct,fits_save_fit_struct,fits_write_fits_struct,fits_save_fit,merge_struct_arrays
fits_append_binary_table
Synopsis
appends a binary table to the end of a FITS file
Usage
fits_append_binary_table(filename, [extname], data[, keys[, hist]]);
Description
This function employs functions from ISIS' cfitsio module in order to open/create a FITS file,
and append a binary table extension.
See also: fits_open_file, fits_write_binary_table
fits_append_extension
Synopsis
appends a FITS extension to another FITS file
Usage
fits_append_extension(String_Type infiles[], String_Type outfile);
Description
As the external FTOOL fappend is used for this task,
infiles
may contain extension numbers according to the FTOOLS conventions.
The extensions are appended at the end of outfile
.
This function should usually not be used! ISIS' cfitsio module allows to write several extensions into a file after opening it with fits_open_file.
See also: fappend [FTOOLS], fits_append_tmp_extension
fits_append_tmp_extension
Synopsis
appends a temporary FITS extension to another FITS file before deleting it
Usage
fits_append_tmp_extension(String_Type infiles[], String_Type outfile);
Description
As the external FTOOL fappend is used for this task,
infiles
may contain extension numbers according to the FTOOLS conventions.
The extensions are appended at the end of outfile
.
Afterwards, all infiles
are deleted.
This function should usually not be used! ISIS' cfitsio module allows to write several extensions into a file after opening it with fits_open_file.
See also: fappend [FTOOLS], fits_append_extension
fits_column_unit_struct
Synopsis
creates a structure of FITS header keywords containing the units of columns
Usage
Struct_Type fits_column_unit_struct(Struct_Type data; field1=unit1, field2=unit2)
Example
variable data = struct { time, rate };
fits_write_binary_table("lc.fits", "lightcurve", data, fits_column_unit_struct(data; time="MJD", rate="counts/s/PCU") );
See also: fits_write_binary_table
fits_conv_to_legal_char
Synopsis
converts a string into legal characters to be used as a FITS column name
Usage
String_Type legal_str = fits_conv_to_legal_char(String_Type str);
}
See also: fits_save_fit
fits_get_hdu_names
Synopsis
returns the names of all extensions within a FITS-file
Usage
String_Type[] fits_get_hdu_names(Fits_File_Type fp);
Qualifiers
none
Description
Moves to the first extension of a FITS-file using
_fits_movabs_hdu' and then iterates over all extensions using
_fits_movrel_hdu' to read the 'EXTNAME' keyword.
The string array of all extension names is returned.
Note that the file-pointer is located at the last extension in the end. Furthermore the first extension has the index 1 (at least for `_fits_movabs_hdu'), which has to be taken into account if the indices of the name- array are used to find specific extensions.
See also: fits_open_file, fits_read_key
fits_lc_exposure
Synopsis
returns the exposure time of a lightcurve, given by a FITS-file, in seconds
Usage
Double_Type fits_lc_exposure(String_Type file)
fits_load_fit
Synopsis
defines the data and model of a FITS file written by 'fits_save_fit'
Usage
Integer_Type = fits_load_fit(String_Type filename[, Integer_Type index = 0]);
Qualifiers
loadfun - data load function (defualt = &load_data) The following format is neccessary: Argument: String_Type Filename Return: Dataset ID nodata - do not load the data norebin - do not notice and rebin the data nomodel - do not define the model noff - do not set the fit function. Instead only values of existing parameters of the current model are loaded and set. Maybe more useful in combination with 'nodata' to just restore actual fit parameters without overwritting any additional (not saved) components noeval - do not evaluate the model toeval - structure of qualifiers passed to 'eval_counts' strct - reference to a variable to return the structure loaded by fits_load_fit_struct ROC - array of values to set Rmf_OGIP_Compliance for each spectrum before loading (default values = 2)
Description
This function restores the fit saved previously by 'fits_save_fit'. That includes the loaded data and the used model, which is evaluated at the end.
See also: fits_save_fit, fits_load_fit_struct, fits_list_fit_pars
fits_load_fit_struct
Synopsis
loads a FITS file written by 'fits_save_fit'
Usage
Struct_Type str = fits_load_fit_struct(String_Type filename);
See also: fits_save_fit
fits_modify_header
Synopsis
modifies the header of a FITS file
Usage
fits_modify_header(String_Type filename, keyword, value[, comment]);
Description
fits_modify_header uses the external FTOOL fmodhead
and is therefore deprecated.
Use fits_update_key
from ISIS' cfitsio module instead.
See also: fits_update_key
fits_nr_extensions
Synopsis
counts the extensions of a FITS file
Usage
Integer_Type fits_nr_extensions(String_Type filename)
Description
This function counts the number of extensions
in addition to the primary extension, i.e.,
returns fits_num_hdus(filename)-1
.
See also: _fits_get_num_hdus, fits_num_hdus
fits_num_hdus
Usage
Integer_Type fits_num_hdus(String_Type filename)
Description
This function is just a wrapper around the
_fits_get_num_hdus
function from ISIS' cfitsio module.
See also: _fits_get_num_hdus
fits_plot_rmf
Synopsis
plots a redistribution matrix from a compressed RMF file
Usage
fits_plot_rmf(String_Type RMFfile);
or
(interpol_matrix_density, Ebounds, energ) = fits_plot_rmf(RMFfile; getvalues)
Qualifiers
- nx: number of pixels in x-direction [default=400]
- ny: number of pixels in x-direction [default=300]
- getvalues: retrieves the interpolated matrix density
- noplot: skip plotting, but retrieves the interpolated matrix density
See also: fits_read_rmf
fits_read_key_int_frac
Synopsis
reads a keyword from a FITS file, which may be split in integer and fractional part
Usage
fits_read_key_int_frac(String_Type filename, key);
See also: fits_read_key
fits_read_lc
Synopsis
reads a light curve file in FITS format
Usage
Struct_Type lc = fits_read_lc(String_Type filename[]);
Description
Reads light curves from filename
, which can be
a globbing expression, an array of filenames or both.
If there are several light curves, they will be merged
into one data structure with ascending times.
The function assures that the returned structure contains
the fields time
, rate
and error
.
The time field is always converted into Modified Julian Date
according to the MJDREF[{I,F}], TIMEUNIT and TIMEZERO keywords.
Qualifiers
- verbose: show the filename of the light curves when reading more than one
- cut: cut all fields but time, rate, error
- rate_per_PCU: divide count rate for RXTE-PCA light curves by number of PCUs determined from the given filterfile (*.xfl, see 'RXTE_nr_PCUs_from_filterfile').
- time [=
"time"
]: name of the time field, e.g.,"barytime"
; if!= "time"
, this field is renamed"time"
, overwriting any previously existingtime
field - time_in_s: add structure fields for time in sec, MJDref and T0 to the output structure
- filename: add filename structure field
- extension: add number of extension to be read
See also: fits_read_table, fits_read_key, fits_read_key_int_frac, RXTE_nr_PCUs_from_filename
fits_read_rmf
Synopsis
retrieves a matrix from a compressed RMF file
Usage
Struct_Type rmf = fits_read_rmf(String_Type RMFfile);
Description
rmf.matrix[j,i]
describes rmf.ebounds.
*[i]
and rmf.energy.
*[j]
.
Qualifiers
- check: checks rmf-normalization:
rmf.matrixsum_ebounds
is the sum over all ebounds, which should be 1. - spec:
rmf.whitespectrum
is the sum over all ebounds, which should be 1. - float: use for larger RMFs to be able to be loaded in isis.
See also: fits_plot_rmf
fits_read_unsigned_img
Synopsis
reads an image of unsigned integers
Usage
Integer_Type img[] = fits_read_unsigned_img(String_Type filename);
fits_save_fit
Synopsis
saves the model and info of the observation to a FITS table
Usage
fits_save_fit(String_Type filename[, Struct/String_Type conf]);
Description
This function saves information about the model and the observation
in a FITS table. This routine combines the calls of
fits_save_fit_struct
and fits_save_fit_write
.
Additionally, confidence intervals can be given in form of a
structure, containig the fields
name
: name of the parameter like given in fit_fun(...)
value
: best fit value of the parameter (might have changed
during error calculation)
conf_min
: lower confidence limit
conf_max
: upper confidence limit
Therefore, the conf-Structure would, e.g., look like
variable conf = struct { name = ["powerlaw(1).index","powerlaw(1).norm"], value = [2,1e-4], conf_min = [1.8,1e-5], conf_max = [2.2,2e-4] };
Alternatively, the filename of a FITS table created by pvm_fit_pars or the structure returned by pvm_fit_pars can be given.
The values of the model are overwritten, as the error calculation should only yield values equal or better than the original ones.
Qualifiers
- info=Struct_Type: appends the given structure to the table
- hard_limits: also saves all hard limits of the parameters
- silent: no warnings are printed to STDOUT
See also: fits_load_fit_struct,fits_write_TeX_table,save_par,pvm_fit_pars,fits_save_fit_struct,fits_write_fits_struct,fits_list_fit_pars
fits_save_fit_struct
Synopsis
saves the model and info of the observation to a structure
Usage
Struct_Type str = fits_save_fit_struct([, Struct/String_Type conf]);
Description
This function saves information about the model and the observation in a structure table. Using fits_save_fit_write it can be written to a fits file. See "help fits_save_fit" for more information.
See also: fits_save_fit,fits_load_fit_write
fits_save_fit_write
Synopsis
writes a FITS table with info on model and observation
Usage
fits_save_fit_write([, Struct/String_Type conf]);
Description
This function saves information about the model and the observation in a FITS table. It uses the structure created by fits_save_fit_struct. Using self-created structures might lead to strange results. See "help fits_savs_fit" for more information.
See also: fits_save_fit,fits_load_fit_struct
fits_wcs_struct
Synopsis
creates a structure with a WCS that can be written to FITS file
Usage
Struct_Type fits_wcs_struct(String_Type filename)
or
Struct_Type fits_wcs_struct(Double_Type X[], Y[] [, String_Type xtype, ytype[, xunit, yunit]])
Qualifiers
- arrays: return a struct { ctype=[ctype1, ctype2], ... } with arrays instead of struct { ctype1=ctype1, ctype2=ctype2, ... }. This form is, e.g., required by ds9_put_wcs_struct.
Description
The (linear) World Coordinate System (WCS) can be read from a FITS file,
or can be defined from an array of X
and Y
values.
fits_write_arf
Synopsis
Write a FITS ancilliary response matrix file
Usage
fits_write_arf(arfname,arf;qualifiers);
Qualifiers
- telescope: telescope for the ARF
- instrument: instrument for the ARF
- filter: filter of the instrument
- detnam: name of the detector
- exposure: exposure time associated with the ARF
- chantype: see FITS ARF specification (default: PI)
- origin: who write this file (default: ECAP)
Description
Write a FITS compliant ancilliary response matrix arfname: name of the file to be written arf: structure containing the following fields: bin_lo, bin_hi: energy bounds (keV) area: array of length(ebounds.bin_lo) containing the effective area in cm^2 note: the energies given MUST be the same as the input energies of the corresponding response matrix!
See also: fits_write_rmf
fits_write_arf_diff
Synopsis
writes the difference of two ARFs in a corresponding FITS file
Usage
fits_write_arf_diff(String_Type arffile0, arffile1, arffile2);
Description
arf0 = arf1 - arf2
The important header keywords are copied from arf1, assuming that they are the are the same in arf2.
fits_write_binary_table_extensions
Synopsis
writes a binary FITS table with several extensions
Usage
fits_write_binary_table_extensions(filename, data1, data2, ...);
Description
data1
, data2
, ... are either just the data structures
or a list of the arguments 2, 3[, 4[, 5]] of fits_write_binary_table
:
{ extname, data[, keys[, hist]] }
This function should usually not be used! ISIS' cfitsio module allows to write several extensions into a file after opening it with fits_open_file.
Examples
fits_write_binary_table_extensions("data.fits", struct { a1, b1 }, struct { a2, b2 });
fits_write_binary_table_extensions("data.fits",
{ "first", struct { a1, b1 } },
{ "second", struct { a2, b2 } });
fits_write_binary_table_extensions("data.fits",
{ "first", struct { a1, b1 }, struct { key11="value11"; key12="value12" } });
fits_write_gti
Synopsis
creates a FITS file with good time intervals
Usage
fits_write_gti(String_Type filename, Struct_Type gti, Double_Type MJDref);
or
fits_write_gti(String_Type filename, Double_Type start[], stop[], MJDref);
Qualifiers
- creator [
="isisscripts:fits_write_gti"
] (XMM SAS needs an arbitrary value) - date [
="1998-JAN-01"
] (XMM SAS needs an arbitrary value) - combineGTIs [
=1
]: combine intervals that adjoin each other - verbose [
=1
]: tell when intervals are combined
Description
Good time intervals are organized as gti
structures
containing arrays START
and STOP
of the corresponding times,
usually measured in s since the reference date MJDref
.
(If MJDref
is a string, the date is read from this file.)
Intervals that adjoin each other are combined.
The header keywords creator
and date
(according to the qualifiers)
are written to the primary header of the created FITS file.
See also: fits_write_binary_table
fits_write_image
Synopsis
writes an image to a FITS file
Usage
fits_write_image(FITSfile[, extname], image);
or
fits_write_image(FITSfile, extname, image, [xvalues, yvalues[, xlabel, ylabel]][, comments]);
Qualifiers
- WCS [=
""
]: world coordinate system to use, e.g."P"
Description
It is assumed that x
/yvalues
(if provided) are linear arrays,
such that CRVAL = values[0]
and CDELT = (values[-1]-values[0])/(length(values)-1)
.
x
/ylabel
can be a "label [unit]" string.
See also: fits_write_image_hdu
fits_write_pha_file
Synopsis
writes a spectrum to an OGIP PHA file inserting the required header keywords
Usage
fits_write_pha_file(String_Type filename, Integer_Type data)
or
```c
fits_write_pha_file(String_Type filename, Array_Type data[, Array_Type stat_err])
##### Description
The 'filename' argument is the name of the output FITS file.
The 'data' argument can be either the index of a data set, in
which case the isis data set is written to a file,
an array containing the spectrum.
If the array is of IntegerType, the spectrum contains total counts,
If the array is of FloatType/DoubleType, the spectrum is given in counts/s.
(DoubleType arrays will be type-casted to FloatType.)
If 'data' is an array, then the statistical uncertainty is assumed
to be Poisson, unless the errors are given in the 3rd (optional)
argument of the function, 'stat_err'. Note that this argument is
mandatory for the case of count rate spectra.
If 'data' is an index to a data set, then the errors are taken
directly from the data set.
##### Qualifiers
* TELESCOP: the "telescope" (mission/satellite name) ["unknown"]
* INSTRUME: the instrument/detector ["unknown"]
* FILTER: the instrument filter in use (if any) ["none"]
* EXPOSURE: the integration time (in seconds) for the PHA data
(assumed to be corrected for deadtime, data drop-outs etc. ) [1.0]
* AREASCAL: nominal effective area [1.0]
* BACKFILE: the name of the corresponding background file (if any) ["none"]
* BACKSCAL: background scale factor [1.0]
* CORRFILE: the name of the corresponding correction file (if any) ["none"]
* CORRSCAL: the correction scaling factor [1.0]
* RESPFILE: the name of the corresponding (default) redistribution matrix file ["none"]
* ANCRFILE: the name of the corresponding (default) ancillary response file ["none"]
* HDUCLASS: should contain the string "OGIP" to indicate that this is an OGIP style file ["OGIP"]
* HDUCLAS1: should contain the string "SPECTRUM" to indicate this is a spectrum ["SPECTRUM"]
* HDUCLAS2: indicating the type of data stored: "TOTAL", "NET", "BKG" ["TOTAL"]
* HDUVERS1: the version number of the format ["1.2.1"]
* CHANTYPE: whether the channels used in the file have been corrected in anyway,
values: "PHA" or "PI" (see also CAL/GEN/92-002, George et al. 1992, Section 7)
["PHA"]
* start_channel: start value of 'channel' column [1]
__See also__: Definition of PHA FITS format: OGIP/92-007 and OGIP/92-007a
#### fits_write_rmf
##### Synopsis
Write a FITS response matrix file
##### Usage
```c
fits_write_rmf(rmfname,rmf;qualifiers);
Qualifiers
- telescope: telescope for the response
- instrument: instrument for the response
- filter: filter of the instrument
- detnam: name of the detector
- effarea: effective area of the detector (default: 1cm**2)
- lo_thresh: lower threshold of the matrix, i.e., values below this number have been set to zero. Default: 0.
- chantype: see FITS RMF specification (default: PI)
- channel: array of channel numbers for the ebounds extension (default: channels are assumed to start at 1)
- origin: who write this file (default: ECAP)
- constantwidth: write data with width constantwidth around maximum of the matrix.
Description
Write a FITS compliant response matrix rmfname: name of the file to be written rmf: structure containing the following fields: ebounds (bin_lo, bin_hi): channel energies of the response matrix energy (bin_lo, bin_hi): input energies of the response matrix The response matrix can be given in two ways. For most decent resolution instruments, define the matrix as matrix[energy,channel]: with dimensions matrix[length(energy),length(ebounds)] If this does not work (this is the case once the total array size exceeds the limits imposed by s-lang), then define matrix as an Array of Arrays: matrix=Array_Type[length(energy)]; and assign an Array_Type[length(ebounds)] to each element of matrix
Note: High resolution matrices can be VERY large. This code does not yet write variable length arrays due to time reasons. As a work around it is possible just to write information around the diagonal using the constantwidth qualifier.
See also: fits_write_arf,fits_read_rmf
fits_write_tex_table
Synopsis
creates a TeX table ready for input in your document.tex file.
Usage
fits_write_tex_table(String_Type inputFile);
Qualifiers
-
pars : model names given as an array
-
exclude parameters to exclude. One can give whole parameter name as is written in the window output, or just a main part of it (see examples below).
-
extraInfo: extra information such as target name, exposure, etc., the input name is given in the fits header. This qualifier can lead to nasty look of your table.
-
texMulti : tries to fix long extraInfo output in your table.
-
everyPar : parameter name as given can be used as a qualifier itself for changing: name, digits, factor and sciMode (see TeX_value_pm_error on how to use them). Example: powerlaw_1_PhoIndex_value={"name","$\Gamma$","digits",3}
-
sci : change scientific output in one step, for an easier look of the value and its errors in the table. sci=0 will give you maximally correct output. sci=1 will also give you nice output, but may not care about last significant digit.
-
colNames : give new names for your output columns. Applicable only when all names change.
-
fullStat : prints also chi^2_red values.
-
silent : No output generated.
-
flip : flips the table.
-
pdf : produces pdfout.pdf file for a quick look at your table.
-
output TeX output name, default is "default.tex"
Description
-
inFile
input fits file produced by fits_save_fit. In the case of several files(in other words fits for the same model) produced by fits_save_fit, first add the files with fits_add_fit and use it in fits_write_tex_table.
Parameter names, digits, factor output have all default values, but that can be changed with the last mentioned qualifer in the list above.
NOTE: the function is still under development. Hence, it may not be applicable to all available Xspec or local models. If issues emerge, contact refiz.duro@sternwarte.uni-erlangen.de.
EXAMPLE:
fits_write_tex_table("input.fits"; pars=["cutoffpl","reflionx","diskbb","constant"] ,exclude=["diskbb_1_tin_value","norm"] ,constant_1_factor_value=["name","$c_\mathrm{PCA}$"] ,output="my_out.tex" .extraInfo=["target","instrument"] ,target={"name","Source"} ,flip ,pdf);
will:
- use input fits_save_fit file "input.fits"
- look for components "cutoffpl" ,"reflionx", "diskbb" and "constant" in your main model
- exclude parameter "diskbb_1_tin_value" and all parameters with "norm" in the parameter name
- change name of now qualifier (actually a parameter) "constant_1_factor_value" to $c_\mathrm{PCA}$
- write TeX output to my_out.tex
- include target and instrument information
- change name of "target" to "Source"
- flip your table
- produce a pdfout.pdf
See also: fits_save_fit, fits_add_fit, TeX_value_pm_error%
get_map_value_at_position
Synopsis
Extract map value from ra/dec position
Usage
Double_Type value = get_map_value_at_position(map,ra,dec);
Qualifiers
%* verbose: Output detector coordinates on display. Default: 0
Description
This function returns the value of a map at a certain ra/dec position using the wcs of that map. Ra/Dec coordinates must be given as decimal numbers.
See also: read_difmap_fits, fitswcs_get_img_wcs, wcsfuns_project
hardnessratio_from_spec
Synopsis
calculates hardness ratio from given spectrum
Usage
Struct_Type H = hardnessratio_from_spec(String_Type fits, freeze_model_comp)
Description
Calculates hardness ratio from a given spectrum using the model 'enflux'. First argument is a fits file with data and model (from fits_save_fit). Second argument is the model component of the continuum that has to be frozen (see enflux). It first determines the soft and hard energy flux densities of two variable energy bands and then derives the hardness ratio plus error. For the hardness ratio two different definitions can be chosen (either h/s or (h-s)/(h+s)).
Qualifiers
- hard_band: Double_Type[2], hard energy band, default = [7.,10.]
- soft_band: Double_Type[2], soft energy band, default = [2.,4.]
- hr_def: Integer_Type, for hr=h/s choose 1, for hr=(h-s)/(h+s) choose 2, default = 1
- roc: Integer_Type, RMF OGIP compliance, default = 2
See also: hardnessratio_error_prop,enflux,fits_save_fit