Retrieving and Using Geomagnetic QuantitiesReturn to: Analysis Threads | Analysis Main Page
OverviewSome NICER background models rely upon geomagnetic quantites such as "Kp" to operate. There is a recommended way to add these quantities to your filter file so that you can apply the background models. Read this thread if you want to: Add geomagnetic information such as "Kp" to your filter file. Last update: 2022-12-20 IntroductionNICER is a non-imaging instrument. It collects X-rays through concentrator optics to a silicon drift diode detector. You can think of this detector as a single-pixel device, or "light bucket" that captures every X-ray event that is concentrated through the optics. In addition to X-rays, the detectors also collect background events. Many of these events are due to the space environment of NICER (which is the same as the space environment of the International Space Station, the host of NICER). NICER's orbit takes it through radiation belts, as well as the South Atlantic Anomaly. NICER's detectors may also capture solar or extra-solar cosmic rays. All of these backgrounds are typically considered nuisance events, which need to be modeled. One of the current background models utilizes a "Space Weather" method to estimate the background. You can read more about the Space Weather model on the NICER Background Estimators page. A key input to the model is the state of the space weather environment. Although there are many ways to characterize space weather conditions, the NICER Space Weather model uses the Kp-index as its parameter. Another model is the SCORPEON background model, which also uses geomagnetic data quantities. In this case, it uses the solar modulation potential, or SOLAR_PHI, in order to estimate the modulation of cosmic-ray related background, which may vary slowly over time. NICER background models require geomagnetic data to function properly As of HEASoft 6.31, use of geomagnetic data are no long optional. More Details of Geomagnetic QuantitiesFor the he planetary K-index, or Kp-index, is an estimate of fluctuation disturbances to the local magnetic fields. These disturbances are typically caused by the solar wind buffetting the earth's magnetosphere. These same disturbances may produce higher NICER background. The "p" in Kp means "planetary," as an effort to reconcile data from many earthbound magnetometer observatories into a single planet-wide quantity. For more information, consult the Wikipedia article on the subject. There are two sources of compiled Kp-index data.
The solar modulation potential data, or SOLAR_PHI, is compiled by the Oulu cosmic ray station, located in Finland. At the high geographic latitudes of this detector, cosmic rays are easily able to penetrate the earth's magnetosphere, and the neutron monitor at that station is a good proxy for total cosmic rays. Cosmic ray incident on the geomagnetosphere are not constant. The solar wind and magnetic field can also provide a partial barrier to lower energy cosmic rays. This barrier energy is known as the solar modulation potential, or SOLAR_PHI. The NICER team downloads and updates data from Oulu on a routine basis. Geomagnetic Data Must be Updated RoutinelyGeomagnetic data such as Kp and SOLAR_PHI vary from time-to-time and are not predictable. NICER's software uses these quantities to estimate the background levels, but they can only generate reliable and accurate estimates if geomagnetic data that covers the same time range as the observation are available. For this reason, the user must update their geomagnetic data routinely. Typically, when starting a project, users should update their geomagnetic data. If users expect to be analyzing "realtime" or ToO data soon after they are collected, they should regularly keep their geomagnetic data up to date. Geomagnetic Data Now Required by nicerl2 (Not Optional)As of HEASoft 6.31 (NICERDAS 10), NICER software now requires you have updated geomagnetic data. Because the user can select one of several background models, and some of the models require different data, the choice was made to force users to have update geomagnetic data available. As described below, supported is provided to streamline this process. Unlike previous software releases, HEASoft 6.31 and later require user to have up-to-date geomagnetic data. The 'geomag_path' parameter of nicerl2 specifies where the task should find geomagnetic data. However, many users may find that storing this data in a location and using an environment variable GEOMAG_PATH, as described below, may be a simpler situation. This is in fact, the default. Note that if you set geomag_path=NONE, you will disable geomagnetic-related columns in the filter file, which will prevent you from using most background models. This is also true if you set filtcolumns=NICERV3 or earlier (for compatibility), since background models do not have the proper information with older filter file column sets. The GEOMAG_PATH VariableBy default, the nicerl2 task will automatically look for geomagnetic data in the directory indicated by the GEOMAG_PATH environment variable. This way they can set the GEOMAG_PATH once in their login files (.bashrc, .login, etc), and then not think about it again.
Thus, if the geomagnetic data are stored in /path/to/geomag
the user would put the following in their login files.
If the geomag_path parameter is set to its default, nicerl2 (HEASoft 6.31 and later) will automatically find the geomagnetic data in this way. Easy Way to Download Geomagnetic DataNASA's HEASARC service compiles and provides the geomagnetic data required by NICERDAS. As of HEASoft 6.31, NICERDAS has the tool nigeodown which will automatically download geomagnetic data, unarchive the data and install it. By default, it uses the GEOMAG_PATH environment variable as the location where geomagnetic files are installed. Please note that you will need an active internet connection when you attempt to download geomagnetic data.
To run nigeodown, just type
To diagnose errors, increase the chatter level
To manually specify where geomagnetic data are downloaded to,
Please be aware that nigeodown overwrites existing geomagnetic files with new ones. It ensures that data have been downloaded successfully before installing new data files on top of old files. Installing Geomagnetic Data By CronThe user may be tempted to user a cron job to download and install geomagnetic data on an automated schedule. The NICER team does not recommend downloading geomagnetic data by automatic methods such as "cron." There are several reasons for not recommending cron. First, downloading by cron means that the user's computer must always be awake and connected to the internet when the cron job executes. For many laptop users, this may not be the case. Second, if the download fails for any reason, the geomagnetic files may be left in an incoherent state. And finally, downloading new data while nicerl2 data processing is occuring could leave the resulting data in a questionable or partial state. For these reasons, downloading by cron is an advanced usage that the NICER team cannot provide support for.
If the users insists on using cron, a cron entry to download data
nightly at 02:00 will look something like this,
Details of Geomagnetic Data Archiving
NASA's HEASARC service compiles these files for use with NICER and other missions. The data are
retreived from their sources, formatted into FITS files, and stored here: In order to use any of these tasks, you must
Older HEASoft Versions: Retrieving Geomagnetic DataThe following information is provided for legacy installations (HEASoft 6.30 and earlier). If you have a recent HEASoft installation, please use nigeodown as described above. The geomagnetic data are stored on HEASARC's CALDB area at https://heasarc.gsfc.nasa.gov/FTP/caldb/data/gen/pcf/geomag/. There are two ways you can retrieve the data for usage. It will be important to know your geomag_path, which is the path where the files are stored. Each method described below tells you what that path is. Obsolete Method 1: Download the data once. You retrieve a single tar file from HEASARC, and unarchive it. This is most beneficial if you are going off-line, or if you are going to process many files at once and you don't care about getting the newest Kp file while you are processing. Steps:
Obsolete Method 2: Access the geomagnetic files over the network as needed. With this method, you access the files directly over the network each time they are needed. This is great if you are on the network, because you don't need to download or configure anything. The process happens automatically and you will always get the newest file when you use the correct geomag_path. A downside to this method is that each time the file is needed, it will be re-downloaded: large processing runs will be slowed down, and you will use network data repeatedly. So this method is not recommended if you are off-line, or if you are processing large amounts of data. Steps:
Obsolete Method 3: Combine both methods using a "cron" job. Use a cron job to automatically download geomagnetic data periodically, such as once per day, using Method 1. Although "cron" is not something we can help you with, there are many online resources that can.
In this step we will apply the geomagnetic data to a single observation.
(HEASoft 6.30 and earlier).
where
Note that "nicerl2" will completely reprocess your data from the
ground up, applying all recommended calibrations and screenings. When
it is complete, you will have a new filter file located in
Older HEASoft Versions: Using "niprefilter2" insteadThe following information is provided for legacy installations (HEASoft 6.30 and earlier). If you have a recent HEASoft installation, please use nigeodown as described above. Although "nicerl2" is typically the most simple method to retrieve geomagnetic columns, it does reprocess all of your data from scratch. This can be rather time consuming if you simply want a new filter file. You can generate only a new filter file using "niprefilter2". Here is how to run only niprefilter2. Note that this technique is not recommended if you do need to apply new calibrations or new screenings to your data, since you might as well use the process above with "nicerl2" instead.
First, make sure your filter file is unzipped. As retrieved from the archive, the filter file
is compressed using gzip (a .mkf.gz file). niprefilter2 will not be able to modify a gzipped
file, so uncompress it first.
where
After running to completion, your old filter file will be replaced by a new one. If you do not want to overwrite your filter file, then set outfile to a differently named file. SummaryFollowing the steps described above will add a column to your filter file with the Kp-index data, which will enable you to use certain background filtering models. Modifications
|