question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add BSRN format reader to iotools

See original GitHub issue

I need a parser for the NASA Langley CAPABLE BSRN site. Given the importance and the quality of the BSRN sites, I expect that others would benefit from this parser as well.

Does anyone have experience with this site or have a parser for the format?

https://capable.larc.nasa.gov/data/

https://cove.larc.nasa.gov/BSRN/LRC49/

Data from December 2014 to present.

1 month of data per file. Appears to be uploaded in the first few days of the following month. 1 minute intervals.

Another fun fixed width file. Entries like:

  1  987   1003 -99.9 -999 -999    975 -99.9 -999 -999
             72 -99.9 -999 -999    287 -99.9 -999 -999     19.9  37.2 1026
  1  988   1006 -99.9 -999 -999    977 -99.9 -999 -999
             72 -99.9 -999 -999    290 -99.9 -999 -999     19.8  36.9 1026
  1 1438     22 -99.9 -999 -999      0 -99.9 -999 -999
             21 -99.9 -999 -999    307 -99.9 -999 -999     17.7  57.9 1023
  1 1439     21 -99.9 -999 -999      0 -99.9 -999 -999
             20 -99.9 -999 -999    307 -99.9 -999 -999     17.6  56.8 1023

The first number is the day of the month. The second is the minute of the day. Times appear to be in UTC.

I believe the ordering is:

  • CM22 pyranometer GHI (upper left)
  • CM31 pyranometer DHI (lower left)
  • CH1 pyrheliometer DNI (upper right)
  • PIR infrared (lower right)

I’d probably read the file into a DataFrame without meaningful columns, split it into two DataFrames using .iloc[::2] and .iloc[1::2], parse the date time information into and index, then stitch the data back together.

CAPABLE Site Coordinates: Latitude: 37.1038 Longitude: -76.3872 Elevation: 3 m ASL

cross post from https://github.com/SolarArbiter/solarforecastarbiter-core/issues/541

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kanderso-nrelcommented, Aug 3, 2020

I created an account but I still don’t have permission to download the tsv file. I also tried to download the file via ftp with wget but got a “login incorrect” message.

Ah, there is a username and password (and for whatever reason, the account you can create yourself doesn’t work). I think there is just a global login that everyone uses – I don’t feel comfortable sharing it publicly, but you can email Amelie Driemel for it: https://bsrn.awi.de/?id=393.

Do you know if the data available over ftp is in tsv format too?

Looks like the FTP files are in the same format as your example, which I think is called “station-to-archive” format: https://bsrn.awi.de/data/station-to-archive-file-format/

I’d like to automate the fetch and parsing so I’d prefer a regular naming scheme to random DOIs.

I wrote a scraper a while back that uses the pangaea search function to list the datasets I wanted: https://www.pangaea.de/?q=project%3Alabel%3ABSRN+%2Bevent%3Alabel%3ALRC+%2Bcitation%3ABasic+-guidelines

Fetching data from the FTP archive would have been cleaner. I don’t think I knew about the FTP archive back then. So maybe for your use case, implementing the more complex “station-to-archive” format would be better. Seems like the choice is a trade-off between nicer data format and easier file retrieval. Side note: I assume you’ll want to be fetching the data automatically in the future, but if you just want historical BSRN data, I have local copies of all the US station data and can share if you want.

Possibly helpful links:

0reactions
AdamRJensencommented, Jan 21, 2021

@wholmgren I have rewritten the function a bit to make it simpler and tested it on a few thousand of BSRN files. It’s my first pull request, so perhaps you could review it and tell me if I am missing something?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pvlib.iotools.bsrn — pvlib python 0.9.3 documentation
Source code for pvlib.iotools.bsrn. """Functions to read data from the Baseline Surface Radiation Network (BSRN). .. codeauthor:: Adam R.
Read more >
Summary of Google Summer of Code with pvlib
During the project, I'll be adding functions to the iotools module ... most proud of is the functions for accessing and reading BSRN...
Read more >
BSRN Toolbox - PANGAEA Wiki
The Baseline Surface Radiation Project (BSRN) makes use of the so called station-to-archive format to share the data of one station for one ......
Read more >
pvlib_python Documentation - Read the Docs
The core mission of pvlib-python is to provide open, reliable, interoperable, ... Copy the SPA files into pvlib-python/pvlib/spa_c_files.
Read more >
Solar Decomposition Models
The irradiance data used is from the BSRN Cabauw station operated by the Royal ... Retrieving the measurement data df, meta = pvlib.iotools.get_bsrn( ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found