Skip to content

PFSS_Tutorial problem #1

@SolarFlandez

Description

@SolarFlandez

Dear,
I am following this tutorial, and specifically the following section:

####################################################################################

Load in PSP Spice Kernels (download happens automatically)

kernels = astrospice.registry.get_kernels('psp','recon')

Generate a list of timestamps to generate the spacecraft positions at

timestamps = [datetime.datetime(2021,3,1)+datetime.timedelta(hours=d)
for d in range(60*24)
]

Create the coordinates. We need the spice string "SOLAR PROBE PLUS"

This produces

psp_coords_inertial = astrospice.generate_coords('SOLAR PROBE PLUS',timestamps)

Transform to Heliographic Carrington, i.e. the frame that co-rotates with the Sun.

psp_coords_carr = psp_coords_inertial.transform_to(
sunpy.coordinates.HeliographicCarrington(observer="self")
)
#####################################################################################

and it shows the following error message:


HTTPError Traceback (most recent call last)
Cell In[37], line 2
1 # Load in PSP Spice Kernels (download happens automatically)
----> 2 kernels = astrospice.registry.get_kernels('psp','recon')
4 # Generate a list of timestamps to generate the spacecraft positions at
5 timestamps = [datetime.datetime(2021,3,1)+datetime.timedelta(hours=d)
6 for d in range(60*24)
7 ]

File ~/.local/lib/python3.10/site-packages/astrospice/net/reg.py:117, in KernelRegistry.get_kernels(self, body, type, version)
114 if type not in types:
115 raise ValueError(f'{type} is not one of the known kernel types '
116 f'for {body}: {types}')
--> 117 return self._kernels[body][type].get_kernels(version=version)

File ~/.local/lib/python3.10/site-packages/astrospice/net/reg.py:207, in RemoteKernelsBase.get_kernels(self, version)
184 def get_kernels(self, *, version=None):
185 """
186 Get a set of kernels. Any kernels not present locally will be
187 downloaded.
(...)
205 timerange.
206 """
--> 207 kernels = self.get_remote_kernels()
208 if version is not None:
209 kernels = [k for k in kernels if k.version == version]

File ~/.local/lib/python3.10/site-packages/astrospice/net/sources/psp.py:71, in PSPRecon.get_remote_kernels(self)
65 def get_remote_kernels(self):
66 """
67 Returns
68 -------
69 list[RemoteKernel]
70 """
---> 71 page = urlopen('https://sppgway.jhuapl.edu/recon_ephem')
72 soup = BeautifulSoup(page, 'html.parser')
74 kernel_urls = []

File /usr/lib/python3.10/urllib/request.py:216, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
214 else:
215 opener = _opener
--> 216 return opener.open(url, data, timeout)

File /usr/lib/python3.10/urllib/request.py:525, in OpenerDirector.open(self, fullurl, data, timeout)
523 for processor in self.process_response.get(protocol, []):
524 meth = getattr(processor, meth_name)
--> 525 response = meth(req, response)
527 return response

File /usr/lib/python3.10/urllib/request.py:634, in HTTPErrorProcessor.http_response(self, request, response)
631 # According to RFC 2616, "2xx" code indicates that the client's
632 # request was successfully received, understood, and accepted.
633 if not (200 <= code < 300):
--> 634 response = self.parent.error(
635 'http', request, response, code, msg, hdrs)
637 return response

File /usr/lib/python3.10/urllib/request.py:557, in OpenerDirector.error(self, proto, *args)
555 http_err = 0
556 args = (dict, proto, meth_name) + args
--> 557 result = self._call_chain(*args)
558 if result:
559 return result

File /usr/lib/python3.10/urllib/request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
494 for handler in handlers:
495 func = getattr(handler, meth_name)
--> 496 result = func(*args)
497 if result is not None:
498 return result

File /usr/lib/python3.10/urllib/request.py:749, in HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
746 fp.read()
747 fp.close()
--> 749 return self.parent.open(new, timeout=req.timeout)

File /usr/lib/python3.10/urllib/request.py:525, in OpenerDirector.open(self, fullurl, data, timeout)
523 for processor in self.process_response.get(protocol, []):
524 meth = getattr(processor, meth_name)
--> 525 response = meth(req, response)
527 return response

File /usr/lib/python3.10/urllib/request.py:634, in HTTPErrorProcessor.http_response(self, request, response)
631 # According to RFC 2616, "2xx" code indicates that the client's
632 # request was successfully received, understood, and accepted.
633 if not (200 <= code < 300):
--> 634 response = self.parent.error(
635 'http', request, response, code, msg, hdrs)
637 return response

File /usr/lib/python3.10/urllib/request.py:563, in OpenerDirector.error(self, proto, *args)
561 if http_err:
562 args = (dict, 'default', 'http_error_default') + orig_args
--> 563 return self._call_chain(*args)

File /usr/lib/python3.10/urllib/request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
494 for handler in handlers:
495 func = getattr(handler, meth_name)
--> 496 result = func(*args)
497 if result is not None:
498 return result

File /usr/lib/python3.10/urllib/request.py:643, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs)
642 def http_error_default(self, req, fp, code, msg, hdrs):
--> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp)

HTTPError: HTTP Error 404: Not Found

######################################################################################

It means that Astrospice cannot find the webpage from which it is trying to download the ephemeris kernels for PSP (Parker Solar Probe).

this url: https://sppgway.jhuapl.edu/recon_ephem , It returns a 404, which indicates that it no longer exists or has been moved.

So, Do you have de correct url or a new method for this code?

Best regards,

Eduardo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions