In [1]:
# setup
from pyrise import products as prod
obsid = prod.OBSERVATION_ID('PSP_003072_0985')
In [2]:
# test orbit number
assert obsid.orbit == '003072'
In [3]:
# test setting orbit property
obsid.orbit = 4080
assert obsid.orbit == '004080'
In [4]:
# test repr
assert obsid.__repr__() == 'PSP_004080_0985'
In [5]:
# test targetcode
assert obsid.targetcode == '0985'
In [6]:
# test setting targetcode property
obsid.targetcode = '0980'
assert obsid.targetcode == '0980'
assert obsid.__repr__() == 'PSP_004080_0980'
In [7]:
# test phase
assert obsid.phase == 'PSP'
In [8]:
# test upper orbit folder
assert obsid.get_upper_orbit_folder() == 'ORB_004000_004099'
In [9]:
# test storage path stem
assert obsid.storage_path_stem == 'PSP/ORB_004000_004099/PSP_004080_0980'
In [10]:
pid = prod.PRODUCT_ID('PSP_003072_0985')
pid
Out[10]:
In [11]:
pid.kind = 'RED'
pid
Out[11]:
In [12]:
pid.s
Out[12]:
In [13]:
pid.storage_stem
Out[13]:
In [14]:
pid.label_fname
Out[14]:
In [15]:
pid.label_path
Out[15]:
In [16]:
pid.jp2_fname
Out[16]:
In [17]:
pid.jp2_path
Out[17]:
In [18]:
for item in dir(pid):
if not item.startswith('__'):
print(item,':')
print(getattr(pid, item))
print()
In [19]:
spid = prod.SOURCE_PRODUCT_ID('PSP_003092_0985_RED4_0')
spid
Out[19]:
In [20]:
spid.channel = 1
In [21]:
spid
Out[21]:
In [22]:
spid.ccd
Out[22]:
In [23]:
for i in dir(spid):
if not i.startswith('__'):
print(i,':')
print(getattr(spid, i))
print()
In [24]:
spid.pid.storage_stem
Out[24]:
In [25]:
spid.pid.edr_storage_stem
Out[25]:
In [26]:
spid.fpath
Out[26]:
In [27]:
hiurl = prod.HiRISE_URL(spid.fpath)
hiurl.url
Out[27]:
In [28]:
hiurl.path
Out[28]:
In [29]:
pid.label_path
Out[29]:
In [30]:
pid.obsid
Out[30]:
In [31]:
pid
Out[31]:
In [32]:
prod.RED_PRODUCT_ID(pid.obsid.s, 4, 1).furl
Out[32]:
In [33]:
prod.RED_PRODUCT_ID(pid.obsid.s, 4,1)
Out[33]:
In [34]:
from pyrise import downloads
In [35]:
obsid = 'PSP_003092_0985'
downloads.download_RED_product(obsid, 4, 0)
Out[35]:
In [36]:
red_pid = prod.RED_PRODUCT_ID(pid.obsid.s, 4,1)
In [37]:
red_pid.fname
Out[37]:
In [38]:
pid
Out[38]:
In [39]:
name = obsid + '_RED'
channels = [4, 5]
ccds = [0, 1]
for channel in channels:
for ccd in ccds:
print(f'{name}{channel}_0.cub')
In [40]:
sid = prod.RED_PRODUCT_ID(obsid, 4,0)
In [41]:
sid.pid.label_url
Out[41]:
In [ ]: