Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about using SatelliteToolbox for APTDecoder #1

Open
sasha-intheair opened this issue Sep 8, 2021 · 9 comments
Open

Question about using SatelliteToolbox for APTDecoder #1

sasha-intheair opened this issue Sep 8, 2021 · 9 comments

Comments

@sasha-intheair
Copy link

Hello,

I have a question about producing georeferenced APT images using APTDecoder. I am new to Julia and to most programming, but georeferenced NOAA APT images are crucial for a new research project I'm currently working on, and it seems to me that APTDecoder has the ability to produce them. I followed the instructions on this github to install APTDecoder, and I was following the example decoding process here: https://github.com/Alexander-Barth/APTDecoder.jl/blob/master/examples/APTDecoder.ipynb

When it came to acquiring the NOAA satellite's TLEs, Alexander suggests this line of code:

tles = SatelliteToolbox.read_tle("weather-20190825.txt")

Which I adapted (for my satellite pass time on September 2nd 2021) to:

tles = SatelliteToolbox.read_tle("weather-20210902.txt")

However, instead of the TLE element array received by Alexander, I get:

ERROR: SystemError: opening file "weather-20210902.txt": No such file or directory

I tried different dates and played around with the syntax of the txt file name, but to no avail. Without TLEs, I don't think APTDecoder can georeference my NOAA images. Any help and advice is much appreciated.

Sasha

@Alexander-Barth
Copy link
Owner

Hi Sacha,

You can get a current TLE data from this address: https://www.celestrak.com/NORAD/elements/weather.txt

The function APTDecoder.get_tle(:weather) (https://github.com/Alexander-Barth/APTDecoder.jl/blob/master/src/georef.jl#L53) allows you to download and read TLEs programmatically. This function would update this file once day.

You can call it like this:

tles = APTDecoder.get_tle(:weather).

Sometimes I noticed an slight error in the geo-referenced image (see the southern UK coast). I don't what kind of level of accuracy you would need (for my purposes it is enough ;-)) .

E79rp2QX0AMyuaK

@Alexander-Barth
Copy link
Owner

I just updated the notebook with additional information. Most part of the notebook is about the signal processing. If you are just interested in the results it is sufficient to load the wav files and look at the cells after # decode to image.

@sasha-intheair
Copy link
Author

sasha-intheair commented Sep 8, 2021 via email

@Alexander-Barth
Copy link
Owner

These are not at all silly questions :-) In APTDecoder, I am using the package SatelliteToolbox and the function calls have changed slightly in this package. I just updated APTDecoder so that it works well with the latest version of SatelliteToolbox. Can you update your version of APTDecoder? The error ERROR: MethodError: no method matching init_orbit_propagator(::Type{Val{:sgp4}}, ::SatelliteToolbox.SatelliteToolboxTLE.TLE) should go away.

If you installed APTDecdoder with Pkg.develop, you can update with the shell command git pull.
If you do not have git install, you can also use the following Julia commands to remove and reinstall APTDecoder:

using Pkg
Pkg.rm("APTDecoder")
Pkg.add(url="https://github.com/Alexander-Barth/APTDecoder.jl")

After I press 'return' the cursor just hovers below the line, without adding or generating anything.

Indeed, in Jupyter notebook, to execute a cell you can use Alt-Return or Control-Return.

@sasha-intheair
Copy link
Author

sasha-intheair commented Sep 9, 2021 via email

@sasha-intheair
Copy link
Author

Here are the images that I didn't attach properly in the message above!

CubicSDR_20210902_110035_137913_raw

CubicSDR_20210902_110035_137913_Channel A GeoReferenced

CubicSDR_20210902_11035_137913_Channel B Georeferenced

@Alexander-Barth
Copy link
Owner

  1. This is this color map setting cmap (here RdYlBu_r). By getting the raw data, you can use a different color map if you like (including gray scale). By calling colorbar() you see the mapping between the numbers and colors.
  2. you can ignore it for now. This matplotlib documentation has more information about the pcolormesh function.
  3. the axis of the plot are directly lon / lat WSG84 (no projection). I am not really familiar with map projection in Julia. (https://xkcd.com/977/ :-) )
  4. maybe you can tune the dpi option of savefig https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html ?

If you want to customize the plots (color map, resolution, ...) , I would suggest you to just get the data with the lon/lat arrays so that you can more easily adjust your setting.

The captured data is very good ! Oddly you have a gray/black and white area for lon > 0. Can you call clf() to clear the figures?

@sasha-intheair
Copy link
Author

Hi Alexander,
Thanks very much for these tips- it sounds like changing colours and increasing the resolution of the georeferenced images might be possible. This is crucial for my purposes- I need to control the colour scheme as well as generate georeferenced images in the same resolution (or close) as the raw data.
Since I am not a programmer, when you say 'I would suggest you to just get the data wiht the lon/lat arrays so that you can more easily adjust your setting' do you mean that in addition to saving the 'raw data' (i.e. the raw grayscale png image) there is a way to save arrays of latitudinal and longitudinal points that correspond to the raw data? Since each pixel in the raw image data is about 4km wide / long, does this mean that APTDecoder can generate an array list of lat / long points that correspond to each raw datapoint and its location?
Apologies if I'm mis-interpreting what you wrote above.
Best wishes,
Sasha

PS: another set of images decoded today with APTDecoder

CubicSDR_20210328_102741_137913 Channel B Georeferenced
CubicSDR_20210328_102741_137913_Channel A georeferenced
CubicSDR_20210328_102741_137913_raw

@Alexander-Barth
Copy link
Owner

does this mean that APTDecoder can generate an array list of lat / long points that correspond to each raw datapoint and its location?

Yes, this is exactly right. Note that the function APTDecoder.makeplots allows you to already change the colormap cmap and the resolution dpi:

https://github.com/Alexander-Barth/APTDecoder.jl/blob/master/src/plot.jl#L30

If you need to have more control on the plots, then you would probably need to copy the body of this function and adapt it to your needs and it may indeed require some programming. This is for example a very good introduction to Julia
https://www.youtube.com/watch?v=4igzy3bGVkQ .

Going back to the original question: the variables lonA, latA are the arrays with the longitude and latitude of the A channel (and likewise for the B channel) and indeed you could save them to files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants