Page tree

Versions Compared

Key

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

...

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

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

Image RemovedImage Added

To download sharp_720s images over a period of time you have to set the series parameter and the start and end date. Optionally, you can request the available hmi-meta data by the corresponding meta parameter, which may requires some time. After trying it out you should see the request url which you can use in your python code:

Code Block
languagepy
http://cluster-r730-1:8001/HMI/hmi.sharp_720s?start=2015-12-11T00%3A00%3A00Z&end=2015-12-12T00%3A00%3A00Z&meta=false

The result of this query will be a list of SHARP files with a link to them to download it:

Code Block
languagejs
[
  {
    "date__obs": "20162015-0112-19T0111T23:1034:08.400000Z799999Z",
    "download_time": null,
    "exptime": null,
    "harpnum": 6178,
    "mask_cadence": null,
    "nbr_update": 0,
    "quality": 10240,
    "recnum": 19584855605571,
    "recnum_init": null,
    "series_name": "hmi.sharp_cea_720s_nrt",
    "t_rec_index": 10101661005598,
    "time": "2016-01-20T0120T05:3541:2833.643542Z750935Z",
    "type": null,
    "urls": [
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_conf_disambig/5605571/magnetogram.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_Bt_err/5605571/bitmap.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_Br/5605571/Dopplergram.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_Br_err/5605571/continuum.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_magnetogram/5605571/inclination.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_Bp_err/5605571/azimuth.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_bitmap/5605571/field.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_Bp5605571/vlos_mag.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_Dopplergram5605571/dop_width.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_Bt5605571/eta_0.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958485_20160119011008_continuum/5605571/damping.fits",
    ],     "wavelnth": 6173
  }"http://cluster-r730-1:8001/HMI/hmi.sharp_720s/5605571/src_continuum.fits",
  {     "date__obs": "2016-01-19T01:10:08.400000Zhttp://cluster-r730-1:8001/HMI/hmi.sharp_720s/5605571/src_grad.fits",
    "download_time": null  "http://cluster-r730-1:8001/HMI/hmi.sharp_720s/5605571/alpha_mag.fits",
    "exptime": null,     "mask_cadence": null"http://cluster-r730-1:8001/HMI/hmi.sharp_720s/5605571/chisq.fits",
    "nbr_update": 0  "http://cluster-r730-1:8001/HMI/hmi.sharp_720s/5605571/conv_flag.fits",
    "quality": 1024,     "recnum": 1958492"http://cluster-r730-1:8001/HMI/hmi.sharp_720s/5605571/info_map.fits",
    "recnum_init": null,     "series_name": ""http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/5605571/confid_map.fits",
    "t_rec_index": 1010166,     "time": "2016-01-20T01:35:30.847712Z"http://cluster-r730-1:8001/HMI/hmi.sharp_720s/5605571/inclination_err.fits",
    "type": null,     "urls": ["http://cluster-r730-1:8001/HMI/hmi.sharp_720s/5605571/azimuth_err.fits",
       "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958492_20160119011008_conf_disambig5605571/field_err.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958492_20160119011008_Bt_5605571/vlos_err.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958492_20160119011008_Br5605571/alpha_err.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/19584925605571/field_20160119011008inclination_Br_err.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/19584925605571/field_20160119011008az_magnetogramerr.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/19584925605571/inclin_20160119011008azimuth_Bp_err.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/19584925605571/field_20160119011008alpha_bitmaperr.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/19584925605571/inclination_20160119011008alpha_Bperr.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/19584925605571/azimuth_20160119011008alpha_Dopplergramerr.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958492_20160119011008_Bt/5605571/disambig.fits",
      "http://cluster-r730-1:8001/HMI/hmi.sharp_cea_720s_nrt/1958492_20160119011008_continuum5605571/conf_disambig.fits"
    ],
    "wavelnth": 6173
  },
  ...
]

Loading Metadata

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

...

Code Block
languagepy
# define the query parameter
start_date = '2015-12-11T00:00:00Z'
end_date = '2015-12-12T00:00:00Z'
 
incl_meta = 'false'

# retrieving list of SHARP images
print('loading SHARP list...')
sharp_listresponse = requests.get("http://cluster-r730-1:8001/HMI/hmi.sharp_720s?start=%s&end=%s&meta=%s" % (start_date, end_date, incl_meta)).json()

...


sharp_list = response['data']

# extract specific properties of the first SHARP image
sharp_image = 0
first_sharp_date = sharp_list[sharp_image]['date__obs']
first_sharp_urls = sharp_list[sharp_image]['urls']

 

Given the above request url we could download all related hmi-meta data which is, however, not recommended. Resolving hmi-meta data requires some time whereas we may not be interessted in all meta data or all SHARP images. For this reason, we can reload specific meta data for a given set of images.

Image Added

As an example, the above request reloads the area, cmask and distcoef meta data from the SHARP image 5601499. The corresponding url request looks like this:

Code Block
languagepy
http://localhost:8001/HMI/hmi.sharp_720s/meta/5601499?fields=area,cmask,distcoef

The result of this query is a list of header informations and meta data for each requested SHARP image:

Code Block
languagejs
{
  "5601499": {
    "date__obs": "2015-12-11T23:34:08.800000Z",
    "download_time": null,
    "exptime": null,
    "harpnum": 6167,
    "mask_cadence": null,
    "meta": {
      "area": 3507.3125,
      "cmask": 6423,
      "distcoef": "/home/jsoc/cvs/Development/JSOC/proj/lev1.5_hmi/apps//../libs/lev15/"
    },
    "nbr_update": 0,
    "quality": 0,
    "recnum": 5601499,
    "recnum_init": null,
    "series_name": "hmi.sharp_720s",
    "t_rec_index": 1005598,
    "time": "2016-05-26T15:39:51Z",
    "type": null,
    "urls": [],
    "wavelnth": 6173
  }
}

The same way as given in the first code example of this section we can now access those meta data using python and requests:

Code Block
languagepy
# define the query parameter
sharp_image = 5601499
fields = ['area', 'cmask', 'distcoef']

# retrieving list of meta data
print('loading meta data...')
response = requests.get("http://cluster-r730-1:8001/HMI/hmi.sharp_720s/meta/%s?fields=%s" % (str(sharp_image), ','.join(fields))).json()
meta_data = response['data']

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.

...