# Manually adding instrument response file for generating an station XML

**URL:** https://discourse.obspy.org/t/manually-adding-instrument-response-file-for-generating-an-station-xml/1739
**Category:** Usage Questions
**Created:** [July 12, 2023, 12:58am UTC](https://discourse.obspy.org/t/manually-adding-instrument-response-file-for-generating-an-station-xml/1739 "2023-07-12T00:58:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MagPie](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/m/45deac/32.png) [@MagPie](https://discourse.obspy.org/u/MagPie)
#### Post date: [July 12, 2023, 12:58am UTC](https://discourse.obspy.org/t/manually-adding-instrument-response-file-for-generating-an-station-xml/1739/1 "2023-07-12T00:58:36Z")

</div>

I am trying to re-generate an station xml file for one of our stations for practice using Obspy. The instrument response that we have, is something like below which I like to add manually to the obspy code in this link: [Creating a StationXML file from Scratch — ObsPy.  
The reason for manually adding is that despite the sensor which could be found in NRL, our digitizer is built here and does not exist in NRL.

* * *

- NETWORK (KNETWK): —
- STATION (KSTNM): —
- LOCATION (KHOLE):
- CHANNEL (KCMPNM): CHZ
- CREATED : 2022-02-03T08:10:25
- START : 2020-09-30T05:04:59
- END : 2021-10-18T03:18:30
- DESCRIPTION : –
- LATITUDE : -30.769030
- LONGITUDE : 117.136350
- ELEVATION : 381.0
- DEPTH : 0.0
- DIP : 180.0
- AZIMUTH : 0.0
- SAMPLE RATE : 250.0
- INPUT UNIT : M
- OUTPUT UNIT : COUNTS
- INSTTYPE : Nanometrics Trillium Compact 120s (754 V/m/s),Tril
- INSTGAIN : 7.543000e+02 (M/S)
- COMMENT : N/A
- SENSITIVITY : 3.163660e+08 (M/S)
- A0 : 6.820671e+21

* * *

ZEROS 7  
+0.000000e+00 +0.000000e+00  
+0.000000e+00 +0.000000e+00  
+0.000000e+00 +0.000000e+00  
-3.920000e+02 +0.000000e+00  
-1.960000e+03 +0.000000e+00  
-1.490000e+03 +1.740000e+03  
-1.490000e+03 -1.740000e+03  
POLES 12  
-3.691000e-02 +3.702000e-02  
-3.691000e-02 -3.702000e-02  
-3.430000e+02 +0.000000e+00  
-3.700000e+02 +4.670000e+02  
-3.700000e+02 -4.670000e+02  
-8.360000e+02 +1.522000e+03  
-8.360000e+02 -1.522000e+03  
-4.900000e+03 +4.700000e+03  
-4.900000e+03 -4.700000e+03  
-6.900000e+03 +0.000000e+00  
-1.500000e+04 +0.000000e+00  
-1.569800e+04 +0.000000e+00  
CONSTANT +2.157829e+30

Could you please guide how to manually add instrument response by modifying the given code?  
nrl = NRL()  
response = nrl.get\_response( # doctest: +SKIP  
sensor\_keys=[‘Nanometrics’, ‘Trillium Compact 120 (Vault, Posthole, OBS)’, ‘754 V/m/s’],  
datalogger\_keys=[‘REF TEK’, ‘RT 130 & 130-SMA’, ‘1’, ‘200’])  
print(response)

---

<div class="post-metadata">

### Author: ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)
#### Post date: [July 19, 2023, 10:43am UTC](https://discourse.obspy.org/t/manually-adding-instrument-response-file-for-generating-an-station-xml/1739/2 "2023-07-19T10:43:27Z")

</div>

You could either set up the whole `Response` object from scratch, which will require some insight into response details, or you could try to go the NRL route and try to use the generic unity datalogger item and then afterwards try to tweak the resulting obspy `Response` objects or the output StationXML to your needs. Either way, things can obviously go wrong without knowing what values to fill in where exactly.

> **[NSF SAGE: GenericUnity UnityDatalogger](http://ds.iris.edu/ds/nrl/datalogger/genericunity/unitydatalogger/)**
