Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tutorial will show how to download HMI SHARP data from France to use it in the algorithms.

Prepare

To load SHARP images from France you have to be connected to France over the SSH tunnel and added the port mapping (see ssh_port_forwarding_template.sh). Then you are able to go to the HMI Service UI (http://localhost:8001/ui/) to create your query. The only route you will need directly is the /HMI/{series}.

Follow the instructions on  Access FLARECAST cluster (sshuttle) to make sure you have access to the host "cluster-r730-1"Samples are written in Python but can be adapted to IDL by following Access to REST-Services in IDL

Prepare

Open sshuttle connection to host "cluster-r730-1" (see Access FLARECAST cluster (sshuttle)).

Open http://cluster-r730-1:8001/ui in a browser.

To download sharp_720s images over a period of time you have to set the series parameter and the start and end date. After trying it out you should see the request url which you can use in your python code:

...

Code Block
languagejs
[
  {
    "date__obs": "2016-01-19T01:10:08.400000Z",
    "download_time": null,
    "exptime": null,
    "mask_cadence": null,
    "nbr_update": 0,
    "quality": 1024,
    "recnum": 1958485,
    "recnum_init": null,
    "series_name": "hmi.sharp_cea_720s_nrt",
    "t_rec_index": 1010166,
    "time": "2016-01-20T01:35:28.643542Z",
    "type": null,
    "urls": [
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_conf_disambig.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_Bt_err.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_Br.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_Br_err.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_magnetogram.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_Bp_err.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_bitmap.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_Bp.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_Dopplergram.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_Bt.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958485_20160119011008_continuum.fits"
    ],
    "wavelnth": 6173
  },
  {
    "date__obs": "2016-01-19T01:10:08.400000Z",
    "download_time": null,
    "exptime": null,
    "mask_cadence": null,
    "nbr_update": 0,
    "quality": 1024,
    "recnum": 1958492,
    "recnum_init": null,
    "series_name": "hmi.sharp_cea_720s_nrt",
    "t_rec_index": 1010166,
    "time": "2016-01-20T01:35:30.847712Z",
    "type": null,
    "urls": [
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_conf_disambig.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_Bt_err.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_Br.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_Br_err.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_magnetogram.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_Bp_err.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_bitmap.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_Bp.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_Dopplergram.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_Bt.fits",
      "http://cluster-r730-1:8001/HMI/sharp_cea_720s_nrt/1958492_20160119011008_continuum.fits"
    ],
    "wavelnth": 6173
  }
]

Loading Metadata

We recommend the python library requests to interact with the rest interfaces from python.

...

This list contains the url and the date of the specific SHARP image.

Downloading Images

With the metadata it is now possible to download the actual images. To do this we have written a tiny function which needs a url as parameter and downloads the file. The image name will be obtained from the header of the http response. The files are written in to the same folder where the script is.

...

The sharp_files variable now contains the name to each of the files. 

Script

Here you can download the complete script.

...